Functions in Bash may use local variables to create a local scope. For example:
$ function f0 { local a; a=0; echo "f0(a)=$a"; }
$ a=x;
$ echo "a=$a"; f0; echo "a=$a"
a=x
f0(a)=0
foreach v [info vars] { if {![array exists $v]} { puts "$v = [set $v]"; } else { puts "$v is array"; } }This gist is to compare some of existing open-source RV cores. The list is by no means meant to be comprehensive. Also, do check the list at RISC-V Foundation site, which may be more up to date.
This gist discusses implementation of a Debug Module (DM) primarily per RISC-V Debug Specification v0.11. The core ideas, though, apply to Debug Specification v0.13. Information presented here come from various sources, but mostly from Debug Specs, riscv-isa-sim and from reverse engineering e200_opensource. Relevant source of information is also riscv-openocd.
RISC-V Foundation established a debug task group to propose and standardize mechanisms for external debugging of RISC-V (RV) cores. This effort resulted in drafting a RISC-V External Debug Supprt specification, early [v0.1
Most of the time, a verilated Verilog/SystemVerilog can be driven from a single threaded test. And if not, SystemC may come to rescue.
There can be situations, where a true multithreaded test is needed. An particular example is connecting a debugger to a Verilator model of a CPU. You will need one thread to interface GDB (maybe through other layers such as OpenOCD) and another thread generating a "normal" stimuli to the CPU model (reset, clock, etc.).
This work is licensed under a Creative Commons Attribution 4.0 International License.
[1] Why am I Getting UITE-461 Messages and Zero Source Latency?, Solvent article No. 020373, last modified 12/13/2016, https://solvnet.synopsys.com/retrieve/020373.html