-
Create a file named
instructions.txt
in the same directory as theassembler.py
script. -
Write the instructions you want to include in the instruction memory in the file, with each instruction on a separate line.
- Instructions must be written in RISC-V assembly. Refer to
assembler.py
for supported formats.
- Instructions must be written in RISC-V assembly. Refer to
-
Open your terminal and execute the following command:
python3 assembler.py
-
A file named
instruction.mif
should be generated in the same directory as the script.
-
Create a new project in ModelSim.
-
Add all the files from the design folder to the project.
-
Include the testbench file
tb_top.sv
in the project. -
In the project directory, ensure that you have the following files:
- compile_verilog
- runtb_top
- instruction.mif
- data.mif
Adjust the file paths in the scripts accordingly.
-
In the ModelSim terminal, execute the following command:
do runtb_top
-
The compilation and simulation process will commence, and the results will be displayed in the terminal.