Skip to content

Commit 84cac5a

Browse files
committed
Merge branch 'develop' into 'main'
Meeting memory mode selection See merge request racetrack-logic/risc-v-lim-architecture!14
2 parents 0db3f17 + 4bafe0b commit 84cac5a

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build_vsim_mem_std_mode0:
99
- git submodule update --remote RI5CY-sameIF/rtl/fpnew
1010
- cd RI5CY-sameIF/tb/core
1111
- source /eda/scripts/init_questa_core_prime
12-
- make RISCV_LIB=/opt/riscv-rv32ima-ilp32 MEM_MODE=0 MEM_TYPE=STD_MEM custom-vsim-run
12+
- make RISCV_LIB=/opt/riscv-rv32ima-ilp32 MEM_MODE=MODE_0 MEM_TYPE=STD_MEM custom-vsim-run
1313

1414
#build_vcs_lim_mem:
1515
# stage: vcs_lim_mem

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ Enter the directory `RI5CY-sameIF/tb/core` and modify the Makefile. In particula
4646

4747
Modify variable `MEM_TYPE` inside the Makefile to build the desired memory type.
4848
Available memories:
49-
- Standard memory (STD_MEM)
50-
- Standard memory with LiM functionalities (LIM_MEM)
51-
- Racetrack memory with LiM functionalities (RT_LIM_MEM)
49+
- Standard memory (MEM_TYPE = STD_MEM)
50+
- Standard memory with LiM functionalities (MEM_TYPE = LIM_MEM)
51+
- Racetrack memory with LiM functionalities (MEM_TYPE = RT_LIM_MEM)
5252

53-
Racetrack memory supports two different modes, set the correct parameter `MEM_MODE` in file `RI5CY-sameIF/tb/core/tb_tob.sv` to choose the wanted configuration:
54-
- Memory mode (MEM_MODE = 0)
55-
- LiM mode (MEM_MODE = 1)
53+
Racetrack memory supports two different modes, modify variable `MEM_MODE` inside the Makefile to choose the wanted configuration:
54+
- Memory mode (MEM_MODE = MODE_0)
55+
- LiM mode (MEM_MODE = MODE_1)
5656

5757

5858

RI5CY-sameIF/tb/core/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ MEM_TYPE = RT_LIM_MEM
117117
#LIM_MEM = compile standard memory with LiM functionalities
118118
#RT_LIM_MEM = compile Racetrack memory with/without LiM functionalities
119119

120+
# Racetrack memory operational mode
121+
122+
MEM_MODE = MODE_0
123+
124+
# MODE_0 = Work as a standard memory
125+
# MODE_1 = work as a LiM architecture
126+
120127

121128

122129
# ===================================================================
@@ -138,7 +145,7 @@ vlib: .lib-rtl
138145

139146
# rebuild if we change some sourcefile
140147
.build-rtl: .lib-rtl $(RTLSRC_PKG) $(RTLSRC) $(RTLSRC_TB_PKG) $(RTLSRC_TB) $(RTLSRC_TB_RT)
141-
$(VLOG) +define+$(MEM_TYPE) -work $(VWORK) +incdir+$(RTLSRC_INCDIR) $(VLOG_FLAGS) \
148+
$(VLOG) +define+$(MEM_TYPE) +define+$(MEM_MODE) -work $(VWORK) +incdir+$(RTLSRC_INCDIR) $(VLOG_FLAGS) \
142149
$(RTLSRC_PKG) $(RTLSRC) $(RTLSRC_TB_PKG) $(RTLSRC_TB) $(RTLSRC_TB_RT)
143150
touch .build-rtl
144151

@@ -176,7 +183,7 @@ vcsify: $(RTLSRC_PKG) $(RTLSRC) $(RTLSRC_TB_PKG) $(RTLSRC_TB) $(RTLSRC_TB_RT)
176183
-timescale=1ns/1ns -j20\
177184
-CC "-I$(VCS_HOME)/include -O3 -march=native" $(VCS_FLAGS) \
178185
$(RTLSRC_PKG) $(RTLSRC) $(RTLSRC_TB_PKG) $(RTLSRC_TB) $(RTLSRC_TB_RT)\
179-
+incdir+$(RTLSRC_INCDIR) +define+$(MEM_TYPE)
186+
+incdir+$(RTLSRC_INCDIR) +define+$(MEM_TYPE) +define+$(MEM_MODE)
180187

181188
#STANDARD PROGRAMS (MEM_TYPE=STD_MEM)
182189

RI5CY-sameIF/tb/core/tb_top.sv

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@
1717
module tb_top
1818
#(parameter INSTR_RDATA_WIDTH = 32,
1919
parameter RAM_ADDR_WIDTH = 22,
20-
parameter MEM_MODE = 1, //working mode for RT memory 1=LiM, 0=std
2120
parameter BOOT_ADDR = 'h180,
2221
parameter PULP_CLUSTER = 0,
2322
parameter FPU = 0,
2423
parameter PULP_ZFINX = 0,
2524
parameter DM_HALTADDRESS = 32'h1A110800);
2625

26+
//Set MEM_MODE parameter for Racetrack
27+
`ifdef MODE_1
28+
29+
localparam MEM_MODE = 1;
30+
31+
`elsif MODE_0
32+
33+
localparam MEM_MODE = 0;
34+
35+
`endif
36+
2737
// comment to record execution trace
2838
//`define TRACE_EXECUTION
2939

@@ -136,7 +146,8 @@ module tb_top
136146
$time, firmware);
137147
$readmemh(firmware, riscv_wrapper_i.ram_i.dp_ram_i.mem);
138148

139-
149+
150+
140151
///////////////////////////
141152
// Racetrack memory initialization
142153
///////////////////////////

0 commit comments

Comments
 (0)