diff options
Diffstat (limited to 'src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing')
10 files changed, 875 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/common.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/common.h new file mode 100644 index 000000000..60baad076 --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/common.h @@ -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. + + *****************************************************************************/ + +/***************************************************************************** + + 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_vector4; +typedef sc_signal<sc_bv<5> > sc_signal_bool_vector5; +typedef sc_signal<sc_bv<6> > sc_signal_bool_vector6; +typedef sc_signal<sc_bv<7> > sc_signal_bool_vector7; +typedef sc_signal<sc_bv<8> > sc_signal_bool_vector8; + +#endif diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/display.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/display.cpp new file mode 100644 index 000000000..47832f313 --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/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() << " " << in_value3.read() << " " << in_value4.read() << " " << in_value5.read() << endl; + do { wait(); } while ( in_valid == true); + } + wait(); + sc_stop(); +} +// EOF diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/display.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/display.h new file mode 100644 index 000000000..377dd8cbd --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/display.h @@ -0,0 +1,84 @@ +/***************************************************************************** + + 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_bool_vector4& in_value1; // Output port + const sc_signal_bool_vector5& in_value2; // Output port + const sc_signal_bool_vector6& in_value3; // Output port + const sc_signal_bool_vector7& in_value4; // Output port + const sc_signal_bool_vector8& in_value5; // Output port + const sc_signal<bool>& in_valid; // Output port + + // + // Constructor + // + + display( + sc_module_name NAME, // reference name + sc_clock& CLK, // clock + const sc_signal_bool_vector4& IN_VALUE1, + const sc_signal_bool_vector5& IN_VALUE2, + const sc_signal_bool_vector6& IN_VALUE3, + const sc_signal_bool_vector7& IN_VALUE4, + const sc_signal_bool_vector8& IN_VALUE5, + const sc_signal<bool>& IN_VALID + ) + : + in_value1 (IN_VALUE1), + in_value2 (IN_VALUE2), + in_value3 (IN_VALUE3), + in_value4 (IN_VALUE4), + in_value5 (IN_VALUE5), + 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/sharing/golden/sharing.log b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/golden/sharing.log new file mode 100644 index 000000000..1789b5327 --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/golden/sharing.log @@ -0,0 +1,204 @@ +SystemC Simulation +Stimuli: 0 1 2 3 4 +Display: 1100 11101 111110 0000001 00000010 +Stimuli: 1 2 3 4 5 +Display: 1101 11110 111111 0000010 00000011 +Stimuli: 2 3 4 5 6 +Display: 1110 11111 000000 0000011 00000100 +Stimuli: 3 4 5 6 7 +Display: 1111 00000 000001 0000100 00000101 +Stimuli: 4 5 6 7 8 +Display: 0000 00001 000010 0000101 00000110 +Stimuli: 5 6 7 8 9 +Display: 0001 00010 000011 0000110 00000111 +Stimuli: 6 7 8 9 10 +Display: 0010 00011 000100 0000111 00001000 +Stimuli: 7 8 9 10 11 +Display: 0011 00100 000101 0001000 00001001 +Stimuli: -8 9 10 11 12 +Display: 0100 00101 000110 0001001 00001010 +Stimuli: -7 10 11 12 13 +Display: 0101 00110 000111 0001010 00001011 +Stimuli: -6 11 12 13 14 +Display: 0110 00111 001000 0001011 00001100 +Stimuli: -5 12 13 14 15 +Display: 0111 01000 001001 0001100 00001101 +Stimuli: -4 13 14 15 16 +Display: 1000 01001 001010 0001101 00001110 +Stimuli: -3 14 15 16 17 +Display: 1001 01010 001011 0001110 00001111 +Stimuli: -2 15 16 17 18 +Display: 1010 01011 001100 0001111 00010000 +Stimuli: -1 -16 17 18 19 +Display: 1011 01100 001101 0010000 00010001 +Stimuli: 0 -15 18 19 20 +Display: 1100 01101 001110 0010001 00010010 +Stimuli: 1 -14 19 20 21 +Display: 1101 01110 001111 0010010 00010011 +Stimuli: 2 -13 20 21 22 +Display: 1110 01111 010000 0010011 00010100 +Stimuli: 3 -12 21 22 23 +Display: 1111 10000 010001 0010100 00010101 +Stimuli: 4 -11 22 23 24 +Display: 0000 10001 010010 0010101 00010110 +Stimuli: 5 -10 23 24 25 +Display: 0001 10010 010011 0010110 00010111 +Stimuli: 6 -9 24 25 26 +Display: 0010 10011 010100 0010111 00011000 +Stimuli: 7 -8 25 26 27 +Display: 0011 10100 010101 0011000 00011001 +Stimuli: -8 -7 26 27 28 +Display: 0100 10101 010110 0011001 00011010 +Stimuli: -7 -6 27 28 29 +Display: 0101 10110 010111 0011010 00011011 +Stimuli: -6 -5 28 29 30 +Display: 0110 10111 011000 0011011 00011100 +Stimuli: -5 -4 29 30 31 +Display: 0111 11000 011001 0011100 00011101 +Stimuli: -4 -3 30 31 32 +Display: 1000 11001 011010 0011101 00011110 +Stimuli: -3 -2 31 32 33 +Display: 1001 11010 011011 0011110 00011111 +Stimuli: -2 -1 -32 33 34 +Display: 1010 11011 011100 0011111 00100000 +Stimuli: -1 0 -31 34 35 +Display: 1011 11100 011101 0100000 00100001 +Stimuli: 0 1 -30 35 36 +Display: 1100 11101 011110 0100001 00100010 +Stimuli: 1 2 -29 36 37 +Display: 1101 11110 011111 0100010 00100011 +Stimuli: 2 3 -28 37 38 +Display: 1110 11111 100000 0100011 00100100 +Stimuli: 3 4 -27 38 39 +Display: 1111 00000 100001 0100100 00100101 +Stimuli: 4 5 -26 39 40 +Display: 0000 00001 100010 0100101 00100110 +Stimuli: 5 6 -25 40 41 +Display: 0001 00010 100011 0100110 00100111 +Stimuli: 6 7 -24 41 42 +Display: 0010 00011 100100 0100111 00101000 +Stimuli: 7 8 -23 42 43 +Display: 0011 00100 100101 0101000 00101001 +Stimuli: -8 9 -22 43 44 +Display: 0100 00101 100110 0101001 00101010 +Stimuli: -7 10 -21 44 45 +Display: 0101 00110 100111 0101010 00101011 +Stimuli: -6 11 -20 45 46 +Display: 0110 00111 101000 0101011 00101100 +Stimuli: -5 12 -19 46 47 +Display: 0111 01000 101001 0101100 00101101 +Stimuli: -4 13 -18 47 48 +Display: 1000 01001 101010 0101101 00101110 +Stimuli: -3 14 -17 48 49 +Display: 1001 01010 101011 0101110 00101111 +Stimuli: -2 15 -16 49 50 +Display: 1010 01011 101100 0101111 00110000 +Stimuli: -1 -16 -15 50 51 +Display: 1011 01100 101101 0110000 00110001 +Stimuli: 0 -15 -14 51 52 +Display: 1100 01101 101110 0110001 00110010 +Stimuli: 1 -14 -13 52 53 +Display: 1101 01110 101111 0110010 00110011 +Stimuli: 2 -13 -12 53 54 +Display: 1110 01111 110000 0110011 00110100 +Stimuli: 3 -12 -11 54 55 +Display: 1111 10000 110001 0110100 00110101 +Stimuli: 4 -11 -10 55 56 +Display: 0000 10001 110010 0110101 00110110 +Stimuli: 5 -10 -9 56 57 +Display: 0001 10010 110011 0110110 00110111 +Stimuli: 6 -9 -8 57 58 +Display: 0010 10011 110100 0110111 00111000 +Stimuli: 7 -8 -7 58 59 +Display: 0011 10100 110101 0111000 00111001 +Stimuli: -8 -7 -6 59 60 +Display: 0100 10101 110110 0111001 00111010 +Stimuli: -7 -6 -5 60 61 +Display: 0101 10110 110111 0111010 00111011 +Stimuli: -6 -5 -4 61 62 +Display: 0110 10111 111000 0111011 00111100 +Stimuli: -5 -4 -3 62 63 +Display: 0111 11000 111001 0111100 00111101 +Stimuli: -4 -3 -2 63 64 +Display: 1000 11001 111010 0111101 00111110 +Stimuli: -3 -2 -1 -64 65 +Display: 1001 11010 111011 0111110 00111111 +Stimuli: -2 -1 0 -63 66 +Display: 1010 11011 111100 0111111 01000000 +Stimuli: -1 0 1 -62 67 +Display: 1011 11100 111101 1000000 01000001 +Stimuli: 0 1 2 -61 68 +Display: 1100 11101 111110 1000001 01000010 +Stimuli: 1 2 3 -60 69 +Display: 1101 11110 111111 1000010 01000011 +Stimuli: 2 3 4 -59 70 +Display: 1110 11111 000000 1000011 01000100 +Stimuli: 3 4 5 -58 71 +Display: 1111 00000 000001 1000100 01000101 +Stimuli: 4 5 6 -57 72 +Display: 0000 00001 000010 1000101 01000110 +Stimuli: 5 6 7 -56 73 +Display: 0001 00010 000011 1000110 01000111 +Stimuli: 6 7 8 -55 74 +Display: 0010 00011 000100 1000111 01001000 +Stimuli: 7 8 9 -54 75 +Display: 0011 00100 000101 1001000 01001001 +Stimuli: -8 9 10 -53 76 +Display: 0100 00101 000110 1001001 01001010 +Stimuli: -7 10 11 -52 77 +Display: 0101 00110 000111 1001010 01001011 +Stimuli: -6 11 12 -51 78 +Display: 0110 00111 001000 1001011 01001100 +Stimuli: -5 12 13 -50 79 +Display: 0111 01000 001001 1001100 01001101 +Stimuli: -4 13 14 -49 80 +Display: 1000 01001 001010 1001101 01001110 +Stimuli: -3 14 15 -48 81 +Display: 1001 01010 001011 1001110 01001111 +Stimuli: -2 15 16 -47 82 +Display: 1010 01011 001100 1001111 01010000 +Stimuli: -1 -16 17 -46 83 +Display: 1011 01100 001101 1010000 01010001 +Stimuli: 0 -15 18 -45 84 +Display: 1100 01101 001110 1010001 01010010 +Stimuli: 1 -14 19 -44 85 +Display: 1101 01110 001111 1010010 01010011 +Stimuli: 2 -13 20 -43 86 +Display: 1110 01111 010000 1010011 01010100 +Stimuli: 3 -12 21 -42 87 +Display: 1111 10000 010001 1010100 01010101 +Stimuli: 4 -11 22 -41 88 +Display: 0000 10001 010010 1010101 01010110 +Stimuli: 5 -10 23 -40 89 +Display: 0001 10010 010011 1010110 01010111 +Stimuli: 6 -9 24 -39 90 +Display: 0010 10011 010100 1010111 01011000 +Stimuli: 7 -8 25 -38 91 +Display: 0011 10100 010101 1011000 01011001 +Stimuli: -8 -7 26 -37 92 +Display: 0100 10101 010110 1011001 01011010 +Stimuli: -7 -6 27 -36 93 +Display: 0101 10110 010111 1011010 01011011 +Stimuli: -6 -5 28 -35 94 +Display: 0110 10111 011000 1011011 01011100 +Stimuli: -5 -4 29 -34 95 +Display: 0111 11000 011001 1011100 01011101 +Stimuli: -4 -3 30 -33 96 +Display: 1000 11001 011010 1011101 01011110 +Stimuli: -3 -2 31 -32 97 +Display: 1001 11010 011011 1011110 01011111 +Stimuli: -2 -1 -32 -31 98 +Display: 1010 11011 011100 1011111 01100000 +Stimuli: -1 0 -31 -30 99 +Display: 1011 11100 011101 1100000 01100001 +Stimuli: 0 1 -30 -29 100 +Display: 1100 11101 011110 1100001 01100010 +Stimuli: 1 2 -29 -28 101 +Display: 1101 11110 011111 1100010 01100011 +Stimuli: 2 3 -28 -27 102 +Display: 1110 11111 100000 1100011 01100100 +Stimuli: 3 4 -27 -26 103 +Display: 1111 00000 100001 1100100 01100101 +Stimuli: 4 5 -26 -25 104 + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/main.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/main.cpp new file mode 100644 index 000000000..82b0ce24a --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/main.cpp @@ -0,0 +1,108 @@ +/***************************************************************************** + + 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 "sharing.h" + +int sc_main (int argc , char *argv[]) { + sc_clock clock; + sc_signal<bool> reset; + sc_signal_bool_vector4 stimulus_line1; + sc_signal_bool_vector5 stimulus_line2; + sc_signal_bool_vector6 stimulus_line3; + sc_signal_bool_vector7 stimulus_line4; + sc_signal_bool_vector8 stimulus_line5; + sc_signal<bool> input_valid; + sc_signal<bool> ack; + sc_signal<bool> output_valid; + sc_signal_bool_vector4 result_line1; + sc_signal_bool_vector5 result_line2; + sc_signal_bool_vector6 result_line3; + sc_signal_bool_vector7 result_line4; + sc_signal_bool_vector8 result_line5; + + // SYL 990908 - Initialize some signals -- logs diffed + // when I hacked the simulation kernel. + reset = 0; + input_valid = 0; + ack = 0; + output_valid = 0; + + stimulus stimulus1("stimulus_block", + clock, + reset, + stimulus_line1, + stimulus_line2, + stimulus_line3, + stimulus_line4, + stimulus_line5, + input_valid, + ack); + + sharing sharing1( "process_body", + clock, + reset, + stimulus_line1, + stimulus_line2, + stimulus_line3, + stimulus_line4, + stimulus_line5, + input_valid, + ack, + result_line1, + result_line2, + result_line3, + result_line4, + result_line5, + output_valid); + + display display1( "display_block", + clock, + result_line1, + result_line2, + result_line3, + result_line4, + result_line5, + output_valid); + + sc_start(); + return 0; +} + +// EOF diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.cpp new file mode 100644 index 000000000..8215ce41d --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.cpp @@ -0,0 +1,97 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + sharing.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 "sharing.h" + +void sharing::entry(){ + + sc_bigint<4> tmp1; + sc_biguint<5> tmp2; + sc_bigint<6> tmp3; + sc_biguint<7> tmp4; + sc_biguint<8> tmp5; + + // 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(); + tmp3 = in_value3.read(); + tmp4 = in_value4.read(); + tmp5 = in_value5.read(); + + out_ack.write(true); + + //execute simple operations + tmp1 = tmp1 - 4; + tmp2 = tmp2 - 4; + tmp3 = tmp3 - 4; + tmp4 = tmp4 - 2; + tmp5 = tmp5 - 2; + + // write outputs + out_value1.write(tmp1); + out_value2.write(tmp2); + out_value3.write(tmp3); + out_value4.write(tmp4); + out_value5.write(tmp5); + + 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/sharing/sharing.f b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.f new file mode 100644 index 000000000..0c0f3ff29 --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.f @@ -0,0 +1,4 @@ +sharing/stimulus.cpp +sharing/display.cpp +sharing/sharing.cpp +sharing/main.cpp diff --git a/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.h new file mode 100644 index 000000000..ca7191f3d --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/sharing.h @@ -0,0 +1,113 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + sharing.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( sharing ) +{ + SC_HAS_PROCESS( sharing ); + + sc_in_clk clk; + + const sc_signal<bool>& reset ; + const sc_signal_bool_vector4& in_value1; // Input port + const sc_signal_bool_vector5& in_value2; // Input port + const sc_signal_bool_vector6& in_value3; // Input port + const sc_signal_bool_vector7& in_value4; // Input port + const sc_signal_bool_vector8& in_value5; // Input port + const sc_signal<bool>& in_valid; // Input port + sc_signal<bool>& out_ack; // Output port + sc_signal_bool_vector4& out_value1; // Output port + sc_signal_bool_vector5& out_value2; // Output port + sc_signal_bool_vector6& out_value3; // Output port + sc_signal_bool_vector7& out_value4; // Output port + sc_signal_bool_vector8& out_value5; // Output port + sc_signal<bool>& out_valid; // Output port + + // + // Constructor + // + + sharing ( + sc_module_name NAME, // referense name + sc_clock& CLK, // clock + const sc_signal<bool>& RESET, + const sc_signal_bool_vector4& IN_VALUE1, + const sc_signal_bool_vector5& IN_VALUE2, + const sc_signal_bool_vector6& IN_VALUE3, + const sc_signal_bool_vector7& IN_VALUE4, + const sc_signal_bool_vector8& IN_VALUE5, + const sc_signal<bool>& IN_VALID, // Input port + sc_signal<bool>& OUT_ACK, + sc_signal_bool_vector4& OUT_VALUE1, + sc_signal_bool_vector5& OUT_VALUE2, + sc_signal_bool_vector6& OUT_VALUE3, + sc_signal_bool_vector7& OUT_VALUE4, + sc_signal_bool_vector8& OUT_VALUE5, + sc_signal<bool>& OUT_VALID // Output port + ) + : + reset (RESET), + in_value1 (IN_VALUE1), + in_value2 (IN_VALUE2), + in_value3 (IN_VALUE3), + in_value4 (IN_VALUE4), + in_value5 (IN_VALUE5), + in_valid (IN_VALID), + out_ack (OUT_ACK), + out_value1 (OUT_VALUE1), + out_value2 (OUT_VALUE2), + out_value3 (OUT_VALUE3), + out_value4 (OUT_VALUE4), + out_value5 (OUT_VALUE5), + 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/sharing/stimulus.cpp b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/stimulus.cpp new file mode 100644 index 000000000..4c05ea844 --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/stimulus.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. + + *****************************************************************************/ + +/***************************************************************************** + + 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); + + sc_signed tmp1(4); + sc_signed tmp2(5); + sc_signed tmp3(6); + sc_signed tmp4(7); + sc_signed tmp5(8); + + tmp1 = "0b0000"; + tmp2 = "0b00001"; + tmp3 = "0b000010"; + tmp4 = "0b0000011"; + tmp5 = "0b00000100"; + + while(true){ + out_valid.write(true); + out_value1.write(tmp1); + out_value2.write(tmp2); + out_value3.write(tmp3); + out_value4.write(tmp4); + out_value5.write(tmp5); + cout << "Stimuli: " << tmp1 << " " << tmp2 << " " << tmp3 << " " << tmp4 << " " << tmp5 << endl; + tmp1 = tmp1 + 1; + tmp2 = tmp2 + 1; + tmp3 = tmp3 + 1; + tmp4 = tmp4 + 1; + tmp5 = tmp5 + 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/sharing/stimulus.h b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/stimulus.h new file mode 100644 index 000000000..9a8f62092 --- /dev/null +++ b/src/systemc/tests/systemc/misc/cae_test/general/arith/subtract/sharing/stimulus.h @@ -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. + + *****************************************************************************/ + +/***************************************************************************** + + 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_bool_vector4& out_value1; // Output port + sc_signal_bool_vector5& out_value2; // Output port + sc_signal_bool_vector6& out_value3; // Output port + sc_signal_bool_vector7& out_value4; // Output port + sc_signal_bool_vector8& out_value5; // 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_bool_vector4& OUT_VALUE1, + sc_signal_bool_vector5& OUT_VALUE2, + sc_signal_bool_vector6& OUT_VALUE3, + sc_signal_bool_vector7& OUT_VALUE4, + sc_signal_bool_vector8& OUT_VALUE5, + sc_signal<bool>& OUT_VALID, + const sc_signal<bool>& IN_ACK + ) + : + reset (RESET), + out_value1 (OUT_VALUE1), + out_value2 (OUT_VALUE2), + out_value3 (OUT_VALUE3), + out_value4 (OUT_VALUE4), + out_value5 (OUT_VALUE5), + out_valid (OUT_VALID), + in_ack (IN_ACK) + { + clk (CLK); + SC_CTHREAD( entry, clk.pos() ); + }; + void entry(); +}; +// EOF |