From 641151b7123c4e5dbbb95392f65c0f3960fc0fef Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 10 Jul 2022 14:23:22 -0700 Subject: Rename memory message types for more clarity. --- hdl/command_parser.sv | 2 +- hdl/core.sv | 7 ++++--- hdl/defs.svh | 12 +++++++----- hdl/mem_arbiter.sv | 8 ++++---- hdl/mem_broadcast.sv | 8 ++++---- hdl/mem_cache.sv | 8 ++++---- hdl/ram_controller.sv | 6 +++--- hdl/result_printer.sv | 4 ++-- hdl/top.sv | 16 ++++++++-------- 9 files changed, 37 insertions(+), 34 deletions(-) (limited to 'hdl') diff --git a/hdl/command_parser.sv b/hdl/command_parser.sv index a4a5190..5be5957 100644 --- a/hdl/command_parser.sv +++ b/hdl/command_parser.sv @@ -15,7 +15,7 @@ module command_parser , input bit command_ready , output bit command_valid - , output ram_command_t command_data + , output arb_to_ram_t command_data , input bit loop_ready , output bit loop_valid diff --git a/hdl/core.sv b/hdl/core.sv index 587ffeb..5f264d9 100644 --- a/hdl/core.sv +++ b/hdl/core.sv @@ -16,11 +16,11 @@ module core , input bit mem_command_ready , output bit mem_command_valid - , output pdp_command_t mem_command + , output core_to_mem_t mem_command , output bit mem_read_ready , input bit mem_read_valid - , input pdp_read_response_t mem_read + , input mem_to_core_t mem_read , input bit [2:0] switch_df , input bit [2:0] switch_if @@ -109,9 +109,10 @@ assign led_current_address = mem_command_valid; assign led_memaddr = mem_command.address[`PDP_ADDRESS_BITS-3-1:0]; assign mem_command.mask = ~0; +assign mem_command.snoop_response = 0; bit mem_hold_valid; -pdp_read_response_t mem_hold; +mem_to_core_t mem_hold; bit rx_ready; bit rx_valid; diff --git a/hdl/defs.svh b/hdl/defs.svh index f8b1032..73fddaf 100644 --- a/hdl/defs.svh +++ b/hdl/defs.svh @@ -5,7 +5,7 @@ `define PDP_ADDRESS_BITS 15 -`define NUM_PDPS 1 +`define NUM_PDPS 4 `define UART_BYTE_BITS 8 @@ -37,22 +37,24 @@ typedef struct packed { ram_line_t data; ram_line_mask_t mask; tag_t tag; -} ram_command_t; +} arb_to_ram_t; typedef struct packed { ram_line_address_t address; ram_line_t data; tag_t tag; -} ram_read_response_t; +} ram_to_arb_t; typedef struct packed { pdp_line_address_t address; bit write; + bit snoop_response; ram_line_t data; ram_line_mask_t mask; -} pdp_command_t; +} core_to_mem_t; typedef struct packed { pdp_line_address_t address; + bit snoop; ram_line_t data; -} pdp_read_response_t; +} mem_to_core_t; diff --git a/hdl/mem_arbiter.sv b/hdl/mem_arbiter.sv index 854867f..a9d7212 100644 --- a/hdl/mem_arbiter.sv +++ b/hdl/mem_arbiter.sv @@ -6,19 +6,19 @@ module mem_arbiter , output bit command_ready , input bit command_valid - , input ram_command_t command_data + , input arb_to_ram_t command_data , output bit [`NUM_PDPS-1:0] pdp_ready , input bit [`NUM_PDPS-1:0] pdp_valid - , input pdp_command_t [`NUM_PDPS-1:0] pdp_data + , input core_to_mem_t [`NUM_PDPS-1:0] pdp_data , input bit ram_ready , output bit ram_valid - , output ram_command_t ram_data + , output arb_to_ram_t ram_data ); bit [`NUM_PDPS:0] hold_valid; - ram_command_t [`NUM_PDPS:0] hold_data; + arb_to_ram_t [`NUM_PDPS:0] hold_data; bit [$clog2(`NUM_PDPS+1):0] selector; diff --git a/hdl/mem_broadcast.sv b/hdl/mem_broadcast.sv index 720699b..599be28 100644 --- a/hdl/mem_broadcast.sv +++ b/hdl/mem_broadcast.sv @@ -6,19 +6,19 @@ module mem_broadcast , output bit ram_ready , input bit ram_valid - , input ram_read_response_t ram_data + , input ram_to_arb_t ram_data , input bit print_ready , output bit print_valid - , output ram_read_response_t print_data + , output ram_to_arb_t print_data , input bit [`NUM_PDPS-1:0] pdp_ready , output bit [`NUM_PDPS-1:0] pdp_valid - , output pdp_read_response_t [`NUM_PDPS-1:0] pdp_data + , output mem_to_core_t [`NUM_PDPS-1:0] pdp_data ); bit hold_valid; - ram_read_response_t hold_data; + ram_to_arb_t hold_data; always @(posedge clock) begin if (reset) begin diff --git a/hdl/mem_cache.sv b/hdl/mem_cache.sv index 2257a4f..181d8d7 100644 --- a/hdl/mem_cache.sv +++ b/hdl/mem_cache.sv @@ -10,19 +10,19 @@ module mem_cache , output bit core_command_ready , input bit core_command_valid - , input pdp_command_t core_command_data + , input core_to_mem_t core_command_data , input bit ram_command_ready , output bit ram_command_valid - , output pdp_command_t ram_command_data + , output core_to_mem_t ram_command_data , output bit ram_response_ready , input bit ram_response_valid - , input pdp_read_response_t ram_response_data + , input mem_to_core_t ram_response_data , input bit core_response_ready , output bit core_response_valid - , output pdp_read_response_t core_response_data + , output mem_to_core_t core_response_data ); localparam ADDRESS_TAG_LO = $clog2(`RAM_LINE_WORDS)+SET_BITS; diff --git a/hdl/ram_controller.sv b/hdl/ram_controller.sv index 14a1609..c67edc3 100644 --- a/hdl/ram_controller.sv +++ b/hdl/ram_controller.sv @@ -9,11 +9,11 @@ module ram_controller , output bit command_ready , input bit command_valid - , input ram_command_t command_data + , input arb_to_ram_t command_data , input bit result_ready , output bit result_valid - , output ram_read_response_t result_data + , output ram_to_arb_t result_data , output bit ram_resetn , output bit ram_csn @@ -30,7 +30,7 @@ module ram_controller assign ram_clkn = !ram_clkp; bit valid; - ram_command_t command; + arb_to_ram_t command; ram_word_address_t base_address; bit slow; diff --git a/hdl/result_printer.sv b/hdl/result_printer.sv index 322fac0..f9910f9 100644 --- a/hdl/result_printer.sv +++ b/hdl/result_printer.sv @@ -6,7 +6,7 @@ module result_printer , output bit result_ready , input bit result_valid - , input ram_read_response_t result_data + , input ram_to_arb_t result_data , input bit echo_ready , output bit echo_valid @@ -18,7 +18,7 @@ module result_printer ); bit hold_valid; - ram_read_response_t hold; + ram_to_arb_t hold; bit loop; ram_byte_count_t byte_count; ram_word_count_t word_count; diff --git a/hdl/top.sv b/hdl/top.sv index 5f98ff9..96b7510 100644 --- a/hdl/top.sv +++ b/hdl/top.sv @@ -155,19 +155,19 @@ module top bit command_ready; bit command_valid; - ram_command_t command_data; + arb_to_ram_t command_data; bit ram_command_ready; bit ram_command_valid; - ram_command_t ram_command_data; + arb_to_ram_t ram_command_data; bit ram_response_ready; bit ram_response_valid; - ram_read_response_t ram_response_data; + ram_to_arb_t ram_response_data; bit print_ready; bit print_valid; - ram_read_response_t print_data; + ram_to_arb_t print_data; bit loop_ready; bit loop_valid; @@ -175,11 +175,11 @@ module top bit [`NUM_PDPS-1:0] pdp_command_ready; bit [`NUM_PDPS-1:0] pdp_command_valid; - pdp_command_t [`NUM_PDPS-1:0] pdp_command_data; + core_to_mem_t [`NUM_PDPS-1:0] pdp_command_data; bit [`NUM_PDPS-1:0] pdp_response_ready; bit [`NUM_PDPS-1:0] pdp_response_valid; - pdp_read_response_t [`NUM_PDPS-1:0] pdp_response_data; + mem_to_core_t [`NUM_PDPS-1:0] pdp_response_data; bit ram_rwds_oe; bit ram_rwds_out; @@ -476,11 +476,11 @@ module top bit cache_command_ready; bit cache_command_valid; - pdp_command_t cache_command_data; + core_to_mem_t cache_command_data; bit cache_response_ready; bit cache_response_valid; - pdp_read_response_t cache_response_data; + mem_to_core_t cache_response_data; `ifdef NO_L1_CACHE assign cache_command_ready = pdp_command_ready[i]; -- cgit v1.2.3