Search
A wiki subspace to share information and links to for mutual share of the course related materials. All users logged into CourseWare are granted write access. The content and accuracy of the information posted, linked articles and videos are not guaranteed by the B4M35PAP course teaching team. If time permits, we will assist in ensuring that the information is correct, or we will add comments.
Official tests are available on GitHub - riscv-software-src/riscv-tests. These are self-tests, so they rely on some of the instructions of the processor. It is thus necessary to use other means to test at least the instructions these tests rely on. The tests will jump to code of macro RVTEST_FAIL when the test fails, and to code of macro RVTEST_PASS if it passed. See GitHub - riscv/riscv-test-env/p/riscv_test.h for inspiration. You might have to define pass and fail macros yourself to make testing if test passed/failed easier.
RVTEST_FAIL
RVTEST_PASS
SystemVerilog allows to access not only inputs and outputs of a module, but even its internal wires or wires of internal modules in tb. For example, it's possible to print out registers of a processor when the tb is finished without putting them as output of the processor top level. I have the processor top level design instance name set to uut, and inside of it there is module register_file instantiated as register_file_inst.
uut
register_file
register_file_inst
To print out all registers to stdout, I may use:
for (int i = 1; i < 32; i++) begin $display("R%0d:%0d", i, uut.register_file_inst.gprs[i]); end
Or to output it to a file:
$writememh("registers.mem", uut.register_file_inst.gprs);
Similarly to SystemVerilog, VHDL also allows access to nested signals, starting with VHDL-2008. This feature is called external names in VHDL. Let's take the same example as with SystemVerilog. VHDL needs to know the type of the signal in the external name, so this complicates things a little. It's usually easier to first make an alias that will refer to the signal with external name, although it is not strictly necessary. External names are specified inside of `« »`. It should be possible to refer to signals, constants and variables via external names. Inputs and outputs don't seem to be directly supported.
type gprs_array is array (1 to 32) of std_logic_vector(31 downto 0);
print_registers: process is -- The path to the signal here is relative, assuming this is in toplevel testbench entity. -- For absolute path, you would prepend a dot to signal path. -- The top level entity has to be specified, use name of the entity, -- ie. '.tb_top.uut.register_file_inst.gprs' if your entity is called tb_top. alias gprs is << signal uut.register_file_int.gprs : gprs_array >>; begin -- After another process changes print_registers_sig to true, registers are printed. -- This could be done at the end of the testcase. wait until print_registers_sig; for i in gprs'low to gprs'high loop report "R" & to_string(i) & ":" & to_hstring(gprs(i)); end loop; end process print_registers;
It's possible to make aliases in architecture header as well.
architecture a1 of an_entity alias my_signal is << .tb_top.uut.somewhere.in.the.design.there.is.a_signal : std_logic >>; begin my_signal <= force '1'; -- Note that force will make sure the value is forced over the old value driven by the design. -- It is possible to release the signal by assigning release. end architecture;
New ones
There has been more projects where initial design from our course has advanced into bigger project
I have discussed and even partially inspired some related projects at ČVUT FIT as well