summaryrefslogtreecommitdiff
path: root/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-05-24 01:37:55 -0700
committerGabe Black <gabeblack@google.com>2018-08-08 10:09:54 +0000
commit16fa8d7cc8c92f5ab879e4cf9c6c0bbb3567860f (patch)
tree7b6faaacb4574a555e561534aa4a8508c0624c32 /src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement
parent7235d3b5211d0ba8f528d930a4c1e7ad62eec51a (diff)
downloadgem5-16fa8d7cc8c92f5ab879e4cf9c6c0bbb3567860f.tar.xz
systemc: Import tests from the Accellera systemc distribution.
Change-Id: Iad76b398949a55d768a34d027a2d8e3739953da6 Reviewed-on: https://gem5-review.googlesource.com/10845 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement')
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/common.h45
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.cpp92
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.f4
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.h102
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.cpp52
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.h75
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/golden/decrement.log204
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/main.cpp87
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.cpp66
-rw-r--r--src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.h78
10 files changed, 805 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/common.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/common.h
new file mode 100644
index 000000000..2a4edbad5
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/common.h
@@ -0,0 +1,45 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ common.h --
+
+ 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:
+
+ *****************************************************************************/
+
+#ifndef COMMON_H
+#define COMMON_H
+
+#include "systemc.h"
+
+typedef sc_signal<sc_bv<4> > sc_signal_bool_vector;
+
+#endif
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.cpp
new file mode 100644
index 000000000..86f654680
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.cpp
@@ -0,0 +1,92 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ decrement.cpp --
+
+ Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+#include "decrement.h"
+
+void decrement::entry(){
+
+ #define ONE 1
+ const int eins = 1;
+ int tmp1;
+ sc_bigint<4> tmp2;
+
+ // reset_loop
+ if (reset.read() == true) {
+ out_valid.write(false);
+ out_ack.write(false);
+ wait();
+ } else wait();
+
+ //
+ // main loop
+ //
+
+ while(1) {
+ while(in_valid.read()==false) wait();
+ wait();
+
+ //reading the inputs
+ tmp1 = in_value1.read();
+ tmp2 = in_value2.read();
+
+ //execute simple operations
+ tmp1 = tmp1 - 1;
+ tmp1 = tmp1 - ONE;
+ tmp1 = tmp1 - eins;
+ tmp1--;
+ tmp2 = tmp2 - 1;
+ tmp2 = tmp2 - ONE;
+ tmp2 = tmp2 - eins;
+ tmp2--;
+
+ out_ack.write(true);
+
+ // write outputs
+ out_value1.write(tmp1);
+ out_value2.write(tmp2);
+
+ out_valid.write(true);
+ wait();
+ out_ack.write(false);
+ out_valid.write(false);
+ wait();
+ }
+}
+
+// EOF
+
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.f b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.f
new file mode 100644
index 000000000..894de102e
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.f
@@ -0,0 +1,4 @@
+decrement/stimulus.cpp
+decrement/display.cpp
+decrement/decrement.cpp
+decrement/main.cpp
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.h
new file mode 100644
index 000000000..cf19214a9
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/decrement.h
@@ -0,0 +1,102 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ decrement.h --
+
+ Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+#include "common.h"
+
+SC_MODULE( decrement )
+{
+ SC_HAS_PROCESS( decrement );
+
+ sc_in_clk clk;
+
+ //====================================================================
+ // [C] Always Needed Member Function
+ // -- constructor
+ // -- entry
+ //====================================================================
+
+ const sc_signal<bool>& reset ;
+ const sc_signal<int>& in_value1; // Input port
+ const sc_signal_bool_vector& in_value2; // Input port
+ const sc_signal<bool>& in_valid; // Input port
+ sc_signal<bool>& out_ack; // Output port
+ sc_signal<int>& out_value1; // Output port
+ sc_signal_bool_vector& out_value2; // Output port
+ sc_signal<bool>& out_valid; // Output port
+
+ //
+ // Constructor
+ //
+
+ decrement (
+ sc_module_name NAME, // referense name
+ sc_clock& CLK, // clock
+ const sc_signal<bool>& RESET,
+ const sc_signal<int>& IN_VALUE1,
+ const sc_signal_bool_vector& IN_VALUE2,
+ const sc_signal<bool>& IN_VALID, // Input port
+ sc_signal<bool>& OUT_ACK,
+ sc_signal<int>& OUT_VALUE1,
+ sc_signal_bool_vector& OUT_VALUE2,
+ sc_signal<bool>& OUT_VALID // Output port
+ )
+ :
+ reset (RESET),
+ in_value1 (IN_VALUE1),
+ in_value2 (IN_VALUE2),
+ in_valid (IN_VALID),
+ out_ack (OUT_ACK),
+ out_value1 (OUT_VALUE1),
+ out_value2 (OUT_VALUE2),
+ out_valid (OUT_VALID)
+
+ {
+ clk (CLK);
+ SC_CTHREAD( entry, clk.pos() );
+ reset_signal_is(reset,true);
+ };
+
+ //
+
+ void entry ();
+
+};
+
+// EOF
+
+
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.cpp
new file mode 100644
index 000000000..c1192ec7b
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.cpp
@@ -0,0 +1,52 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ display.cpp --
+
+ Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+#include "display.h"
+
+void display::entry() {
+
+ int counter = 0;
+
+ while(counter++<100){
+ do { wait(); } while ( in_valid == false);
+ cout << "Display: " << in_value1.read() << " " << in_value2.read() << endl;
+ do { wait(); } while ( in_valid == true);
+ }
+ sc_stop();
+}
+// EOF
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.h
new file mode 100644
index 000000000..80f2aa3cd
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/display.h
@@ -0,0 +1,75 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ display.h --
+
+ Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+#include "common.h"
+
+SC_MODULE( display )
+{
+ SC_HAS_PROCESS( display );
+
+ sc_in_clk clk;
+
+ const sc_signal<int>& in_value1; // Input port
+ const sc_signal_bool_vector& in_value2; // Input port
+ const sc_signal<bool>& in_valid; // Input port
+
+ //
+ // Constructor
+ //
+
+ display(
+ sc_module_name NAME, // reference name
+ sc_clock& CLK, // clock
+ const sc_signal<int>& IN_VALUE1,
+ const sc_signal_bool_vector& IN_VALUE2,
+ const sc_signal<bool>& IN_VALID
+ )
+ :
+ in_value1 (IN_VALUE1),
+ in_value2 (IN_VALUE2),
+ in_valid (IN_VALID)
+ {
+ clk (CLK);
+ SC_CTHREAD( entry, clk.pos() );
+ };
+
+
+ void entry();
+};
+
+// EOF
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/golden/decrement.log b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/golden/decrement.log
new file mode 100644
index 000000000..10fc11b2e
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/golden/decrement.log
@@ -0,0 +1,204 @@
+SystemC Simulation
+Stimuli: 0 1
+Display: -4 1101
+Stimuli: 1 2
+Display: -3 1110
+Stimuli: 2 3
+Display: -2 1111
+Stimuli: 3 4
+Display: -1 0000
+Stimuli: 4 5
+Display: 0 0001
+Stimuli: 5 6
+Display: 1 0010
+Stimuli: 6 7
+Display: 2 0011
+Stimuli: 7 -8
+Display: 3 0100
+Stimuli: 8 -7
+Display: 4 0101
+Stimuli: 9 -6
+Display: 5 0110
+Stimuli: 10 -5
+Display: 6 0111
+Stimuli: 11 -4
+Display: 7 1000
+Stimuli: 12 -3
+Display: 8 1001
+Stimuli: 13 -2
+Display: 9 1010
+Stimuli: 14 -1
+Display: 10 1011
+Stimuli: 15 0
+Display: 11 1100
+Stimuli: 16 1
+Display: 12 1101
+Stimuli: 17 2
+Display: 13 1110
+Stimuli: 18 3
+Display: 14 1111
+Stimuli: 19 4
+Display: 15 0000
+Stimuli: 20 5
+Display: 16 0001
+Stimuli: 21 6
+Display: 17 0010
+Stimuli: 22 7
+Display: 18 0011
+Stimuli: 23 -8
+Display: 19 0100
+Stimuli: 24 -7
+Display: 20 0101
+Stimuli: 25 -6
+Display: 21 0110
+Stimuli: 26 -5
+Display: 22 0111
+Stimuli: 27 -4
+Display: 23 1000
+Stimuli: 28 -3
+Display: 24 1001
+Stimuli: 29 -2
+Display: 25 1010
+Stimuli: 30 -1
+Display: 26 1011
+Stimuli: 31 0
+Display: 27 1100
+Stimuli: 32 1
+Display: 28 1101
+Stimuli: 33 2
+Display: 29 1110
+Stimuli: 34 3
+Display: 30 1111
+Stimuli: 35 4
+Display: 31 0000
+Stimuli: 36 5
+Display: 32 0001
+Stimuli: 37 6
+Display: 33 0010
+Stimuli: 38 7
+Display: 34 0011
+Stimuli: 39 -8
+Display: 35 0100
+Stimuli: 40 -7
+Display: 36 0101
+Stimuli: 41 -6
+Display: 37 0110
+Stimuli: 42 -5
+Display: 38 0111
+Stimuli: 43 -4
+Display: 39 1000
+Stimuli: 44 -3
+Display: 40 1001
+Stimuli: 45 -2
+Display: 41 1010
+Stimuli: 46 -1
+Display: 42 1011
+Stimuli: 47 0
+Display: 43 1100
+Stimuli: 48 1
+Display: 44 1101
+Stimuli: 49 2
+Display: 45 1110
+Stimuli: 50 3
+Display: 46 1111
+Stimuli: 51 4
+Display: 47 0000
+Stimuli: 52 5
+Display: 48 0001
+Stimuli: 53 6
+Display: 49 0010
+Stimuli: 54 7
+Display: 50 0011
+Stimuli: 55 -8
+Display: 51 0100
+Stimuli: 56 -7
+Display: 52 0101
+Stimuli: 57 -6
+Display: 53 0110
+Stimuli: 58 -5
+Display: 54 0111
+Stimuli: 59 -4
+Display: 55 1000
+Stimuli: 60 -3
+Display: 56 1001
+Stimuli: 61 -2
+Display: 57 1010
+Stimuli: 62 -1
+Display: 58 1011
+Stimuli: 63 0
+Display: 59 1100
+Stimuli: 64 1
+Display: 60 1101
+Stimuli: 65 2
+Display: 61 1110
+Stimuli: 66 3
+Display: 62 1111
+Stimuli: 67 4
+Display: 63 0000
+Stimuli: 68 5
+Display: 64 0001
+Stimuli: 69 6
+Display: 65 0010
+Stimuli: 70 7
+Display: 66 0011
+Stimuli: 71 -8
+Display: 67 0100
+Stimuli: 72 -7
+Display: 68 0101
+Stimuli: 73 -6
+Display: 69 0110
+Stimuli: 74 -5
+Display: 70 0111
+Stimuli: 75 -4
+Display: 71 1000
+Stimuli: 76 -3
+Display: 72 1001
+Stimuli: 77 -2
+Display: 73 1010
+Stimuli: 78 -1
+Display: 74 1011
+Stimuli: 79 0
+Display: 75 1100
+Stimuli: 80 1
+Display: 76 1101
+Stimuli: 81 2
+Display: 77 1110
+Stimuli: 82 3
+Display: 78 1111
+Stimuli: 83 4
+Display: 79 0000
+Stimuli: 84 5
+Display: 80 0001
+Stimuli: 85 6
+Display: 81 0010
+Stimuli: 86 7
+Display: 82 0011
+Stimuli: 87 -8
+Display: 83 0100
+Stimuli: 88 -7
+Display: 84 0101
+Stimuli: 89 -6
+Display: 85 0110
+Stimuli: 90 -5
+Display: 86 0111
+Stimuli: 91 -4
+Display: 87 1000
+Stimuli: 92 -3
+Display: 88 1001
+Stimuli: 93 -2
+Display: 89 1010
+Stimuli: 94 -1
+Display: 90 1011
+Stimuli: 95 0
+Display: 91 1100
+Stimuli: 96 1
+Display: 92 1101
+Stimuli: 97 2
+Display: 93 1110
+Stimuli: 98 3
+Display: 94 1111
+Stimuli: 99 4
+Display: 95 0000
+Stimuli: 100 5
+
+Info: /OSCI/SystemC: Simulation stopped by user.
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/main.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/main.cpp
new file mode 100644
index 000000000..89e3a7295
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/main.cpp
@@ -0,0 +1,87 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ main.cpp --
+
+ Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+#include "stimulus.h"
+#include "display.h"
+#include "decrement.h"
+
+int sc_main(int argc , char *argv[]) {
+ sc_clock clock;
+ sc_signal<bool> reset;
+ sc_signal<int> stimulus_line1;
+ sc_signal_bool_vector stimulus_line2;
+ sc_signal<bool> input_valid;
+ sc_signal<bool> ack;
+ sc_signal<bool> output_valid;
+ sc_signal<int> result_line1;
+ sc_signal_bool_vector result_line2;
+
+ // initialization to fix regressions - ali
+ output_valid = false;
+
+ stimulus stimulus1("stimulus_block",
+ clock,
+ reset,
+ stimulus_line1,
+ stimulus_line2,
+ input_valid,
+ ack);
+
+ decrement decrement1( "process_body",
+ clock,
+ reset,
+ stimulus_line1,
+ stimulus_line2,
+ input_valid,
+ ack,
+ result_line1,
+ result_line2,
+ output_valid);
+
+ display display1( "display_block",
+ clock,
+ result_line1,
+ result_line2,
+ output_valid);
+
+ sc_start();
+
+ return 0;
+}
+
+// EOF
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.cpp
new file mode 100644
index 000000000..924a46e69
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.cpp
@@ -0,0 +1,66 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ stimulus.cpp --
+
+ Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+#include "stimulus.h"
+
+void stimulus::entry() {
+
+ reset.write(true);
+ wait();
+ reset.write(false);
+
+ int tmp1;
+ sc_signed tmp2(4);
+
+ tmp1 = 0;
+ tmp2 = "0001";
+
+
+ while(true){
+ out_valid.write(true);
+ out_value1.write(tmp1);
+ out_value2.write(tmp2);
+ cout << "Stimuli: " << tmp1 << " " << tmp2 << endl;
+ tmp1 = tmp1 + 1;
+ tmp2 = tmp2 + 1;
+ do { wait(); } while (in_ack==false);
+ out_valid.write(false);
+ wait();
+ }
+}
+// EOF
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.h
new file mode 100644
index 000000000..92e32db22
--- /dev/null
+++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/decrement/stimulus.h
@@ -0,0 +1,78 @@
+/*****************************************************************************
+
+ 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.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ stimulus.h --
+
+ Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-14
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+#include "common.h"
+
+SC_MODULE( stimulus )
+{
+ SC_HAS_PROCESS( stimulus );
+
+ sc_in_clk clk;
+
+ sc_signal<bool>& reset ;
+ sc_signal<int>& out_value1; // Output port
+ sc_signal_bool_vector& out_value2; // Output port
+ sc_signal<bool>& out_valid; // Output port
+ const sc_signal<bool>& in_ack;
+
+ //
+ // Constructor
+ //
+
+ stimulus(
+ sc_module_name NAME, // reference name
+ sc_clock& CLK, // clock
+ sc_signal<bool>& RESET,
+ sc_signal<int>& OUT_VALUE1,
+ sc_signal_bool_vector& OUT_VALUE2,
+ sc_signal<bool>& OUT_VALID,
+ const sc_signal<bool>& IN_ACK
+ )
+ :
+ reset (RESET),
+ out_value1 (OUT_VALUE1),
+ out_value2 (OUT_VALUE2),
+ out_valid (OUT_VALID),
+ in_ack (IN_ACK)
+ {
+ clk (CLK);
+ SC_CTHREAD( entry, clk.pos() );
+ };
+ void entry();
+};
+// EOF