From c854818d6d9f17a177e3f76497a0ab112b1cdd1f Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Wed, 10 May 2023 04:43:09 +0100 Subject: [PATCH] Tightened up write timing --- system/biu.v | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/system/biu.v b/system/biu.v index 356fc6b..9960655 100644 --- a/system/biu.v +++ b/system/biu.v @@ -28,7 +28,6 @@ `define BIU_PUT_BYTE 4'b0100 `define BIU_PUT_UNALIGNED_16BIT_DATA 4'b0101 `define BIU_PUT_ALIGNED_16BIT_DATA 4'b0110 -`define BIU_PUT_UNALIGNED_PREP_NEXT 4'b0111 `define BIU_PUT_UNALIGNED_PREP_NEXT2 4'b1000 `define BIU_WRITE_EXIT 4'b1001 `define BIU_WRITE_RELEASE 4'b1010 @@ -177,9 +176,6 @@ always @(posedge clock) begin `endif BHE <= 0; data_bus_output_register <= {DATA[7:0],DATA[15:8]}; - biu_state <= `BIU_PUT_UNALIGNED_PREP_NEXT; - end - `BIU_PUT_UNALIGNED_PREP_NEXT:begin write <= 0; biu_state <= `BIU_PUT_UNALIGNED_PREP_NEXT2; end @@ -194,14 +190,14 @@ always @(posedge clock) begin $display("Writing 16bit %04x at %04x",DATA,DATA_ADDRESS); `endif data_bus_output_register <= {DATA[15:8],DATA[7:0]}; - biu_state <= `BIU_WRITE_EXIT; + write <= 0; + biu_state <= `BIU_WRITE_RELEASE; end `BIU_PUT_BYTE:begin `ifdef DEBUG_DATA_READ_WRITES $display("Writing 8bit %02x at %04x",DATA[7:0],DATA_ADDRESS); `endif - biu_state <= `BIU_WRITE_EXIT; if(ADDRESS_INPUT[0:0]==0) begin BHE <= 1; data_bus_output_register <= {8'b0,DATA[7:0]}; @@ -209,6 +205,8 @@ always @(posedge clock) begin BHE <= 0; data_bus_output_register <= {DATA[7:0],8'b0}; end + write <= 0; + biu_state <= `BIU_WRITE_RELEASE; end `BIU_WRITE_EXIT:begin write <= 0;