Skip to content

Commit 3673b2a

Browse files
committed
mock-array: add --coverage-toggle report in simulation
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 227d694 commit 3673b2a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

flow/designs/asap7/mock-array/simulate.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ verilator -Wall --cc \
2222
-Wno-DECLFILENAME \
2323
-Wno-UNUSEDSIGNAL \
2424
-Wno-PINMISSING \
25+
--coverage-toggle \
26+
--coverage-underscore \
2527
--Mdir $OBJ_DIR \
2628
--top-module MockArray \
2729
--trace \
@@ -30,8 +32,8 @@ verilator -Wall --cc \
3032
$PLATFORM_DIR/verilog/stdcell/asap7sc7p5t_SIMPLE_RVT_TT_201020.v \
3133
$PLATFORM_DIR/verilog/stdcell/dff.v \
3234
$PLATFORM_DIR/verilog/stdcell/empty.v \
33-
$FLOW_HOME/results/asap7/mock-array/base/6_final.v \
34-
$FLOW_HOME/results/asap7/mock-array_Element/base/6_final.v \
35+
$POST_DIR/MockArrayFinal.v \
36+
$POST_DIR/MockArrayElement.v \
3537
--exe \
3638
$FLOW_HOME/designs/src/mock-array/simulate.cpp
3739

@@ -40,3 +42,4 @@ make -j16 -C $OBJ_DIR -f VMockArray.mk
4042

4143
# Run the simulation
4244
$OBJ_DIR/VMockArray
45+
verilator_coverage $RESULTS_DIR/coverage.dat --annotate $REPORTS_DIR/

flow/designs/src/mock-array/simulate.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ int main(int argc, char** argv) {
8989
vcd->flush();
9090
vcd->close();
9191

92+
std::string coverage_file = std::string(getenv("RESULTS_DIR")) + "/coverage.dat";
93+
Verilated::threadContextp()->coveragep()->write(coverage_file.c_str());
94+
9295
top->final();
9396
delete top;
9497
return 0;

0 commit comments

Comments
 (0)