systemc: Remove references to internal constants from the tests.
authorGabe Black <gabeblack@google.com>
Thu, 14 Jun 2018 01:41:27 +0000 (18:41 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 15 Aug 2018 01:36:01 +0000 (01:36 +0000)
The tests were referring to constants defined in the Accellera systemc
implementation which identified various log message types. This change
replaces those (sometimes quite long) string constants with their
actual value. This doesn't make that interface any more fragile since
the constant value won't track between the Accellera version and this
one, but it does make its fragility more explicit by using the value
directly.

If in the future we decide to hide the magical nature of those
particular string constants, we could make them into our own constants
in the implementation. Regardless, the tests shouldn't refer to
internal details of the implementation.

Change-Id: I116a7407fcac49367649b250683117f3ccf4f9ed
Reviewed-on: https://gem5-review.googlesource.com/11181
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/tests/systemc/bugs/constructor_throw/constructor_throw.cpp
src/systemc/tests/systemc/communication/sc_buffer/test02/sc_buffer_edge_reset.cpp
src/systemc/tests/systemc/communication/sc_signal/check_writer/test16/test16.cpp
src/systemc/tests/systemc/kernel/phase_callbacks/test04/register_phase_callbacks.cpp
src/systemc/tests/systemc/kernel/process_control/reset/method_reset_throw/sc_method_reset_throw.cpp
src/systemc/tests/systemc/kernel/sc_time/test19/test19.cpp

index 560643bc144419f81ade8f6a5a0f282af60a73ec..5f5d9908115ed1e8268f3058e039b7b660f7a2fe 100644 (file)
@@ -72,7 +72,7 @@ SC_MODULE(X)
 {
     SC_CTOR(X)
     {
-        SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_,"");
+        SC_REPORT_ERROR("set time resolution failed","");
     }
 };
 
index 98fe8a5bbb595f37f90df393cd1acbf4706e196c..863e64ce704ef7683268dafb100788ee8cd96307 100644 (file)
@@ -73,8 +73,9 @@ SC_MODULE(print_edge)
 
 int sc_main(int, char*[])
 {
-  sc_report_handler::set_actions( SC_ID_DISABLE_WILL_ORPHAN_PROCESS_
-                                , SC_DO_NOTHING );
+  sc_report_handler::set_actions( "disable() or dont_initialize() "
+            "called on process with no static sensitivity, it will be "
+            "orphaned", SC_DO_NOTHING );
 
   sc_signal<int>  sig_int;
 
index a295b654074c1ee43b5cd5a834ad2ad3332d6d22..2d7b0739897b4b37e45d576c21172d54c04bcab4 100644 (file)
@@ -147,7 +147,7 @@ int sc_main( int, char*[] )
 
     // report multiple writer errors as warnings
     sc_core::sc_report_handler::set_actions(
-        sc_core::SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_
+        "sc_signal<T> cannot have more than one driver"
       , sc_core::SC_DEFAULT_WARNING_ACTIONS
     );
 
index 5ed6dd4f91e1d5e92b7cab59fda5e11bdfd1680d..a66c6a3f9d848374c99ca3d4dd8b6ff66409d84d 100644 (file)
@@ -212,7 +212,7 @@ private:
 int sc_main(int, char*[])
 {
   // don't run without callbacks enabled
-  sc_report_handler::set_actions( SC_ID_PHASE_CALLBACKS_UNSUPPORTED_
+  sc_report_handler::set_actions( "simulation phase callbacks not enabled"
                                 , SC_DEFAULT_ERROR_ACTIONS );
 
   phase_tracer pt;
index c6596f0c7b7c928093cf7246a948aa4131f21d69..ab7718a1e88428991b059c72592c560076fcfd18 100644 (file)
@@ -93,7 +93,9 @@ protected:
 
 int sc_main (int, char*[])
 {
-  sc_report_handler::set_actions( SC_ID_DISABLE_WILL_ORPHAN_PROCESS_, SC_DO_NOTHING );
+  sc_report_handler::set_actions( "disable() or dont_initialize() "
+          "called on process with no static sensitivity, it will be orphaned",
+          SC_DO_NOTHING );
   sctop top1("Top1");
   sc_start(10, SC_NS);
   return 0;
index c7a7f357ce5fe55c1db6e6b02b20df014e2968a6..4e62c1091bec774483c814193f96f196e1030c51 100644 (file)
@@ -59,8 +59,8 @@ void check_time( const sc_time& t, sc_time_unit tu, const std::string & str )
 
 int sc_main( int, char*[] )
 {
-    sc_report_handler::set_actions( SC_ID_SET_TIME_RESOLUTION_, SC_DO_NOTHING );
-    sc_report_handler::set_actions( SC_ID_TIME_CONVERSION_FAILED_, SC_DISPLAY );
+    sc_report_handler::set_actions( "set time resolution failed", SC_DO_NOTHING );
+    sc_report_handler::set_actions( "sc_time conversion failed", SC_DISPLAY );
 
     unsigned resolutions[] = { 100, 10, 1 };
     sc_time_unit resunit   = SC_FS;