Skip to content

Commit

Permalink
Merge pull request #2666 from Pinata-Consulting/mock-array-coverage-t…
Browse files Browse the repository at this point in the history
…oggle-report

mock-array: add --coverage-toggle report in simulation
  • Loading branch information
maliberty authored Jan 9, 2025
2 parents 4938f0a + 3673b2a commit e75e078
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flow/designs/asap7/mock-array/simulate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ verilator -Wall --cc \
-Wno-DECLFILENAME \
-Wno-UNUSEDSIGNAL \
-Wno-PINMISSING \
--coverage-toggle \
--coverage-underscore \
--Mdir $OBJ_DIR \
--top-module MockArray \
--trace \
Expand All @@ -30,8 +32,8 @@ verilator -Wall --cc \
$PLATFORM_DIR/verilog/stdcell/asap7sc7p5t_SIMPLE_RVT_TT_201020.v \
$PLATFORM_DIR/verilog/stdcell/dff.v \
$PLATFORM_DIR/verilog/stdcell/empty.v \
$FLOW_HOME/results/asap7/mock-array/base/6_final.v \
$FLOW_HOME/results/asap7/mock-array_Element/base/6_final.v \
$POST_DIR/MockArrayFinal.v \
$POST_DIR/MockArrayElement.v \
--exe \
$FLOW_HOME/designs/src/mock-array/simulate.cpp

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

# Run the simulation
$OBJ_DIR/VMockArray
verilator_coverage $RESULTS_DIR/coverage.dat --annotate $REPORTS_DIR/
3 changes: 3 additions & 0 deletions flow/designs/src/mock-array/simulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ int main(int argc, char** argv) {
vcd->flush();
vcd->close();

std::string coverage_file = std::string(getenv("RESULTS_DIR")) + "/coverage.dat";
Verilated::threadContextp()->coveragep()->write(coverage_file.c_str());

top->final();
delete top;
return 0;
Expand Down

0 comments on commit e75e078

Please sign in to comment.