forked from Github_Repos/cvw
Merge branch 'main' of https://github.com/davidharrishmc/riscv-wally into main
This commit is contained in:
commit
8a43d6099b
32
pipelined/src/cache/sram1p1rw.sv
vendored
32
pipelined/src/cache/sram1p1rw.sv
vendored
@ -45,12 +45,9 @@ module sram1p1rw #(parameter DEPTH=128, WIDTH=256) (
|
||||
logic [$clog2(DEPTH)-1:0] AdrD;
|
||||
logic WriteEnableD;
|
||||
|
||||
localparam WM8 = WIDTH%8;
|
||||
|
||||
|
||||
always_ff @(posedge clk) AdrD <= Adr;
|
||||
|
||||
integer index;
|
||||
genvar index;
|
||||
/* -----\/----- EXCLUDED -----\/-----
|
||||
for(index = 0; index < WIDTH/8; index++) begin
|
||||
always_ff @(posedge clk) begin
|
||||
@ -61,22 +58,17 @@ module sram1p1rw #(parameter DEPTH=128, WIDTH=256) (
|
||||
end
|
||||
-----/\----- EXCLUDED -----/\----- */
|
||||
|
||||
always_ff @(posedge clk) begin
|
||||
if (WriteEnable) begin
|
||||
for(index = 0; index < WIDTH/8; index++) begin
|
||||
if(ByteMask[index]) begin
|
||||
StoredData[Adr][index*8 +: 8] <= #1 CacheWriteData[index*8 +: 8];
|
||||
end
|
||||
end
|
||||
/* if (WM8 > 0) begin // handle msbs that aren't a multiple of 8
|
||||
if (ByteMask[WIDTH/8]) begin
|
||||
StoredData[Adr][WIDTH-1:WIDTH-WM8] <= #1
|
||||
CacheWriteData[WIDTH-1:WIDTH-WM8];
|
||||
end
|
||||
end */
|
||||
end
|
||||
end
|
||||
if (WIDTH%8 != 0) // handle msbs if not a multiple of 8
|
||||
always_ff @(posedge clk)
|
||||
if (WriteEnable & ByteMask[WIDTH/8])
|
||||
StoredData[Adr][WIDTH-1:WIDTH-WIDTH%8] <= #1
|
||||
CacheWriteData[WIDTH-1:WIDTH-WIDTH%8];
|
||||
|
||||
for(index = 0; index < WIDTH/8; index++)
|
||||
always_ff @(posedge clk)
|
||||
if(WriteEnable & ByteMask[index])
|
||||
StoredData[Adr][index*8 +: 8] <= #1 CacheWriteData[index*8 +: 8];
|
||||
/*
|
||||
// if not a multiple of 8, MSByte is not 8 bits long.
|
||||
if(WIDTH%8 != 0) begin
|
||||
always_ff @(posedge clk) begin
|
||||
@ -85,7 +77,7 @@ module sram1p1rw #(parameter DEPTH=128, WIDTH=256) (
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
*/
|
||||
assign ReadData = StoredData[AdrD];
|
||||
endmodule
|
||||
|
||||
|
3
setup.sh
3
setup.sh
@ -26,8 +26,9 @@ export PATH=$WALLY/bin:$PATH
|
||||
# Verilator
|
||||
export PATH=/usr/local/bin/verilator:$PATH # Change this for your path to Verilator
|
||||
# ModelSim/Questa (vsim)
|
||||
export PATH=/cad/mentor/questa_sim-2021.2_1/questasim/bin:$PATH # Change this for your path to Modelsim, or delete
|
||||
# Note: 2022.1 complains on cache/sram1p1r1w about StoredData cannot be driven by multiple always_ff blocks. Ues 2021.2 for now
|
||||
export PATH=/cad/mentor/questa_sim-2022.1_1/questasim/bin:$PATH # Change this for your path to Modelsim
|
||||
export PATH=/cad/mentor/questa_sim-2021.2_1/questasim/bin:$PATH # Change this for your path to Modelsim, or delete
|
||||
export MGLS_LICENSE_FILE=1717@solidworks.eng.hmc.edu # Change this to your Siemens license server
|
||||
export PATH=/cad/synopsys/SYN/bin:$PATH # Change this for your path to Design Compiler
|
||||
export SNPSLMD_LICENSE_FILE=27020@134.173.38.214
|
||||
|
Loading…
Reference in New Issue
Block a user