From 49335a2c2f4bd0c2d4b4d3e539c1e8f398a26054 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Tue, 31 Oct 2023 19:01:34 +0000 Subject: [PATCH] Fixed a small bug in log generation and did some cleanup --- system/biu.v | 4 ++-- system/decoder.v | 16 ++++++++-------- system/system.v | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/system/biu.v b/system/biu.v index 5740db6..1dce1b3 100644 --- a/system/biu.v +++ b/system/biu.v @@ -276,11 +276,11 @@ always @(posedge clock) begin /*************** DATA READ ***************/ `define finished_read \ DATA_DIR <= 0; \ - VALID_DATA <= 1;\ if ( read_request == 0 ) begin \ biu_state <= `BIU_NEXT_ACTION;\ VALID_DATA <= 0;\ - end + end else \ + VALID_DATA <= 1; `BIU_GET_ALIGNED_DATA:begin `ifdef DEBUG_DATA_READ_WRITES if(Wbit==1) diff --git a/system/decoder.v b/system/decoder.v index 1f5cd7d..99d21b3 100644 --- a/system/decoder.v +++ b/system/decoder.v @@ -105,14 +105,14 @@ end always @(posedge reset) begin de_state <= `DE_STATE_ENTRY; /* need early init */ - ucode_seq_addr <= `UCODE_NO_INSTRUCTION; - SIMPLE_MICRO <= 0; - owe_set_init <= 0; - set_initial_values<=0; - wait_exec<=0; - first_ucode <= 0; - HALT_LATCHED <= 0; - ERROR_LATCHED <= `ERROR_BITS'h0; + ucode_seq_addr <= `UCODE_NO_INSTRUCTION; + SIMPLE_MICRO <= 0; + owe_set_init <= 0; + set_initial_values<=0; + wait_exec<=0; + first_ucode <= 0; + HALT_LATCHED <= 0; + ERROR_LATCHED <= `ERROR_BITS'h0; VALID_INSTRUCTION_ACK <= 0; end diff --git a/system/system.v b/system/system.v index 3842439..cfe4393 100644 --- a/system/system.v +++ b/system/system.v @@ -65,6 +65,7 @@ initial begin json_file_descriptor=0; `endif sane=0; + finish=0; end //integer killswitch=0; @@ -81,7 +82,7 @@ end `ifdef OTUPUT_JSON_STATISTICS reg first_json_cycle; always @(negedge clock)begin - if(finish < 2 && json_file_descriptor!=0)begin + if(finish < 2 && json_file_descriptor!=0 && sane)begin $fdisplay(json_file_descriptor,"%s{\"C\":%0d,\"L1\":%0d,\"VDI\":%0d,\"JMP\":%0d}",first_json_cycle?"":",",cycles,L1_SIZE_STAT,VALID_INSTRUCTION_STAT,jump_req); first_json_cycle <= 0; end