Skip to content

Commit ac70ee3

Browse files
committed
Merge branch 'develop' into 'main'
Added racetrack memory possibility to the Riscv core See merge request racetrack-logic/risc-v-lim-architecture!10
2 parents f2e2f4c + a8be7f1 commit ac70ee3

32 files changed

+4067
-814
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ TAGS
2020
/Bender.local
2121
work/
2222
transcript
23+
.gitlab-ci.yml.*
24+
RI5CY-sameIF/tb/core/simv
25+
RI5CY-sameIF/tb/core/simv.daidir/
26+
RI5CY-sameIF/tb/core/ucli.key
27+
RI5CY-sameIF/tb/core/csrc/

.gitlab-ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
stages:
2+
- vsim_mem_std_mode0
3+
# - vcs_lim_mem
4+
5+
build_vsim_mem_std_mode0:
6+
stage: vsim_mem_std_mode0
7+
tags: [eda_tools]
8+
script:
9+
- git submodule update --remote RI5CY-sameIF/rtl/fpnew
10+
- cd RI5CY-sameIF/tb/core
11+
- 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
13+
14+
#build_vcs_lim_mem:
15+
# stage: vcs_lim_mem
16+
# tags: [eda_tools]
17+
# script:
18+
# - git submodule update --remote RI5CY-sameIF/rtl/fpnew
19+
# - cd RI5CY-sameIF/tb/core
20+
# - source /eda/scripts/init_synopsys_vcs
21+
# - make RISCV_LIB=/opt/riscv-rv32ima-ilp32 MEM_MODE=0 MEM_TYPE=RT_LIM_MEM vcs-run-bitwise-ext-asm

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ when it has been contributed to [OpenHW Group](https://www.openhwgroup.org/).
1818
## RISC-V with the same interface
1919
The RI5CY-sameIF repository contains the CV32E40P/RISC-V IP that supports Logic-in-memory operations, that mantains the same original interface in order to prioritise the flexibility of the core.
2020

21+
## RISC-V with the new interface
22+
The RI5CY-newIF repository contains the CV32E40P/RISC-V IP that supports Logic-in-memory operations, that has a new interface to maximise the efficiency of the memory operations.
23+
2124

2225
# Prerequisites
2326
Clone the current repository
@@ -39,7 +42,19 @@ Build the toolchain:
3942
Where N is the number of threads.
4043

4144
# Usage
42-
Enter the directory `RI5CY-sameIF/tb/core` and modify the makefile. In particular, change the variable `RISCV_LIB` with your `<tool_chain_install_path>` previously used in the configuration.
45+
Enter the directory `RI5CY-sameIF/tb/core` and modify the Makefile. In particular, change the variable `RISCV_LIB` with your `<tool_chain_install_path>` previously used in the configuration.
46+
47+
Modify variable `MEM_TYPE` inside the Makefile to build the desired memory type.
48+
Available memories:
49+
- Standard memory (STD_MEM)
50+
- Standard memory with LiM functionalities (LIM_MEM)
51+
- Racetrack memory with LiM functionalities (RT_LIM_MEM)
52+
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)
56+
57+
4358

4459
For executing a sample program run:
4560

@@ -49,3 +64,5 @@ For executing a sample program run:
4964

5065

5166

67+
68+

RI5CY-sameIF/rtl/include/riscv_defines.sv

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,19 @@ parameter REGC_ZERO = 2'b11;
7373
// LOGIC-IN-MEMORY custom
7474
parameter OPCODE_STORE_ACTIVE_LOGIC = 7'h3b;
7575
parameter OPCODE_LOAD_MASK = 7'h1b;
76-
77-
parameter FUNCT_NONE = 3'b000;
78-
parameter FUNCT_XOR = 3'b001;
79-
parameter FUNCT_AND = 3'b010;
80-
parameter FUNCT_OR = 3'b011;
81-
parameter FUNCT_MIN = 3'b101;
82-
parameter FUNCT_MAX = 3'b110;
83-
76+
parameter WAIT_LIM_CYCLES = 2;
77+
78+
79+
//Extended funct parameters for new store_active
80+
parameter FUNCT_NONE = 8'b00000000;
81+
parameter FUNCT_XOR = 8'b00000001;
82+
parameter FUNCT_AND = 8'b00000010;
83+
parameter FUNCT_OR = 8'b00000011;
84+
parameter FUNCT_NAND = 8'b00001010;
85+
parameter FUNCT_NOR = 8'b00001011;
86+
parameter FUNCT_XNOR = 8'b00001001;
87+
parameter FUNCT_MIN = 8'b00000101;
88+
parameter FUNCT_MAX = 8'b00000110;
8489
//////////////////////////////////////////////////////////////////////////////
8590
// _ _ _ _ ___ _ _ //
8691
// / \ | | | | | | / _ \ _ __ ___ _ __ __ _| |_(_) ___ _ __ ___ //

RI5CY-sameIF/rtl/riscv_decoder.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ module riscv_decoder
442442
alu_op_c_mux_sel_o = OP_C_LIM_FUNCT;
443443
// offset from immediate
444444
alu_operator_o = ALU_ADD;
445-
imm_b_mux_sel_o = IMMB_I;
445+
//take as immediate the one used in load_mask
446+
imm_b_mux_sel_o = IMMB_LOGMEM;
446447
alu_op_b_mux_sel_o = OP_B_IMM;
447448
// store size
448449
data_type_o = 2'b00; // SW

RI5CY-sameIF/rtl/riscv_id_stage.sv

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,7 @@ module riscv_id_stage
783783
end
784784

785785
// Logic-in-memory operator
786-
assign logic_in_memory_funct = {operand_c_fw_id[28:0], instr[14:12]};
787-
786+
assign logic_in_memory_funct = {operand_c_fw_id[23:0],instr[24:20], instr[14:12]};
788787

789788
///////////////////////////////////////////////////////////////////////////
790789
// ___ _ _ _ ___ ____ //

0 commit comments

Comments
 (0)