@@ -9,6 +9,41 @@ To cite this model, please head to the end of this document.
99
1010## Getting started
1111
12+ ### Generate an RVFI trace
13+
14+ To generate an RVFI trace, follow the instructions in the CVA6 repository to run a simulation.
15+ The RVFI trace will be in ` verif/sim/out_<date>/<simulator>/<test-name>.log ` .
16+
17+
18+ ### Running the model
19+
20+ ``` bash
21+ python3 model.py verif/sim/out_< date> /< simulator> /< test-name> .log
22+ ```
23+
24+ The annotated trace is generated in an ` annotated.log ` file in the current directory.
25+
26+ It prints a lot of debug information so that you can see all the events (note: it slows down model execution).
27+ To disable these prints, modify the instantiation with ` Model(debug=False) ` in the ` main ` function.
28+
29+ At the end of the simulation, the model prints statistics with the ` print_stats ` call in the ` main ` function.
30+ These statistics can be performed on the timed part, which is filtered with the ` filter_timed_part ` function.
31+ Feel free to modify the ` filter_timed_part ` function to suit your needs.
32+
33+
34+ ### Exploring design space
35+
36+ In ` model.py ` , the ` main ` function runs the model with arguments which override default values.
37+ Generic parameters are available in ` Model.__init__ ` .
38+ You can add new parameters to explore here.
39+
40+ To perform exploration, run the model in a loop, like ` issue_commit_graph ` does.
41+ The ` display_scores ` function is meant to print a 3D plot if you have ` matplotlib ` .
42+ ` issue_commit_graph ` prints the scores so that you can store it and display the figure without re-running the model.
43+
44+
45+ ## Comparing the model and the RTL
46+
1247### Adapt RVFI trace generation
1348
1449The regular expression expects the cycle number to be in the RVFI trace.
@@ -24,28 +59,26 @@ To emit cycle number in RVFI trace, modify `corev_apu/tb/rvfi_tracer.sv` in CVA6
2459```
2560
2661
27- ### Generate an RVFI trace
28-
29- To generate an RVFI trace, follow the instructions in the CVA6 repository to run a simulation.
30- The RVFI trace will be in ` verif/sim/out_<date>/<simulator>/<test-name>.log ` .
31-
62+ ### Calculate instruction duration
3263
33- ### Running the model
64+ Run ` cycle_diff.py ` for each script.
3465
3566``` bash
36- python3 model.py verif/sim/out_< date> /< simulator> /< test-name> .log
67+ python3 perf-model/cycle_diff.py annotated.log
68+ mv traceout.log model.log
69+ python3 perf-model/cycle_diff.py verif/sim/out_< date> /< simulator> /< test-name> .log
3770```
3871
72+ Note: the ` cycles_diff.py ` script filters the "timed" part of the program.
73+ To do this, it tries to find ` csrr minstret ` instructions.
74+ Feel free to modify the script to suit your needs.
3975
40- ### Exploring design space
4176
42- In ` model.py ` , the ` main ` function runs the model with arguments which override default values.
43- Generic parameters are available in ` Model.__init__ ` .
44- You can add new parameters to explore here.
77+ ### List the differences
4578
46- To perform exploration, run the model in a loop, like ` issue_commit_graph ` does.
47- The ` display_scores ` function is meant to print a 3D plot if you have ` matplotlib ` .
48- ` issue_commit_graph ` prints the scores so that you can store it and display the figure without re-running the model.
79+ ``` bash
80+ diff -y traceout.log model.log | less
81+ ```
4982
5083
5184## Files
0 commit comments