summaryrefslogtreecommitdiff
path: root/src/systemc/tests/systemc/kernel/sc_time
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/tests/systemc/kernel/sc_time')
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log115
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw115
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw64115
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test01/test01.cpp315
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test02/golden/test02.log4
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test02/test02.cpp48
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test03/golden/test03.log4
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test03/test03.cpp48
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test04/golden/test04.log5
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test04/test04.cpp77
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test05/golden/test05.log5
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test05/test05.cpp76
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test06/golden/test06.log5
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test06/test06.cpp85
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test07/golden/test07.log4
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test07/test07.cpp49
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test08/golden/test08.log4
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test08/test08.cpp50
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test09/golden/test09.log4
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test09/test09.cpp48
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test10/golden/test10.log13
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test10/test10.cpp50
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test11/golden/test11.log16
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test11/test11.cpp50
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test12/golden/test12.log14
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test12/test12.cpp48
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test13/golden/test13.log14
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test13/test13.cpp48
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test14/golden/test14.log15
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test14/test14.cpp77
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test15/golden/test15.log14
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test15/test15.cpp49
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test16/golden/test16.log14
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test16/test16.cpp48
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test17/golden/test17.log14
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test17/test17.cpp49
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test18/golden/test18.log8
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test18/test18.cpp88
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test19/golden/test19.log83
-rw-r--r--src/systemc/tests/systemc/kernel/sc_time/test19/test19.cpp93
40 files changed, 1981 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log b/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log
new file mode 100644
index 000000000..05f57cbfb
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log
@@ -0,0 +1,115 @@
+SystemC Simulation
+test_print
+0 s
+1230 ps
+12300 ns
+1230 us
+12300 ms
+1230 s
+12300000 s
+test_constructors
+0 s
+0 s
+1235 ps
+1234 ps
+0 s
+18446744073709550382 ps
+18446744073709550383 ps
+1 ns
+2 ns
+3 ns
+4 ns
+5 ns
+6 ns
+7 ns
+8 ns
+9 ns
+10 ns
+11 ns
+0 s
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated constructor: sc_time(double,bool)
+1234 ps
+1235 ps
+18446744073709550383 ps
+18446744073709550382 ps
+1 ps
+2 ps
+0 s
+18446744073709551615 ps
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated constructor: sc_time(uint64,bool)
+0 s
+25 ns
+25 ps
+25 ps
+test_assignment
+0 s
+1235 ps
+18446744073709550074 ps
+test_conversion
+0
+0
+0 s
+0
+1234500
+1.2345e+06
+1234500 ps
+1.2345e-06
+18446744073709550074
+1.84467e+19
+18446744073709550074 ps
+1.84467e+07
+test_relational
+1
+0
+0
+1
+0
+1
+0
+1
+0
+0
+1
+1
+0
+1
+1
+1
+0
+0
+test_arithmetic
+0 s
+1235 ps
+18446744073709550074 ps
+1235 ps
+2469 ps
+18446744073709551309 ps
+18446744073709548532 ps
+0 s
+18446744073709550381 ps
+1542 ps
+1 ps
+2777 ps
+0 s
+0 s
+1525 ps
+2468 ps
+0 s
+617 ps
+1.00081
+1235 ps
+1 ps
+1 ps
+1 ps
+test_SC_ZERO_TIME
+0 s
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw b/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw
new file mode 100644
index 000000000..c61cc7857
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw
@@ -0,0 +1,115 @@
+SystemC Simulation
+test_print
+0 s
+1230 ps
+12300 ns
+1230 us
+12300 ms
+1230 s
+12300000 s
+test_constructors
+0 s
+0 s
+1235 ps
+1234 ps
+0 s
+18446744073709550382 ps
+18446744073709550383 ps
+1 ns
+2 ns
+3 ns
+4 ns
+5 ns
+6 ns
+7 ns
+8 ns
+9 ns
+10 ns
+11 ns
+0 s
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated constructor: sc_time(double,bool)
+1234 ps
+1235 ps
+18446744073709550383 ps
+18446744073709550382 ps
+1 ps
+2 ps
+0 s
+18446744073709551615 ps
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated constructor: sc_time(uint64,bool)
+0 s
+25 ns
+25 ps
+25 ps
+test_assignment
+0 s
+1235 ps
+18446744073709550074 ps
+test_conversion
+0
+0
+0 s
+0
+1234500
+1.2345e+006
+1234500 ps
+1.2345e-006
+18446744073709550074
+1.84467e+019
+18446744073709550074 ps
+1.84467e+007
+test_relational
+1
+0
+0
+1
+0
+1
+0
+1
+0
+0
+1
+1
+0
+1
+1
+1
+0
+0
+test_arithmetic
+0 s
+1235 ps
+18446744073709550074 ps
+1235 ps
+2469 ps
+18446744073709551309 ps
+18446744073709548532 ps
+0 s
+18446744073709550381 ps
+1542 ps
+1 ps
+2777 ps
+0 s
+0 s
+1525 ps
+2468 ps
+0 s
+617 ps
+1.00081
+1235 ps
+1 ps
+1 ps
+1 ps
+test_SC_ZERO_TIME
+0 s
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw64 b/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw64
new file mode 100644
index 000000000..c61cc7857
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test01/golden/test01.log.mingw64
@@ -0,0 +1,115 @@
+SystemC Simulation
+test_print
+0 s
+1230 ps
+12300 ns
+1230 us
+12300 ms
+1230 s
+12300000 s
+test_constructors
+0 s
+0 s
+1235 ps
+1234 ps
+0 s
+18446744073709550382 ps
+18446744073709550383 ps
+1 ns
+2 ns
+3 ns
+4 ns
+5 ns
+6 ns
+7 ns
+8 ns
+9 ns
+10 ns
+11 ns
+0 s
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated constructor: sc_time(double,bool)
+1234 ps
+1235 ps
+18446744073709550383 ps
+18446744073709550382 ps
+1 ps
+2 ps
+0 s
+18446744073709551615 ps
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated constructor: sc_time(uint64,bool)
+0 s
+25 ns
+25 ps
+25 ps
+test_assignment
+0 s
+1235 ps
+18446744073709550074 ps
+test_conversion
+0
+0
+0 s
+0
+1234500
+1.2345e+006
+1234500 ps
+1.2345e-006
+18446744073709550074
+1.84467e+019
+18446744073709550074 ps
+1.84467e+007
+test_relational
+1
+0
+0
+1
+0
+1
+0
+1
+0
+0
+1
+1
+0
+1
+1
+1
+0
+0
+test_arithmetic
+0 s
+1235 ps
+18446744073709550074 ps
+1235 ps
+2469 ps
+18446744073709551309 ps
+18446744073709548532 ps
+0 s
+18446744073709550381 ps
+1542 ps
+1 ps
+2777 ps
+0 s
+0 s
+1525 ps
+2468 ps
+0 s
+617 ps
+1.00081
+1235 ps
+1 ps
+1 ps
+1 ps
+test_SC_ZERO_TIME
+0 s
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test01/test01.cpp b/src/systemc/tests/systemc/kernel/sc_time/test01/test01.cpp
new file mode 100644
index 000000000..31d8e8e8f
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test01/test01.cpp
@@ -0,0 +1,315 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test01.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of sc_time's methods
+
+#include "systemc.h"
+
+void
+test_print()
+{
+ cout << "test_print" << endl;
+
+ sc_time t1;
+ cout << t1 << endl;
+
+ uint64 v = 1230;
+ sc_time t2 = sc_time::from_value( v );
+ cout << t2 << endl;
+
+ v *= 10000;
+ sc_time t3 = sc_time::from_value( v );
+ cout << t3 << endl;
+
+ v *= 100;
+ sc_time t4 = sc_time::from_value( v );
+ cout << t4 << endl;
+
+ v *= 10000;
+ sc_time t5 = sc_time::from_value( v );
+ cout << t5 << endl;
+
+ v *= 100;
+ sc_time t6 = sc_time::from_value( v );
+ cout << t6 << endl;
+
+ v *= 10000;
+ sc_time t7 = sc_time::from_value( v );
+ cout << t7 << endl;
+}
+
+void
+test_constructors()
+{
+ cout << "test_constructors" << endl;
+
+ sc_time t1;
+ cout << t1 << endl;
+
+ sc_time t2a( 0, SC_SEC );
+ cout << t2a << endl;
+
+ sc_time t2b( 1.2345, SC_NS );
+ cout << t2b << endl;
+ sc_time t2c( 1.2341, SC_NS );
+ cout << t2c << endl;
+
+ sc_time t2d( 1, SC_FS );
+ cout << t2d << endl;
+
+ sc_time t2e( -1.2345, SC_NS );
+ cout << t2e << endl;
+ sc_time t2f( -1.2341, SC_NS );
+ cout << t2f << endl;
+
+ char v1 = 1;
+ signed char v2 = 2;
+ unsigned char v3 = 3;
+ short v4 = 4;
+ unsigned short v5 = 5;
+ int v6 = 6;
+ unsigned int v7 = 7;
+ long v8 = 8;
+ unsigned long v9 = 9;
+ float v10 = 10;
+ double v11 = 11;
+
+ sc_time t2g( v1, SC_NS );
+ cout << t2g << endl;
+ sc_time t2h( v2, SC_NS );
+ cout << t2h << endl;
+ sc_time t2i( v3, SC_NS );
+ cout << t2i << endl;
+ sc_time t2j( v4, SC_NS );
+ cout << t2j << endl;
+ sc_time t2k( v5, SC_NS );
+ cout << t2k << endl;
+ sc_time t2l( v6, SC_NS );
+ cout << t2l << endl;
+ sc_time t2m( v7, SC_NS );
+ cout << t2m << endl;
+ sc_time t2n( v8, SC_NS );
+ cout << t2n << endl;
+ sc_time t2o( v9, SC_NS );
+ cout << t2o << endl;
+ sc_time t2p( v10, SC_NS );
+ cout << t2p << endl;
+ sc_time t2q( v11, SC_NS );
+ cout << t2q << endl;
+
+ sc_time t3a( 0, SC_SEC );
+ cout << t3a << endl;
+
+ sc_time t3b( 1.2341, true );
+ cout << t3b << endl;
+ sc_time t3c( 1.2345, true );
+ cout << t3c << endl;
+ sc_time t3d( -1.2341, true );
+ cout << t3d << endl;
+ sc_time t3e( -1.2345, true );
+ cout << t3e << endl;
+
+ sc_time t3f( 1.2345, false );
+ cout << t3f << endl;
+ sc_time t3g( 1.5432, false );
+ cout << t3g << endl;
+ sc_time t3h( -1.2345, false );
+ cout << t3h << endl;
+ sc_time t3i( -1.5432, false );
+ cout << t3i << endl;
+
+#if !defined( _MSC_VER )
+ sc_time t4a( 0ull, true );
+ cout << t4a << endl;
+ sc_time t4b( 25ull, true );
+ cout << t4b << endl;
+ sc_time t4c( 25ull, false );
+ cout << t4c << endl;
+#else
+ sc_time t4a( 0ui64, true );
+ cout << t4a << endl;
+ sc_time t4b( 25ui64, true );
+ cout << t4b << endl;
+ sc_time t4c( 25ui64, false );
+ cout << t4c << endl;
+#endif
+
+ sc_time t5( t4c );
+ cout << t5 << endl;
+}
+
+void
+test_assignment()
+{
+ cout << "test_assignment" << endl;
+
+ sc_time t1;
+
+ sc_time t2;
+ t1 = t2;
+ cout << t1 << endl;
+
+ sc_time t3( 1.2345, SC_NS );
+ t1 = t3;
+ cout << t1 << endl;
+
+ sc_time t4( -1.5432, SC_NS );
+ t1 = t4;
+ cout << t1 << endl;
+}
+
+void
+test_conversion()
+{
+ cout << "test_conversion" << endl;
+
+ sc_time t1;
+ cout << t1.value() << endl;
+ cout << t1.to_double() << endl;
+ cout << t1 << endl;
+ cout << t1.to_seconds() << endl;
+
+ sc_time t2( 1.2345, SC_US );
+ cout << t2.value() << endl;
+ cout << t2.to_double() << endl;
+ cout << t2 << endl;
+ cout << t2.to_seconds() << endl;
+
+ sc_time t3( -1.5432, SC_NS );
+ cout << t3.value() << endl;
+ cout << t3.to_double() << endl;
+ cout << t3 << endl;
+ cout << t3.to_seconds() << endl;
+}
+
+void
+test_relational()
+{
+ cout << "test_relational" << endl;
+
+ sc_time t1;
+ sc_time t2( 1, SC_FS );
+ sc_time t3( 1.2345, SC_NS );
+ sc_time t4( 1.2341, SC_NS );
+ sc_time t5( -1.5432, SC_NS );
+
+ cout << ( t1 == t2 ) << endl;
+ cout << ( t1 != t2 ) << endl;
+ cout << ( t1 < t2 ) << endl;
+ cout << ( t1 <= t2 ) << endl;
+ cout << ( t1 > t2 ) << endl;
+ cout << ( t1 >= t2 ) << endl;
+
+ cout << ( t3 == t4 ) << endl;
+ cout << ( t3 != t4 ) << endl;
+ cout << ( t3 < t4 ) << endl;
+ cout << ( t3 <= t4 ) << endl;
+ cout << ( t3 > t4 ) << endl;
+ cout << ( t3 >= t4 ) << endl;
+
+ cout << ( t1 == t5 ) << endl;
+ cout << ( t1 != t5 ) << endl;
+ cout << ( t1 < t5 ) << endl;
+ cout << ( t1 <= t5 ) << endl;
+ cout << ( t1 > t5 ) << endl;
+ cout << ( t1 >= t5 ) << endl;
+}
+
+void
+test_arithmetic()
+{
+ cout << "test_arithmetic" << endl;
+
+ sc_time t1;
+ sc_time t2( 1, SC_FS );
+ sc_time t3( 1.2345, SC_NS );
+ sc_time t4( 1.2341, SC_NS );
+ sc_time t5( -1.5432, SC_NS );
+
+ cout << ( t1 + t2 ) << endl;
+ cout << ( t1 + t3 ) << endl;
+ cout << ( t1 + t5 ) << endl;
+ cout << ( t3 + t2 ) << endl;
+ cout << ( t3 + t4 ) << endl;
+ cout << ( t3 + t5 ) << endl;
+ cout << ( t5 + t5 ) << endl;
+
+ cout << ( t1 - t2 ) << endl;
+ cout << ( t1 - t3 ) << endl;
+ cout << ( t1 - t5 ) << endl;
+ cout << ( t3 - t4 ) << endl;
+ cout << ( t3 - t5 ) << endl;
+ cout << ( t5 - t5 ) << endl;
+
+ cout << ( t1 * 1.2345 ) << endl;
+ cout << ( 1.2345 * t3 ) << endl;
+ cout << ( t4 * 2 ) << endl;
+
+ cout << ( t1 / 1.2345 ) << endl;
+ cout << ( t4 / 2 ) << endl;
+ cout << ( t3 / t4 ) << endl;
+
+ cout << ( t2 += t3 ) << endl;
+ cout << ( t2 -= t4 ) << endl;
+ cout << ( t2 *= 1.2345 ) << endl;
+ cout << ( t2 /= 2 ) << endl;
+}
+
+void
+test_SC_ZERO_TIME()
+{
+ cout << "test_SC_ZERO_TIME" << endl;
+
+ cout << SC_ZERO_TIME << endl;
+}
+
+int
+sc_main( int, char*[] )
+{
+#if defined(_MSC_VER) && _MSC_VER < 1900
+ _set_output_format(_TWO_DIGIT_EXPONENT);
+#endif
+ test_print();
+ test_constructors();
+ test_assignment();
+ test_conversion();
+ test_relational();
+ test_arithmetic();
+ test_SC_ZERO_TIME();
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test02/golden/test02.log b/src/systemc/tests/systemc/kernel/sc_time/test02/golden/test02.log
new file mode 100644
index 000000000..8bfeddd7c
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test02/golden/test02.log
@@ -0,0 +1,4 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: value not positive
+In file: <removed by verify.pl>
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test02/test02.cpp b/src/systemc/tests/systemc/kernel/sc_time/test02/test02.cpp
new file mode 100644
index 000000000..d078bae2f
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test02/test02.cpp
@@ -0,0 +1,48 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test02.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_time_resolution( -1, SC_NS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test03/golden/test03.log b/src/systemc/tests/systemc/kernel/sc_time/test03/golden/test03.log
new file mode 100644
index 000000000..146dd4c2e
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test03/golden/test03.log
@@ -0,0 +1,4 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: value not a power of ten
+In file: <removed by verify.pl>
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test03/test03.cpp b/src/systemc/tests/systemc/kernel/sc_time/test03/test03.cpp
new file mode 100644
index 000000000..925fa543a
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test03/test03.cpp
@@ -0,0 +1,48 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test03.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_time_resolution( 15, SC_NS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test04/golden/test04.log b/src/systemc/tests/systemc/kernel/sc_time/test04/golden/test04.log
new file mode 100644
index 000000000..2338c8de5
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test04/golden/test04.log
@@ -0,0 +1,5 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: simulation running
+In file: <removed by verify.pl>
+In process: src.main_action @ 0 s
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test04/test04.cpp b/src/systemc/tests/systemc/kernel/sc_time/test04/test04.cpp
new file mode 100644
index 000000000..fd71d60d5
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test04/test04.cpp
@@ -0,0 +1,77 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test04.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+SC_MODULE( source )
+{
+ sc_in_clk clk;
+ sc_out<int> out;
+
+ void main_action()
+ {
+ sc_set_time_resolution( 10, SC_PS );
+ int a = 0;
+ while( true ) {
+ wait();
+ out = ++ a;
+ }
+ }
+
+ SC_CTOR( source )
+ {
+ SC_THREAD( main_action );
+ sensitive << clk.pos();
+ }
+};
+
+int
+sc_main( int, char*[] )
+{
+ sc_clock clk( "clk" );
+ sc_signal<int> sig( "sig" );
+
+ source src( "src" );
+ src.clk( clk );
+ src.out( sig );
+
+ sc_start();
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test05/golden/test05.log b/src/systemc/tests/systemc/kernel/sc_time/test05/golden/test05.log
new file mode 100644
index 000000000..2338c8de5
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test05/golden/test05.log
@@ -0,0 +1,5 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: simulation running
+In file: <removed by verify.pl>
+In process: src.main_action @ 0 s
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test05/test05.cpp b/src/systemc/tests/systemc/kernel/sc_time/test05/test05.cpp
new file mode 100644
index 000000000..c517afcc6
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test05/test05.cpp
@@ -0,0 +1,76 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test05.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+SC_MODULE( source )
+{
+ sc_in_clk clk;
+ sc_out<int> out;
+
+ void main_action()
+ {
+ sc_set_time_resolution( 10, SC_PS );
+ int a = 0;
+ while( true ) {
+ wait();
+ out = ++ a;
+ }
+ }
+
+ SC_CTOR( source )
+ {
+ SC_CTHREAD( main_action, clk.pos() );
+ }
+};
+
+int
+sc_main( int, char*[] )
+{
+ sc_clock clk( "clk" );
+ sc_signal<int> sig( "sig" );
+
+ source src( "src" );
+ src.clk( clk );
+ src.out( sig );
+
+ sc_start();
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test06/golden/test06.log b/src/systemc/tests/systemc/kernel/sc_time/test06/golden/test06.log
new file mode 100644
index 000000000..2338c8de5
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test06/golden/test06.log
@@ -0,0 +1,5 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: simulation running
+In file: <removed by verify.pl>
+In process: src.main_action @ 0 s
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test06/test06.cpp b/src/systemc/tests/systemc/kernel/sc_time/test06/test06.cpp
new file mode 100644
index 000000000..b2db9d513
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test06/test06.cpp
@@ -0,0 +1,85 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test06.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+SC_MODULE( source )
+{
+ sc_in_clk clk;
+ sc_out<int> out;
+
+ int a;
+
+ void main_action()
+ {
+ if( m_first_time ) {
+ sc_set_time_resolution( 10, SC_PS );
+ a = 0;
+ m_first_time = false;
+ } else {
+ out = ++ a;
+ }
+ }
+
+ SC_CTOR( source )
+ : m_first_time( true )
+ {
+ SC_METHOD( main_action );
+ sensitive << clk.pos();
+ }
+
+private:
+
+ bool m_first_time;
+};
+
+int
+sc_main( int, char*[] )
+{
+ sc_clock clk( "clk" );
+ sc_signal<int> sig( "sig" );
+
+ source src( "src" );
+ src.clk( clk );
+ src.out( sig );
+
+ sc_start();
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test07/golden/test07.log b/src/systemc/tests/systemc/kernel/sc_time/test07/golden/test07.log
new file mode 100644
index 000000000..cc032fff1
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test07/golden/test07.log
@@ -0,0 +1,4 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: already specified
+In file: <removed by verify.pl>
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test07/test07.cpp b/src/systemc/tests/systemc/kernel/sc_time/test07/test07.cpp
new file mode 100644
index 000000000..ea9f8efb3
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test07/test07.cpp
@@ -0,0 +1,49 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test07.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_time_resolution( 1, SC_NS );
+ sc_set_time_resolution( 10, SC_FS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test08/golden/test08.log b/src/systemc/tests/systemc/kernel/sc_time/test08/golden/test08.log
new file mode 100644
index 000000000..0465b8580
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test08/golden/test08.log
@@ -0,0 +1,4 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: sc_time object(s) constructed
+In file: <removed by verify.pl>
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test08/test08.cpp b/src/systemc/tests/systemc/kernel/sc_time/test08/test08.cpp
new file mode 100644
index 000000000..982acd6cb
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test08/test08.cpp
@@ -0,0 +1,50 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test08.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_time t1( 1.2345, SC_NS );
+ sc_set_time_resolution( 10, SC_FS );
+ cout << t1;
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test09/golden/test09.log b/src/systemc/tests/systemc/kernel/sc_time/test09/golden/test09.log
new file mode 100644
index 000000000..baf367a10
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test09/golden/test09.log
@@ -0,0 +1,4 @@
+SystemC Simulation
+
+Error: (E514) set time resolution failed: value smaller than 1 fs
+In file: <removed by verify.pl>
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test09/test09.cpp b/src/systemc/tests/systemc/kernel/sc_time/test09/test09.cpp
new file mode 100644
index 000000000..108f71cd2
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test09/test09.cpp
@@ -0,0 +1,48 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test09.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_time_resolution
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_time_resolution( 0.1, SC_FS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test10/golden/test10.log b/src/systemc/tests/systemc/kernel/sc_time/test10/golden/test10.log
new file mode 100644
index 000000000..22116047d
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test10/golden/test10.log
@@ -0,0 +1,13 @@
+SystemC Simulation
+1 fs
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_get_default_time_unit
+1 ns
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test10/test10.cpp b/src/systemc/tests/systemc/kernel/sc_time/test10/test10.cpp
new file mode 100644
index 000000000..55f7ed908
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test10/test10.cpp
@@ -0,0 +1,50 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test10.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of functions sc_set_time_resolution and sc_get_time_resolution
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_time_resolution( 1, SC_FS );
+ cout << sc_get_time_resolution() << endl;
+ cout << sc_get_default_time_unit() << endl;
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test11/golden/test11.log b/src/systemc/tests/systemc/kernel/sc_time/test11/golden/test11.log
new file mode 100644
index 000000000..2286a20df
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test11/golden/test11.log
@@ -0,0 +1,16 @@
+SystemC Simulation
+
+Warning: (W516) default time unit changed to time resolution
+In file: <removed by verify.pl>
+10 ns
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_get_default_time_unit
+10 ns
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test11/test11.cpp b/src/systemc/tests/systemc/kernel/sc_time/test11/test11.cpp
new file mode 100644
index 000000000..1828c6928
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test11/test11.cpp
@@ -0,0 +1,50 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test11.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of functions sc_set_time_resolution and sc_get_time_resolution
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_time_resolution( 10, SC_NS );
+ cout << sc_get_time_resolution() << endl;
+ cout << sc_get_default_time_unit() << endl;
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test12/golden/test12.log b/src/systemc/tests/systemc/kernel/sc_time/test12/golden/test12.log
new file mode 100644
index 000000000..427796f5c
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test12/golden/test12.log
@@ -0,0 +1,14 @@
+SystemC Simulation
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_set_default_time_unit
+
+Error: (E515) set default time unit failed: value not positive
+In file: <removed by verify.pl>
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test12/test12.cpp b/src/systemc/tests/systemc/kernel/sc_time/test12/test12.cpp
new file mode 100644
index 000000000..cd9b0296a
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test12/test12.cpp
@@ -0,0 +1,48 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test12.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_default_time_unit
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_default_time_unit( -1, SC_NS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test13/golden/test13.log b/src/systemc/tests/systemc/kernel/sc_time/test13/golden/test13.log
new file mode 100644
index 000000000..891bf5731
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test13/golden/test13.log
@@ -0,0 +1,14 @@
+SystemC Simulation
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_set_default_time_unit
+
+Error: (E515) set default time unit failed: value not a power of ten
+In file: <removed by verify.pl>
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test13/test13.cpp b/src/systemc/tests/systemc/kernel/sc_time/test13/test13.cpp
new file mode 100644
index 000000000..6dacb61b3
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test13/test13.cpp
@@ -0,0 +1,48 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test13.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_default_time_unit
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_default_time_unit( 15, SC_NS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test14/golden/test14.log b/src/systemc/tests/systemc/kernel/sc_time/test14/golden/test14.log
new file mode 100644
index 000000000..91366709d
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test14/golden/test14.log
@@ -0,0 +1,15 @@
+SystemC Simulation
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_set_default_time_unit
+
+Error: (E515) set default time unit failed: simulation running
+In file: <removed by verify.pl>
+In process: src.main_action @ 0 s
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test14/test14.cpp b/src/systemc/tests/systemc/kernel/sc_time/test14/test14.cpp
new file mode 100644
index 000000000..d05f8a41c
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test14/test14.cpp
@@ -0,0 +1,77 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test14.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_default_time_unit
+
+#include "systemc.h"
+
+SC_MODULE( source )
+{
+ sc_in_clk clk;
+ sc_out<int> out;
+
+ void main_action()
+ {
+ sc_set_default_time_unit( 10, SC_PS );
+ int a = 0;
+ while( true ) {
+ wait();
+ out = ++ a;
+ }
+ }
+
+ SC_CTOR( source )
+ {
+ SC_THREAD( main_action );
+ sensitive << clk.pos();
+ }
+};
+
+int
+sc_main( int, char*[] )
+{
+ sc_clock clk( "clk" );
+ sc_signal<int> sig( "sig" );
+
+ source src( "src" );
+ src.clk( clk );
+ src.out( sig );
+
+ sc_start();
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test15/golden/test15.log b/src/systemc/tests/systemc/kernel/sc_time/test15/golden/test15.log
new file mode 100644
index 000000000..ed48a2b5e
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test15/golden/test15.log
@@ -0,0 +1,14 @@
+SystemC Simulation
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_set_default_time_unit
+
+Error: (E515) set default time unit failed: already specified
+In file: <removed by verify.pl>
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test15/test15.cpp b/src/systemc/tests/systemc/kernel/sc_time/test15/test15.cpp
new file mode 100644
index 000000000..03be11a37
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test15/test15.cpp
@@ -0,0 +1,49 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test15.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_default_time_unit
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_default_time_unit( 1, SC_NS );
+ sc_set_default_time_unit( 10, SC_FS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test16/golden/test16.log b/src/systemc/tests/systemc/kernel/sc_time/test16/golden/test16.log
new file mode 100644
index 000000000..775681584
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test16/golden/test16.log
@@ -0,0 +1,14 @@
+SystemC Simulation
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_set_default_time_unit
+
+Error: (E515) set default time unit failed: value smaller than time resolution
+In file: <removed by verify.pl>
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test16/test16.cpp b/src/systemc/tests/systemc/kernel/sc_time/test16/test16.cpp
new file mode 100644
index 000000000..89a0cd638
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test16/test16.cpp
@@ -0,0 +1,48 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test16.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of function sc_set_default_time_unit
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_default_time_unit( 10, SC_FS );
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test17/golden/test17.log b/src/systemc/tests/systemc/kernel/sc_time/test17/golden/test17.log
new file mode 100644
index 000000000..8bda9c5a4
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test17/golden/test17.log
@@ -0,0 +1,14 @@
+SystemC Simulation
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_set_default_time_unit
+
+Info: (I804) /IEEE_Std_1666/deprecated: deprecated function: sc_get_default_time_unit
+10 ms
+
+Info: (I804) /IEEE_Std_1666/deprecated: You can turn off warnings about
+ IEEE 1666 deprecated features by placing this method call
+ as the first statement in your sc_main() function:
+
+ sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated",
+ sc_core::SC_DO_NOTHING );
+
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test17/test17.cpp b/src/systemc/tests/systemc/kernel/sc_time/test17/test17.cpp
new file mode 100644
index 000000000..7bcf3d385
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test17/test17.cpp
@@ -0,0 +1,49 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test17.cpp --
+
+ Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// test of functions sc_set_default_time_unit and sc_get_default_time_unit
+
+#include "systemc.h"
+
+int
+sc_main( int, char*[] )
+{
+ sc_set_default_time_unit( 10, SC_MS );
+ cout << sc_get_default_time_unit() << endl;
+
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test18/golden/test18.log b/src/systemc/tests/systemc/kernel/sc_time/test18/golden/test18.log
new file mode 100644
index 000000000..4c1985e07
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test18/golden/test18.log
@@ -0,0 +1,8 @@
+SystemC Simulation
+8 ns throwing
+8 ns caught
+9 ns throwing
+9 ns caught
+10 ns throwing
+10 ns caught
+Program completed
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test18/test18.cpp b/src/systemc/tests/systemc/kernel/sc_time/test18/test18.cpp
new file mode 100644
index 000000000..18a723d0e
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test18/test18.cpp
@@ -0,0 +1,88 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test18.cpp -- Test that time cannot go backwards in simulator
+
+ Original Author: Andy Goodrich, Forte Design Systems, 2006-05-03
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// $Log: test18.cpp,v $
+// Revision 1.1.1.1 2006/12/15 20:26:06 acg
+// systemc_tests-2.3
+//
+// Revision 1.1 2006/05/03 19:37:10 acg
+// Andy Goodrich: new test to check that time will not run backward if a
+// negative value is given to sc_event::notify()
+//
+
+#include "systemc.h"
+
+SC_MODULE(DUT)
+{
+ SC_CTOR(DUT)
+ {
+ SC_METHOD(catcher);
+ sensitive << m_event;
+ dont_initialize();
+ SC_CTHREAD(thrower,m_clk.pos());
+ }
+ void catcher()
+ {
+ cout << sc_time_stamp() << " caught" << endl;
+ }
+ void thrower()
+ {
+ sc_time minus_four(-4.0, SC_NS);
+ wait(7);
+ for (;;)
+ {
+ wait();
+ cout << sc_time_stamp() << " throwing" << endl;
+ m_event.notify(minus_four);
+ }
+ }
+ sc_in<bool> m_clk;
+ sc_event m_event;
+};
+
+int sc_main(int argc, char* argv[])
+{
+ sc_clock clock;
+ DUT dut("dut");
+
+ dut.m_clk(clock);
+
+ sc_start(11, SC_NS);
+
+ cout << "Program completed" << endl;
+ return 0;
+}
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test19/golden/test19.log b/src/systemc/tests/systemc/kernel/sc_time/test19/golden/test19.log
new file mode 100644
index 000000000..20d4fe0a1
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test19/golden/test19.log
@@ -0,0 +1,83 @@
+SystemC Simulation
+
+Resolution = 1 ps
+10 ns, value=10000
+ t.value=10, t.unit=ns
+100 ns, value=100000
+ t.value=100, t.unit=ns
+1 us, value=1000000
+ t.value=1, t.unit=us
+100 ns, value=100000
+ t.value=100, t.unit=ns
+1 us, value=1000000
+ t.value=1, t.unit=us
+10 us, value=10000000
+ t.value=10, t.unit=us
+100 us, value=100000000
+ t.value=100, t.unit=us
+1 ms, value=1000000000
+ t.value=1, t.unit=ms
+100 s, value=100000000000000
+ t.value=100, t.unit=s
+
+Resolution = 100 fs
+10 ns, value=100000
+ t.value=10, t.unit=ns
+100 ns, value=1000000
+ t.value=100, t.unit=ns
+1 us, value=10000000
+ t.value=1, t.unit=us
+100 ns, value=1000000
+ t.value=100, t.unit=ns
+1 us, value=10000000
+ t.value=1, t.unit=us
+10 us, value=100000000
+ t.value=10, t.unit=us
+100 us, value=1000000000
+ t.value=100, t.unit=us
+1 ms, value=10000000000
+ t.value=1, t.unit=ms
+100 s, value=1000000000000000
+ t.value=100, t.unit=s
+
+Resolution = 10 fs
+10 ns, value=1000000
+ t.value=10, t.unit=ns
+100 ns, value=10000000
+ t.value=100, t.unit=ns
+1 us, value=100000000
+ t.value=1, t.unit=us
+100 ns, value=10000000
+ t.value=100, t.unit=ns
+1 us, value=100000000
+ t.value=1, t.unit=us
+10 us, value=1000000000
+ t.value=10, t.unit=us
+100 us, value=10000000000
+ t.value=100, t.unit=us
+1 ms, value=100000000000
+ t.value=1, t.unit=ms
+100 s, value=10000000000000000
+ t.value=100, t.unit=s
+
+Resolution = 1 fs
+10 ns, value=10000000
+ t.value=10, t.unit=ns
+100 ns, value=100000000
+ t.value=100, t.unit=ns
+1 us, value=1000000000
+ t.value=1, t.unit=us
+100 ns, value=100000000
+ t.value=100, t.unit=ns
+1 us, value=1000000000
+ t.value=1, t.unit=us
+10 us, value=10000000000
+ t.value=10, t.unit=us
+100 us, value=100000000000
+ t.value=100, t.unit=us
+1 ms, value=1000000000000
+ t.value=1, t.unit=ms
+100 s, value=100000000000000000
+ t.value=100, t.unit=s
+
+Program completed
diff --git a/src/systemc/tests/systemc/kernel/sc_time/test19/test19.cpp b/src/systemc/tests/systemc/kernel/sc_time/test19/test19.cpp
new file mode 100644
index 000000000..c7a7f357c
--- /dev/null
+++ b/src/systemc/tests/systemc/kernel/sc_time/test19/test19.cpp
@@ -0,0 +1,93 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ test19.cpp -- Test sc_time string/tuple conversions
+
+ Original Author: Philipp A. Hartmann, OFFIS
+
+ *****************************************************************************/
+
+
+#include "systemc.h"
+
+void check_time( const sc_time& t, sc_time_unit tu, const std::string & str )
+{
+ sc_time_tuple tp = t;
+
+ std::cout << t.to_string() << ", value=" << t.value() << std::endl;
+ std::cout << " ";
+ if( tp.has_value() )
+ std::cout << "t.value=" << tp.value();
+ else
+ std::cout << "t.double=" << tp.to_double();
+ std::cout << ", t.unit=" << tp.unit_symbol()
+ << std::endl;
+
+ sc_assert( tp.has_value() );
+ sc_assert( t.to_string() == str );
+ sc_assert( tp.to_string() == t.to_string() );
+ sc_assert( tp.unit() == tu );
+
+ sc_time u = sc_time::from_string( str.c_str() );
+ sc_assert( t == u );
+ sc_assert( u == tp );
+ sc_assert( tp.unit() == sc_time_tuple(u).unit() );
+
+ u = sc_time( tp.to_double(), tp.unit_symbol() );
+ sc_assert( t == u );
+ sc_assert( u == tp );
+ sc_assert( tp.unit() == sc_time_tuple(u).unit() );
+}
+
+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 );
+
+ unsigned resolutions[] = { 100, 10, 1 };
+ sc_time_unit resunit = SC_FS;
+ unsigned* res = resolutions;
+
+ while( true )
+ {
+ std::cout << "\nResolution = " << sc_get_time_resolution() << std::endl;
+
+ check_time( sc_time( 10, SC_NS), SC_NS, "10 ns" );
+ check_time( sc_time( 100, SC_NS), SC_NS, "100 ns" );
+ check_time( sc_time(1000, SC_NS), SC_US, "1 us" );
+ check_time( sc_time( 0.1, SC_US), SC_NS, "100 ns" );
+ check_time( sc_time( 1, SC_US), SC_US, "1 us" );
+ check_time( sc_time( 10, SC_US), SC_US, "10 us" );
+ check_time( sc_time( 100, SC_US), SC_US, "100 us" );
+ check_time( sc_time(1000, SC_US), SC_MS, "1 ms" );
+ check_time( sc_time( 100, SC_SEC), SC_SEC, "100 s" );
+
+ // exit loop before final resolution update
+ if (res == resolutions + (sizeof(resolutions)/sizeof(*resolutions)))
+ break;
+
+ sc_set_time_resolution( *res, resunit );
+ res++;
+ }
+
+ cout << "\nProgram completed" << endl;
+ return 0;
+}