From 9d5484923941eb393381b5769a4f1f66ff5df5ca Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 28 Mar 2021 16:32:13 -0700 Subject: Use a separate memory module. Hopefully this will infer a memory the way we want in Quartus. --- hdl/mem.sv | 30 +++++++++++++++++++++ hdl/top.sv | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 110 insertions(+), 9 deletions(-) create mode 100644 hdl/mem.sv (limited to 'hdl') diff --git a/hdl/mem.sv b/hdl/mem.sv new file mode 100644 index 0000000..906870d --- /dev/null +++ b/hdl/mem.sv @@ -0,0 +1,30 @@ +module mem + ( input bit clk + + , output bit ready + , input bit valid + , input bit write + , input bit [ADDR_BITS-1:0] address + , input bit [DATA_BITS-1:0] write_data + , output bit [DATA_BITS-1:0] read_data // Valid exactly the cycle after address is consumed. + ); + +parameter ADDR_BITS; +parameter DATA_BITS; +parameter INIT_FILE; + +bit [DATA_BITS-1:0] storage [0:(1<