mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-24 13:57:07 -04:00
Add system function through DPI to avoid missing support in Verilator.
This commit is contained in:
parent
a78e6cda8a
commit
29c19d9cb4
1 changed files with 5 additions and 1 deletions
|
@ -39,6 +39,7 @@ import "DPI-C" function string getenvval(input string env_name);
|
|||
`else
|
||||
import "DPI-C" function string getenv(input string env_name);
|
||||
`endif
|
||||
import "DPI-C" function int system(input string env_name);
|
||||
|
||||
module testbench;
|
||||
/* verilator lint_off WIDTHTRUNC */
|
||||
|
@ -326,6 +327,9 @@ module testbench;
|
|||
assign EcallFaultM = dut.core.priv.priv.EcallFaultM;
|
||||
else
|
||||
assign EcallFaultM = 0;
|
||||
|
||||
// this is an unused integer for the return value of `system`
|
||||
int unused_int;
|
||||
always @(posedge clk) begin
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Verify the test ran correctly by checking the memory against a known signature.
|
||||
|
@ -352,7 +356,7 @@ module testbench;
|
|||
bootmemfilename = {RISCV_DIR, "/linux-testvectors/bootmem.bin"};
|
||||
uartoutfilename = {"logs/", TEST, "_uart.out"};
|
||||
rmCmd = {"rm -f ", uartoutfilename};
|
||||
$system(rmCmd); // Delete existing UARToutfile
|
||||
unused_int = system(rmCmd); // Delete existing UARToutfile
|
||||
end
|
||||
else memfilename = {pathname, tests[test], ".elf.memfile"};
|
||||
if (riscofTest) begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue