Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verilator-compatible testbench, phase 2/2 #1094

Merged
merged 154 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
56d4833
made a local cache `vfiles` of all the verilog files needed for simul…
steveri Oct 8, 2024
eb9ad82
Sample script for building verilator sim
steveri Oct 8, 2024
ce0880e
fixes for missing libcgra function, fscanf problems (unary &)
steveri Oct 9, 2024
90787b9
top.sv: added support for dumping wave info
steveri Oct 11, 2024
3d2b28a
verilator.sh: added flags for wave tracing and debugging
steveri Oct 11, 2024
3cee08c
rewrote CGRA.cpp entirely, to match verilator tracing example
steveri Oct 11, 2024
10f7f31
got vcd waves, hooray
steveri Oct 14, 2024
fa5e76a
minor tweaks
steveri Oct 15, 2024
cf48b5c
code cleanup
steveri Oct 15, 2024
660f166
added debug printf's
steveri Oct 15, 2024
761ac72
added debug printf's, FIXED "%08x" SCANF FORMAT BUG
steveri Oct 15, 2024
39051ab
added support for command-line verilator time limit
steveri Oct 16, 2024
18d5daa
code cleanup
steveri Oct 16, 2024
6f80c7e
code cleanup
steveri Oct 16, 2024
f897748
code cleanup
steveri Oct 16, 2024
45195f6
restore original testbench from master
steveri Nov 2, 2024
c848393
remove axil_ifc clocking structure; passes but timing is different
steveri Nov 2, 2024
a07a091
added delays to match "clocking" version
steveri Nov 3, 2024
4ab2938
remarkably, seems to work perfectly w/o proc_ifc clocking structure..…
steveri Nov 3, 2024
1c099fd
verilator tweaks
steveri Nov 3, 2024
fb4cc89
verilator scanf problems
steveri Nov 3, 2024
78637f1
added a timescale-check
steveri Nov 3, 2024
caddc6a
retrieved stub from verilator branch
steveri Nov 3, 2024
487cfaa
finished porting time_check to garnet_test
steveri Nov 3, 2024
13ef684
ported latest verilator.sh from verilator branch
steveri Nov 3, 2024
7a34afd
tweaks and hacks to make verilator work with same code as vcs
steveri Nov 5, 2024
a95cd88
slight code cleanup
steveri Nov 5, 2024
1cad12d
re-merging vcs and verilator -- garnet_test
steveri Nov 5, 2024
d7a7b2f
imported classless files from verilator branch
steveri Nov 5, 2024
2c0ec6e
verilator misinterpreted my innocent comment :(
steveri Nov 5, 2024
66f0f4c
enable classlessness
steveri Nov 6, 2024
54b98f9
eliminate multiport drivers oh no
steveri Nov 6, 2024
da48b97
gradually introducing Environment.sv to see what breaks
steveri Nov 6, 2024
0563918
env.run() is now classless. and we're off!
steveri Nov 6, 2024
c08359c
clean up AxilDriver write() routine and bring it inline w original ax…
steveri Nov 6, 2024
910319d
declassified env.set_interrupt()
steveri Nov 6, 2024
9e4d22f
driver file for local vcs
steveri Nov 6, 2024
939d158
Env_write_bs() appears to be working
steveri Nov 6, 2024
f815f86
cleanup
steveri Nov 6, 2024
b883ca8
vcs and verilator both work again, hooray!
steveri Nov 6, 2024
54368f1
cleanup
steveri Nov 6, 2024
ccb506c
made it through Env_glb_configure()
steveri Nov 6, 2024
24910cb
made it through Env_cgra_configure()
steveri Nov 6, 2024
19e08b2
made it through Env_write_data(); also, a little code cleanup
steveri Nov 6, 2024
42e867f
Uncommented remainder of Environment.sv; deleted a redundant assign t…
steveri Nov 7, 2024
eb46c1c
kernel_test() successfully unclassed; fixed a couple bugs also
steveri Nov 7, 2024
c7ee20f
read_data() successfully unclassed; fixed a couple bugs also; is this…
steveri Nov 7, 2024
da8ee84
code cleanup
steveri Nov 7, 2024
561f51c
Eliminate class refs from Environment.sv
steveri Nov 8, 2024
07845b9
Eliminate class refs from garnet_test.sv
steveri Nov 8, 2024
c23ea08
fixed a typo in a comment
steveri Nov 8, 2024
5987630
eliminate class files from testbench list
steveri Nov 8, 2024
9b2cad8
Fixed faulty reset mechanism; needs defined nonzero posedge AND negedge
steveri Nov 8, 2024
195b2dc
comment tweak
steveri Nov 8, 2024
931ace6
Added debug annotations
steveri Nov 11, 2024
bda2079
info, comments
steveri Nov 11, 2024
9b42f27
fixed broken (for verilator) wait_interrupt mechanism
steveri Nov 11, 2024
ad5128a
Fixed incorrect scanf of bitstream data from external foo.bs file
steveri Nov 11, 2024
e883e0d
turned off verilator tracing for faster execution
steveri Nov 11, 2024
e3b274e
fixed off-by-one problem vs. vcs; sharpened some comments etc.
steveri Nov 11, 2024
1c8a24a
improved verilator wrapper: --trace option, run from parent dir
steveri Nov 11, 2024
4bb9420
code cleanup
steveri Nov 13, 2024
fcd12bd
code cleanup, better log output maybe
steveri Nov 13, 2024
8261374
code cleanup
steveri Nov 13, 2024
55f67cb
Fixed a timing bug related to capturing output from CGRA
steveri Nov 13, 2024
a539a02
Removed accidental "verilator" keyword from a comment
steveri Nov 13, 2024
508076d
code cleanup
steveri Nov 13, 2024
594a69d
code cleanup
steveri Nov 13, 2024
797883c
code cleanup
steveri Nov 13, 2024
9355720
code cleanup
steveri Nov 13, 2024
12afcbe
Oops forgot to restore MAX_WAIT, so e.g. tensor3_ttm failed
steveri Nov 13, 2024
23ab3bf
turn off the last of the debugging
steveri Nov 14, 2024
e3af6f3
merge with latest master
steveri Nov 14, 2024
b37fc28
Stupid directive error
steveri Nov 14, 2024
c451f73
code cleanup on aisle Environment.sv
steveri Nov 15, 2024
bcae4e5
better/sparser log output maybe
steveri Nov 15, 2024
b6d2a0d
added a couple tracing options that maybe do nothing
steveri Nov 15, 2024
9ae6718
remove unnecessary debug sttmts
steveri Nov 15, 2024
52cb3c7
moved clear_interrupt closer to wait_interrupt w no apparent damage...
steveri Nov 15, 2024
5d0347b
merged wait_interrupt and clear_interrupt loops
steveri Nov 15, 2024
13251a5
only trace if trace has been requested
steveri Nov 16, 2024
3dd2512
code cleanup
steveri Nov 16, 2024
fbee061
MAJOR RETHINKING of how we do wait_interrupt and clear_interrupt
steveri Nov 16, 2024
447e5f4
tiny little refactor
steveri Nov 16, 2024
961204b
final cleanup
steveri Nov 16, 2024
c292ea7
annotated per-kernel loop with BEGIN, END annotations
steveri Nov 16, 2024
d2cb21b
code cleanup
steveri Nov 17, 2024
4a5b5b8
Better logging info maybe
steveri Nov 17, 2024
7d9b446
Add exclusion zone (protection zone) to prevent everything everywhere…
steveri Nov 17, 2024
2d47696
added how-to-debug comments
steveri Nov 18, 2024
cbccf07
slightly better logging info
steveri Nov 18, 2024
b2f3e93
nondestructive code cleanup
steveri Nov 18, 2024
387dbbf
interrupt timeout needs per-interrupt timers NOT GLOBAL TIMERS
steveri Nov 18, 2024
7145da1
calculate per-interrupt tile_masks in preparation for next phase
steveri Nov 18, 2024
7718e55
fixed a couple bugs
steveri Nov 18, 2024
5a4bc49
build a separate clear_interrupt task in preparation for next phase
steveri Nov 18, 2024
731e2d3
implement new wait/clear protocol for first of three waits
steveri Nov 18, 2024
982b202
IMPLEMENT NEW INTERRUPT WAIT/CLEAR PROTOCOL
steveri Nov 18, 2024
f199e0e
no more need for semaphores
steveri Nov 18, 2024
55422a7
rejiggered the development/debug path
steveri Nov 18, 2024
b52d863
eliminate original classes, no longer needed
steveri Nov 19, 2024
4ee05f5
cleanup
steveri Nov 19, 2024
4358d37
cleanup plus registration marks for PR
steveri Nov 19, 2024
cec2e8b
changed testbench to use only global "addr" and "data" signals
steveri Nov 19, 2024
6c9b6f5
privatize timekeeper signals
steveri Nov 19, 2024
eb8bf0c
cleanup, registration marks
steveri Nov 19, 2024
4b62e1e
pr prep
steveri Nov 19, 2024
3141d47
pr prep
steveri Nov 19, 2024
01afd5a
pr prep
steveri Nov 19, 2024
0c84c92
pr prep
steveri Nov 19, 2024
b102477
pr prep
steveri Nov 19, 2024
a8f82e6
pr prep
steveri Nov 20, 2024
c457778
pr prep
steveri Nov 20, 2024
7c8066c
pr prep
steveri Nov 20, 2024
d07550d
pr prep
steveri Nov 20, 2024
efe7c9a
pr prep
steveri Nov 20, 2024
31df89f
cleanup
steveri Nov 21, 2024
ece13db
Merge branch 'master' into vcs
steveri Nov 21, 2024
58ff71a
pr prep / cleanup
steveri Nov 21, 2024
4092329
pr prep / cleanup
steveri Nov 21, 2024
22ff40f
pr prep/cleanup AxilDriver DONE
steveri Nov 21, 2024
63541a9
temporary hack for verilator CI testing
steveri Nov 21, 2024
382e305
pr prep / cleanup ProcDriver IN PROGRESS
steveri Nov 21, 2024
fba4d0f
pr prep / cleanup ProcDriver IN PROGRESS
steveri Nov 21, 2024
6caabfd
fixing a typo
steveri Nov 21, 2024
6e095b0
pr prep / cleanup ProcDriver DONE
steveri Nov 21, 2024
b7805d5
pr prep / cleanup CGRA.cpp DONE
steveri Nov 21, 2024
083553f
Stop killing aha-flow regressions omg!
steveri Nov 22, 2024
f50847a
inconsequential tweak
steveri Nov 22, 2024
5d53bab
README update
steveri Nov 22, 2024
0c1f6a8
added pointwise collateral
steveri Nov 22, 2024
a7742f1
better cleanup, hoping not to kill aha flow regressions
steveri Nov 22, 2024
81e7911
innocuous updates to dev scripts
steveri Nov 22, 2024
2806450
get hep with latest changes in other branch
steveri Nov 23, 2024
550e420
pr prep - README
steveri Nov 24, 2024
77e5b83
pr prep - verilator and vcs dev wrappers
steveri Nov 24, 2024
79b7331
better verilator-test hack
steveri Nov 25, 2024
dc1c958
last minute tweak
steveri Nov 25, 2024
ccffcc9
Merge branch 'master' into vcs
steveri Nov 25, 2024
d131dc1
better file-compare maybe
steveri Nov 25, 2024
01e4914
slight comment tweak
steveri Nov 27, 2024
4a4bf1d
cleanup
steveri Dec 3, 2024
761042b
update wrt master
steveri Dec 3, 2024
246f129
code deduplication
steveri Dec 3, 2024
840902c
typo
steveri Dec 3, 2024
7cc1197
merge w latest master
steveri Dec 5, 2024
fd9a955
snapshot
steveri Dec 5, 2024
76b4600
update README a bit
steveri Dec 5, 2024
f8799ae
remove non-genesis top.sv from repo
steveri Dec 5, 2024
551273c
support for NUM_CGRA_COLS_INCLUDING_IO
steveri Dec 5, 2024
62a4814
slight tweak
steveri Dec 5, 2024
0158126
Restore README caveat
steveri Dec 5, 2024
47085c9
had to force remaining dev files!
steveri Dec 6, 2024
385da0c
slight mod to vcs-test driver
steveri Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .buildkite/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ steps:
- docker run -id --name $CONTAINER --rm -v /cad:/cad $IMAGE bash
- docker exec $CONTAINER /bin/bash -c "rm -rf /aha/garnet"
- docker cp . $CONTAINER:/aha/garnet

# For quick test of verilator-compatible code, remove "echo if TEST" below
- docker exec $CONTAINER /bin/bash -c "
source /aha/bin/activate;
source /cad/modules/tcl/init/sh;
module load base incisive xcelium/19.03.003 vcs/Q-2020.03-SP2;
echo if TEST cp garnet/tests/test_app/dev/verilator-test.regress.py aha/util/regress.py;
echo aha regress pr;
pwd; aha regress pr;
"

Expand Down
32 changes: 30 additions & 2 deletions tests/test_app/dev/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ dev/README
------------------------------------------------------------------------
VCS FULL GARNET RUN SEQUENCE (e.g. pointwise should finish within 8000ns)
# Output to logs vcs.log<i>, simv.log<i>
APP=+APP0=vfiles/pointwise
# <generate top.sv, see below>
head tb/top.sv
APP=+APP0=pointwise; test -f pointwise/bin/design_meta.json || echo FAIL
ivcs=$i; (vcs.sh |& tee vcs.log$ivcs; echo -n run | simv -lca -l simv.log$ivcs +vcs+initmem+0 +vcs+initreg+0 -sv_lib libcgra -exitstatus -ucli $APP) |& less
# simv.log* should end with "PASS PASS PASS"
# Check output file hw_output.txt vs. gold copy
Expand All @@ -50,17 +52,20 @@ gtkwave simv3.vcd

------------------------------------------------------------------------
VERILATOR FULL GARNET RUN SEQUENCE (e.g. pointwise should finish within 8000ns)
# <generate top.sv, see below>
iver=$i; rmo; verilator.sh |& tee ver.log$iver
make -C obj_dir/ -f Vtop.mk >& make-vtop.log$iver &
tail -f make-vtop.log$iver | awk '{printf("%3d %s %s\n", NR, $1, $NF)}' # Counts to 245 ish?
APP=+APP0=pointwise; test -f pointwise/bin/design_meta.json || echo FAIL
alias vtop='(echo Vtop 8000 "$APP"; obj_dir/Vtop 8000 "$APP")'
vtop |& tee vtop.log$iver | less
# vtop.log* should end with "PASS PASS PASS"

# TRACE
# <generate top.sv, see below>
iver=$i; rmo; verilator.sh --trace |& tee ver.log$iver
make -C obj_dir/ -f Vtop.mk >& make-vtop.log$iver &
tail -f make-vtop.log$iver | awk '{printf("%3d %s %s\n", NR, $1, $NF)}' # Counts to >> 245 ish?
tail -f make-vtop.log$iver | awk '{printf("%3d %s %s\n", NR, $1, $NF)}' # Counts to 1000 ish?
alias vtop='(echo Vtop 8000 +trace "$APP"; obj_dir/Vtop 8000 +trace "$APP")'
vtop |& tee vtop.log$iver | less
gtkwave obj_dir/logs/vlt_dump.vcd
Expand All @@ -69,3 +74,26 @@ gtkwave obj_dir/logs/vlt_dump.vcd
VERILATOR STUB RUN SEQUENCE
# same as non-stub above except do this first:
cp vfiles/garnet_stub.v vfiles/garnet.v

------------------------------------------------------------------------
GENERATE TOP.SV
# Find or install Genesis2.pl
source /home/steveri/bin/setup_genesis.sh

# Clean up previous build
cd $GARNET/tests/test_app
ls -l genesis_clean.cmd
cat genesis_clean.cmd
genesis_clean.cmd

# Generate top.sv from top.svp
ls -l tb/top.*
parms='-parameter top.using_matrix_unit=0 top.oc_0=0 top.mu_datawidth=0'
Genesis2.pl -parse -generate -top top -input $gtb/top.svp $parms
ls -l genesis_verif/top.sv
ls -l tb/top.*
mv genesis_verif/top.sv tb/top.sv
ls -ld genesis*
cat genesis_clean.cmd
source genesis_clean.cmd
ls -ld genesis*
90 changes: 90 additions & 0 deletions tests/test_app/dev/pointwise/bin/design_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"IOs": {
"inputs": [
{
"bitwidth": 16,
"datafile": "hw_input_stencil.raw",
"name": "hw_input_stencil",
"shape": [
64,
64
],
"io_tiles": [
{
"name": "io16in_hw_input_stencil_op_hcompute_hw_input_global_wrapper_stencil_read_0",
"addr": {
"cycle_starting_addr": [
0
],
"cycle_stride": [
1
],
"dimensionality": 1,
"extent": [
4096
],
"read_data_starting_addr": [
0
],
"read_data_stride": [
1
]
},
"mode": "STATIC",
"x_pos": 0,
"y_pos": 0
}
]
}
],
"outputs": [
{
"bitwidth": 16,
"datafile": "hw_output.raw",
"name": "hw_output_stencil",
"shape": [
64,
64
],
"io_tiles": [
{
"name": "io16_hw_output_stencil_op_hcompute_hw_output_stencil_write_0",
"addr": {
"cycle_starting_addr": [
4
],
"cycle_stride": [
1
],
"dimensionality": 1,
"extent": [
4096
],
"write_data_starting_addr": [
0
],
"write_data_stride": [
1
]
},
"mode": "VALID",
"x_pos": 1,
"y_pos": 0,
"valid_name": "hw_output_stencil"
}
]
}
]
},
"testing": {
"interleaved_input": [
"input.pgm"
],
"interleaved_output": [
"gold.pgm"
],
"bitstream": "pointwise.bs",
"coreir": "design_top.json",
"placement": "design.place"
}
}
67 changes: 67 additions & 0 deletions tests/test_app/dev/pointwise/bin/pointwise.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
000A0708 02800000
000A0707 01000000
000A0706 01000000
000A0705 01000000
000A0704 01000000
000A0703 01000000
010A0702 01000200
000C0602 00800002
010C0601 01000200
010C0501 00040400
010C0401 00040400
010A0301 00040400
010C0201 00040400
000C0101 00800000
010D0101 09002000
000D0101 01000000
010D0201 08000080
010D0202 00001040
000D0202 00000040
010B0303 08000080
010B0304 01000200
010D0404 08000080
010D0505 08000080
000D0505 00000040
010D0506 01001240
010D0507 00041040
000D0507 00800000
00030608 0000000B
000D0608 01800000
010D0607 01000200
010D0406 00040400
000B0306 00800000
000B0305 01000002
010D0204 00040400
000D0104 00800000
000D0103 01000000
000D0102 01000000
020D0001 00008000
010C0101 00040000
010D0102 01000000
010D0103 01000000
010D0104 00040000
020D0202 00008000
020D0203 00008000
020B0304 00008000
010B0305 01000000
010B0306 00040000
020D0405 00008000
020D0506 00008000
020D0507 00008000
020D0508 00008000
010C0602 00040000
010D0608 08000000
010A0703 01000000
010A0704 01000000
010A0705 01000000
010A0706 01000000
010A0707 01000000
28000708 000103E0
27000708 7C000000
26000708 00001000
25000708 40001000
24000708 10000000
2E000708 00000300
02000608 40004000
01000608 00000835
00000608 7FD00099
3 changes: 2 additions & 1 deletion tests/test_app/dev/vcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ WAVEFORM_ARGS="-debug_access+all -kdb +vpi +memcbk +vcsd"
WAVEFORM_ARGS="-debug_access+all +vpi +memcbk +vcsd"


/bin/rm -rf deleteme/{simv,csrc,simv.daidir}
test -d deleteme && /bin/rm -rf deleteme/{simv,csrc,simv.daidir}
mv simv csrc/ simv.daidir/ deleteme

# // $WAVEFORM_ARGS
Expand All @@ -70,6 +70,7 @@ test -e vfiles/garnet.v || (cd vfiles; gunzip -c garnet.v.gz > garnet.v)
test -d tb || ln -s ../tb
test -e libcgra.so || ln -s vfiles/libcgra.so

set -x
/bin/bash \
vcs -sverilog -timescale=1ps/1ps -full64 -ldflags "-Wl,--no-as-needed" \
-CFLAGS "-m64" -top top +vcs+lic+wait +vcs+initreg+random +overlap \
Expand Down
1 change: 1 addition & 0 deletions tests/test_app/dev/vfiles/global_buffer_param.svh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package global_buffer_param;
localparam int NUM_PRR = 4;
localparam int NUM_CGRA_COLS = 8;
localparam int NUM_CGRA_COLS_INCLUDING_IO = 8;
localparam int NUM_GLB_TILES = 4;
localparam int NUM_COLS_PER_GROUP = 4;
localparam int BANKS_PER_TILE = 2;
Expand Down
96 changes: 96 additions & 0 deletions tests/test_app/tb/CGRA.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// DESCRIPTION: Verilator: Verilog example module
// See /usr/local/share/verilator/examples/make_tracing_c/sim_main.cpp
//======================================================================

// For std::unique_ptr
#include <memory>

// Include common routines
#include <verilated.h>

// Include model header, generated from Verilating "top.v"
#include "Vtop.h"

// Legacy function required only so linking works on Cygwin and MSVC++
double sc_time_stamp() { return 0; }

int main(int argc, char** argv) {

// '5000' means 5ns. Why? Maybe b/c timescale = 1ps/1ps
int ns = 1000;

// Sets MAX_NS if ANY cmd-line arg is found to be an integer (I'm so clever haha)
// E.g. "vtop 300" will run for 300ns and then end abruptly
int MAX_NS = 300*ns;
for (int i=1; i<argc; i++) {
int maybe_integer = atoi(argv[i]);
if (maybe_integer > 0) MAX_NS = maybe_integer;
}
// Create logs/ directory in case we have traces to put under it
Verilated::mkdir("logs");

// Construct a VerilatedContext to hold simulation time, etc.
// Multiple modules (made later below with Vtop) may share the same
// context to share time, or modules may have different contexts if
// they should be independent from each other.

// Using unique_ptr is similar to
// "VerilatedContext* contextp = new VerilatedContext" then deleting at end.
const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
// Do not instead make Vtop as a file-scope static variable, as the
// "C++ static initialization order fiasco" may cause a crash

// Set debug level, 0 is off, 9 is highest presently used
// May be overridden by commandArgs argument parsing
contextp->debug(0);

// Randomization reset policy
// May be overridden by commandArgs argument parsing
contextp->randReset(0); // 0: init to zero; 1: init to 1; 2: init to random

// Verilator must compute traced signals
contextp->traceEverOn(true);

// Pass arguments so Verilated code can see them, e.g. $value$plusargs
// This needs to be called before you create any model
contextp->commandArgs(argc, argv);

// Construct the Verilated model, from Vtop.h generated from Verilating "top.v".
// Using unique_ptr is similar to "Vtop* top = new Vtop" then deleting at end.
// "TOP" will be the hierarchical name of the module.
const std::unique_ptr<Vtop> top{new Vtop{contextp.get(), "TOP"}};
/*
// Set Vtop's input signals
top->reset_l = !0;
top->clk = 0;
top->in_small = 1;
top->in_quad = 0x1234;
top->in_wide[0] = 0x11111111;
top->in_wide[1] = 0x22222222;
top->in_wide[2] = 0x3;
*/

// Simulate until $finish <
int i=-1;
while (!contextp->gotFinish()) {
i++; if (i > MAX_NS*ns) break; // (Note "i" starts at -1)
top->eval();
contextp->timeInc(1); // 1ps maybe
}

// Final model cleanup
top->final();

// Coverage analysis (calling write only after the test is known to pass)
#if VM_COVERAGE
Verilated::mkdir("logs");
contextp->coveragep()->write("logs/coverage.dat");
#endif

// Final simulation summary
contextp->statsPrintSummary();

// Return good completion status
// Don't use exit() or destructor won't get called
return 0;
}
Loading
Loading