From 83eb76e0b3f6570b5e27e2295551f648eea96d86 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 5 Jun 2022 16:23:07 -0700 Subject: Add cache clearing to the command parser. --- hdl/command_parser.sv | 8 ++++++++ hdl/mem_cache.sv | 15 ++++++++++----- hdl/top.sv | 6 ++++++ tool/download.tcl | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/hdl/command_parser.sv b/hdl/command_parser.sv index 1520db4..a4a5190 100644 --- a/hdl/command_parser.sv +++ b/hdl/command_parser.sv @@ -20,6 +20,8 @@ module command_parser , input bit loop_ready , output bit loop_valid , output bit loop_data + + , output bit clear_caches ); bit input_byte_valid; @@ -43,6 +45,7 @@ module command_parser command_data.mask[i] = ~0; command_data.tag = TAG; loop_valid = 0; + clear_caches = 0; input_byte_valid = 0; input_byte = 0; loop_count = 0; @@ -62,6 +65,7 @@ module command_parser if (loop_ready && loop_valid) begin loop_valid = 0; end + clear_caches = 0; if (!command_valid && !loop_valid) begin case (state) @@ -106,6 +110,10 @@ module command_parser state = READ_LOOP_COUNT; end + "$": begin + clear_caches = 1; + end + endcase input_byte_valid = 0; end diff --git a/hdl/mem_cache.sv b/hdl/mem_cache.sv index 5f3db73..2257a4f 100644 --- a/hdl/mem_cache.sv +++ b/hdl/mem_cache.sv @@ -6,6 +6,8 @@ module mem_cache ( input bit clock , input bit reset + , input bit clear + , output bit core_command_ready , input bit core_command_valid , input pdp_command_t core_command_data @@ -52,16 +54,19 @@ module mem_cache core_response_valid = 0; outstanding_fill = 0; reset_entry = 0; - end else if (reset_entry < (1< 1} { spawn tool/connect -set atline "@[format %x [expr $core * 32768 / $wordsperline]]" +set atline "\$ @[format %x [expr $core * 32768 / $wordsperline]]" send "$atline\n" expect -ex "$atline\r\n" -- cgit v1.2.3