Skip to content

Commit

Permalink
fix to enable/disable caches
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   rtl/config.vh
	modified:   rtl/darkcache.v
  • Loading branch information
samsoniuk committed Aug 18, 2024
1 parent eb1bbe1 commit 6203f4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions rtl/config.vh
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@
// when enabled, the caches will try map and store the read operations, in a
// way that future read operations in the same address will be faster!
// the cache depth N means that the each cache will be 32-bit x 2^N
`define __LUTCACHE__
`define __CDEPTH__ 6
`define __ICACHE__
`define __DCACHE__
//`define __LUTCACHE__
//`define __CDEPTH__ 6
//`define __ICACHE__
//`define __DCACHE__

// interactive simulation:
//
Expand Down Expand Up @@ -208,7 +208,7 @@
//
// to simulate high latency memories, is possible set the number of wait-states
// for bram here! case not configured, wait-states defaults to 1.
`define __WAITSTATE__ 3
//`define __WAITSTATE__ 3

// UART speed is set in bits per second, typically 115200 bps:
//`define __UARTSPEED__ 115200
Expand Down Expand Up @@ -259,7 +259,7 @@
`define BOARD_CK_REF 100000000
`define BOARD_CK_MUL 6
`ifdef __3STAGE__
`define BOARD_CK_DIV 9 // 3-stage, 1-ws, 9=66MHz 6=100MHz
`define BOARD_CK_DIV 6 // 3-stage, 1-ws, 9=66MHz 6=100MHz
`else
`define BOARD_CK_DIV 9 // 2-stage, 1-ws, 9=66MHz 6=100MHz
`endif
Expand Down
12 changes: 6 additions & 6 deletions rtl/darkcache.v
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ module darkcache
assign CDATO = HIT ? CDATA[CINDEX] : XATAI;
assign DATAP = DATAOFF;

assign DDACK = HIT ? 1 : XDACK;

`else

wire [31:0] CDATO;
Expand Down Expand Up @@ -242,6 +244,8 @@ module darkcache

assign CDATO = HIT ? CDATAFF : XATAI;
assign DATAP = DATAOFF;

assign DDACK = HIT2 ? 1 : XDACK;

`endif

Expand All @@ -250,6 +254,8 @@ module darkcache
wire [31:0] CDATO = XATAI;
wire HIT = 0;

assign DDACK = XDACK;

`endif

// convert darkriscv bus to xbus
Expand Down Expand Up @@ -284,12 +290,6 @@ module darkcache
CDATO[15: 0] ):
CDATO;

`ifdef __LUTCACHE__
assign DDACK = HIT ? 1 : XDACK;
`else
assign DDACK = HIT2 ? 1 : XDACK;
`endif

assign DEBUG = { DAS, HIT, XDREQ, XDACK };

endmodule

0 comments on commit 6203f4b

Please sign in to comment.