fvp_mps2.jinja2: Improve code coverage support
Add more termination condition for coverage runs
The "fvp_mps2.UART0.shutdown_on_eot" option doesn't seem to work for the
FVP version used by TF-M tests. Instead, emulated it using the
"fvp_mps2.UART0.shutdown_tag=\x04" option. As a fallback, also add
"--cpulimit 130" option, so if EOT output is still missing for some
testsuites, FVP terminates by timeout.
To capture actual trace data to the LAVA logs, follow standard "monitors"
LAVA test clauses with "interactive" cases.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I6a04b37aa7b0ca207fea0291a7b52e940e6169c6
diff --git a/lava_helper/jinja2_templates/fvp_mps2.jinja2 b/lava_helper/jinja2_templates/fvp_mps2.jinja2
index c294c31..9c78d74 100644
--- a/lava_helper/jinja2_templates/fvp_mps2.jinja2
+++ b/lava_helper/jinja2_templates/fvp_mps2.jinja2
@@ -62,6 +62,8 @@
- "--parameter fvp_mps2.mps2_visualisation.disable-visualisation=1"
{%- if enable_code_coverage %}
- "--plugin {CC}"
+ - "--parameter fvp_mps2.UART0.shutdown_tag=\x04"
+ - "--cpulimit 130"
{%- endif %}
prompts:
@@ -82,4 +84,21 @@
'{{monitor.fixup.skip}}': skip
{%- endif %}
{%- endfor %}
+
+{%- if enable_code_coverage %}
+- test:
+ namespace: target
+ interactive:
+ - name: fvp_stopped
+ prompts: ['/OSCI/SystemC: Simulation stopped by user.']
+ script:
+ - name: fvp_stopped_1
+ command:
+ - name: fvp_trace_end
+ prompts: ['Trace path: FVP_MPS2_AEMv8M.cpu1']
+ script:
+ - name: fvp_trace_end_1
+ command:
+{%- endif %}
+
{% endblock %}