Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/12254

Change subject: systemc: Make the test config retrieve sc_main results.
......................................................................

systemc: Make the test config retrieve sc_main results.

Accellera's implementation prints any sc_report which is thrown and
escapes sc_main, so we need to do the same to make some tests pass.
Arguably gem5 should fail if sc_main reports an error, but verify.py
would interpret that as the test failing too, and some tests
purposefully generate errors.

This change also stops using the logging module. It wasn't really
providing any benefit, and added extra decoration to log messages
which confused verify.py.

Change-Id: I6850d0ada5e477b67527d99d421478586cda93b3
---
M src/systemc/tests/config.py
1 file changed, 12 insertions(+), 3 deletions(-)



diff --git a/src/systemc/tests/config.py b/src/systemc/tests/config.py
index 7e2dd55..4b143d1 100755
--- a/src/systemc/tests/config.py
+++ b/src/systemc/tests/config.py
@@ -27,9 +27,8 @@

 from __future__ import print_function

-import logging
-
 import m5
+import re

 from m5.objects import SystemC_Kernel, Root

@@ -43,4 +42,14 @@
 m5.instantiate(None)

 cause = m5.simulate(m5.MaxTick).getCause()
-logging.info('Exiting @ tick %i because %s', m5.curTick(), cause)
+
+result = kernel.sc_main_result()
+if result.code != 0:
+    # Arguably this should make gem5 fail, but some tests purposefully
+    # generate errors, and as long as their output matches that's still
+    # considered correct. A "real" systemc config should expect sc_main
+    # (if present) not to fail.
+    scrubbed = re.sub(r'In file: .*$',
+            'In file: <removed by verify.pl>',
+            result.message)
+    print('\n' + scrubbed)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12254
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I6850d0ada5e477b67527d99d421478586cda93b3
Gerrit-Change-Number: 12254
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to