diff options
Diffstat (limited to 'src/systemc/tests/systemc/misc/user_guide/chpt4.4')
32 files changed, 1759 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/chpt4.4.f b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/chpt4.4.f new file mode 100644 index 000000000..319f4cc1d --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/chpt4.4.f @@ -0,0 +1,7 @@ +chpt4.4/display.cpp +chpt4.4/main.cpp +chpt4.4/numgen.cpp +chpt4.4/pipeline.cpp +chpt4.4/stage1.cpp +chpt4.4/stage2.cpp +chpt4.4/stage3.cpp diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/display.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/display.cpp new file mode 100644 index 000000000..ae725e8b2 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/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: 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: + + *****************************************************************************/ + +/* Filename display.cc */ +/* This is the implementation file for synchronous process `display' */ + +#include "display.h" + +void display::entry() +{ + while (true) { + char buf[BUFSIZ]; + sprintf( buf, "Result = %.16g", in.read() ); + cout << buf << endl; + wait(); + } +} // end of entry function + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/display.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/display.h new file mode 100644 index 000000000..176856285 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/display.h @@ -0,0 +1,65 @@ +/***************************************************************************** + + 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: 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: + + *****************************************************************************/ + +/* Filename display.h */ +/* This is the interface file for synchronous process `display' */ + +#include "systemc.h" + +SC_MODULE( display ) +{ + SC_HAS_PROCESS( display ); + + sc_in_clk clk; + + const sc_signal<double>& in; //input + + //Constructor + display(sc_module_name NAME, + sc_clock& CLK, + const sc_signal<double>& IN_) + : in(IN_) + { + clk(CLK); + SC_CTHREAD( entry, clk.pos() ); + } + + // Process functionality in member function below + void entry(); +}; + + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_pipeline.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_pipeline.h new file mode 100644 index 000000000..38b7534f4 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_pipeline.h @@ -0,0 +1,46 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + f_pipeline.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: + + *****************************************************************************/ + +/* Filename f_pipeline.h */ +/* This is the functional interface file for module `pipeline' */ + +void f_pipeline(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& IN1, + const sc_signal<double>& IN2, + sc_signal<double>& OUT); + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage1.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage1.h new file mode 100644 index 000000000..0120bdbd0 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage1.h @@ -0,0 +1,46 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + f_stage1.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: + + *****************************************************************************/ + +/* Filename f_stage1.h */ +/* This is the functional interface file for synchronous process `stage1' */ + +void f_stage1(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& IN1, + const sc_signal<double>& IN2, + sc_signal<double>& SUM, + sc_signal<double>& DIFF); diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage2.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage2.h new file mode 100644 index 000000000..08eaa6529 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage2.h @@ -0,0 +1,46 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + f_stage2.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: + + *****************************************************************************/ + +/* Filename f_stage2.h */ +/* This is the functional interface file for synchronous process `stage2' */ + +void f_stage2(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& SUM, + const sc_signal<double>& DIFF, + sc_signal<double>& PROD, + sc_signal<double>& QUOT); diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage3.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage3.h new file mode 100644 index 000000000..6532f99ff --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/f_stage3.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. + + *****************************************************************************/ + +/***************************************************************************** + + f_stage3.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: + + *****************************************************************************/ + +/* Filename f_stage3.h */ +/* This is the functional interface file for synchronous process `stage3' */ + +void f_stage3(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& PROD, + const sc_signal<double>& QUOT, + sc_signal<double>& POWR); diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log new file mode 100644 index 000000000..2632f0378 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+23 +Result = 5.025308156461862e+22 +Result = 3.785504588212786e+21 +Result = 3.318767046037861e+20 +Result = 3.342044498889812e+19 +Result = 3.820952118187878e+18 +Result = 4.9085880406986e+17 +Result = 7.02026270784911e+16 +Result = 1.108584445158003e+16 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.20253819449 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463808 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.bsd b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.bsd new file mode 100644 index 000000000..be6a13764 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.bsd @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+23 +Result = 5.025308156461862e+22 +Result = 3.785504588212786e+21 +Result = 3.318767046037861e+20 +Result = 3.342044498889812e+19 +Result = 3.820952118187878e+18 +Result = 4.9085880406986e+17 +Result = 7.02026270784911e+16 +Result = 1.108584445158003e+16 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812002 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803264 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037049 +Result = 26676.20253819449 +Result = 13603.01933915479 +Result = 7091.170580193586 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463808 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285792 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.bsd64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.bsd64 new file mode 100644 index 000000000..be6a13764 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.bsd64 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+23 +Result = 5.025308156461862e+22 +Result = 3.785504588212786e+21 +Result = 3.318767046037861e+20 +Result = 3.342044498889812e+19 +Result = 3.820952118187878e+18 +Result = 4.9085880406986e+17 +Result = 7.02026270784911e+16 +Result = 1.108584445158003e+16 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812002 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803264 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037049 +Result = 26676.20253819449 +Result = 13603.01933915479 +Result = 7091.170580193586 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463808 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285792 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.cygwin64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.cygwin64 new file mode 100644 index 000000000..be6a13764 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.cygwin64 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+23 +Result = 5.025308156461862e+22 +Result = 3.785504588212786e+21 +Result = 3.318767046037861e+20 +Result = 3.342044498889812e+19 +Result = 3.820952118187878e+18 +Result = 4.9085880406986e+17 +Result = 7.02026270784911e+16 +Result = 1.108584445158003e+16 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812002 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803264 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037049 +Result = 26676.20253819449 +Result = 13603.01933915479 +Result = 7091.170580193586 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463808 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285792 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.mingw b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.mingw new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.mingw @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+023 +Result = 5.025308156461862e+022 +Result = 3.785504588212786e+021 +Result = 3.318767046037861e+020 +Result = 3.342044498889812e+019 +Result = 3.820952118187878e+018 +Result = 4.9085880406986e+017 +Result = 7.02026270784911e+016 +Result = 1.108584445158003e+016 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.2025381945 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463809 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.mingw64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.mingw64 new file mode 100644 index 000000000..cbad61984 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.mingw64 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111162 +Result = 7.880663294494538e+023 +Result = 5.025308156461848e+022 +Result = 3.785504588212779e+021 +Result = 3.318767046037847e+020 +Result = 3.342044498889828e+019 +Result = 3.820952118187873e+018 +Result = 4.908588040698598e+017 +Result = 7.020262707849121e+016 +Result = 1.108584445158e+016 +Result = 1918564708588396 +Result = 361468937900785.8 +Result = 73693454684249.83 +Result = 16168706434671.58 +Result = 3798873238107.02 +Result = 951496336681.9108 +Result = 253014396064.4429 +Result = 71160144395.97923 +Result = 21095409040.56878 +Result = 6570959918.81201 +Result = 2144377535.813799 +Result = 731219410.5057683 +Result = 259897217.2803262 +Result = 96068017.3665321 +Result = 36852754.87464552 +Result = 14643125.53882816 +Result = 6015770.001652751 +Result = 2551056.2523366 +Result = 1114936.454099942 +Result = 501486.5582467155 +Result = 231829.9907002871 +Result = 110013.0011393046 +Result = 53528.29122037047 +Result = 26676.20253819451 +Result = 13603.0193391548 +Result = 7091.170580193591 +Result = 3775.739764121695 +Result = 2051.852446275869 +Result = 1137.197386657551 +Result = 642.367482946381 +Result = 369.5965461434236 +Result = 216.4882041213385 +Result = 129.0313860266489 +Result = 78.22278438714326 +Result = 48.21719670307594 +Result = 30.2128638146017 +Result = 19.24141599285792 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc10 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc10 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc10 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+023 +Result = 5.025308156461862e+022 +Result = 3.785504588212786e+021 +Result = 3.318767046037861e+020 +Result = 3.342044498889812e+019 +Result = 3.820952118187878e+018 +Result = 4.9085880406986e+017 +Result = 7.02026270784911e+016 +Result = 1.108584445158003e+016 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.2025381945 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463809 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc10-x64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc10-x64 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc10-x64 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+023 +Result = 5.025308156461862e+022 +Result = 3.785504588212786e+021 +Result = 3.318767046037861e+020 +Result = 3.342044498889812e+019 +Result = 3.820952118187878e+018 +Result = 4.9085880406986e+017 +Result = 7.02026270784911e+016 +Result = 1.108584445158003e+016 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.2025381945 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463809 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc11 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc11 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc11 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+023 +Result = 5.025308156461862e+022 +Result = 3.785504588212786e+021 +Result = 3.318767046037861e+020 +Result = 3.342044498889812e+019 +Result = 3.820952118187878e+018 +Result = 4.9085880406986e+017 +Result = 7.02026270784911e+016 +Result = 1.108584445158003e+016 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.2025381945 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463809 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc11-x64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc11-x64 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc11-x64 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+023 +Result = 5.025308156461862e+022 +Result = 3.785504588212786e+021 +Result = 3.318767046037861e+020 +Result = 3.342044498889812e+019 +Result = 3.820952118187878e+018 +Result = 4.9085880406986e+017 +Result = 7.02026270784911e+016 +Result = 1.108584445158003e+016 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.2025381945 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463809 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc12 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc12 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc12 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+023 +Result = 5.025308156461862e+022 +Result = 3.785504588212786e+021 +Result = 3.318767046037861e+020 +Result = 3.342044498889812e+019 +Result = 3.820952118187878e+018 +Result = 4.9085880406986e+017 +Result = 7.02026270784911e+016 +Result = 1.108584445158003e+016 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.2025381945 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463809 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc12-x64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc12-x64 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/golden/chpt4.4.log.msvc12-x64 @@ -0,0 +1,51 @@ +SystemC Simulation +Result = 0 +Result = 3200000 +Result = 100000000 +Result = 19500.78584111161 +Result = 7.880663294494549e+023 +Result = 5.025308156461862e+022 +Result = 3.785504588212786e+021 +Result = 3.318767046037861e+020 +Result = 3.342044498889812e+019 +Result = 3.820952118187878e+018 +Result = 4.9085880406986e+017 +Result = 7.02026270784911e+016 +Result = 1.108584445158003e+016 +Result = 1918564708588393 +Result = 361468937900785.4 +Result = 73693454684249.92 +Result = 16168706434671.58 +Result = 3798873238107.018 +Result = 951496336681.913 +Result = 253014396064.4423 +Result = 71160144395.97931 +Result = 21095409040.5688 +Result = 6570959918.812003 +Result = 2144377535.8138 +Result = 731219410.5057685 +Result = 259897217.2803263 +Result = 96068017.36653221 +Result = 36852754.87464556 +Result = 14643125.53882816 +Result = 6015770.001652755 +Result = 2551056.252336602 +Result = 1114936.454099941 +Result = 501486.5582467156 +Result = 231829.9907002873 +Result = 110013.0011393045 +Result = 53528.29122037048 +Result = 26676.2025381945 +Result = 13603.01933915479 +Result = 7091.170580193587 +Result = 3775.739764121693 +Result = 2051.852446275868 +Result = 1137.19738665755 +Result = 642.3674829463809 +Result = 369.5965461434234 +Result = 216.4882041213384 +Result = 129.0313860266488 +Result = 78.22278438714326 +Result = 48.21719670307593 +Result = 30.2128638146017 +Result = 19.24141599285791 diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/main.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/main.cpp new file mode 100644 index 000000000..9af44ba3e --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/main.cpp @@ -0,0 +1,63 @@ +/***************************************************************************** + + 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: 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: + + *****************************************************************************/ + +/* Main file for pipeline simulation */ + +#include "display.h" +#include "numgen.h" +#include "testbench.h" +#include "f_pipeline.h" + +int sc_main(int ac, char* av[]) +{ + sc_signal<double> in1; + sc_signal<double> in2; + sc_signal<double> powr; + + in1 = 0.0; + in2 = 0.0; + powr = 0.0; + + sc_clock clk("CLOCK", 20.0, SC_NS, 0.5, 0.0, SC_NS); + + testbench T("Testbench", clk, powr, in1, in2); + f_pipeline("PIPE", clk, in1, in2, powr); + + sc_start(1000, SC_NS); + return 0; +} + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/numgen.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/numgen.cpp new file mode 100644 index 000000000..77887df1a --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/numgen.cpp @@ -0,0 +1,56 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + numgen.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: + + *****************************************************************************/ + +/* Filename numgen.cc */ +/* This is the implementation file for synchronous process `numgen' */ + +#include "numgen.h" + +void numgen::entry() +{ + double a = 134.56; + double b = 98.24; + + while (true) { + a -= 1.5; + b -= 2.8; + out1.write(a); + out2.write(b); + wait(); + } +} // end of entry function + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/numgen.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/numgen.h new file mode 100644 index 000000000..c56670c86 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/numgen.h @@ -0,0 +1,67 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + numgen.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: + + *****************************************************************************/ + +/* Filename numgen.h */ +/* This is the interface file for synchronous process `numgen' */ + +#include "systemc.h" + +SC_MODULE( numgen ) +{ + SC_HAS_PROCESS( numgen ); + + sc_in_clk clk; + + sc_signal<double>& out1; //output + sc_signal<double>& out2; //output + + //Constructor + numgen(sc_module_name NAME, + sc_clock& CLK, + sc_signal<double>& OUT1, + sc_signal<double>& OUT2) + : out1(OUT1), out2(OUT2) + { + clk(CLK); + SC_CTHREAD( entry, clk.pos() ); + } + + // Process functionality in member function below + void entry(); +}; + + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/pipeline.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/pipeline.cpp new file mode 100644 index 000000000..a1a9a903c --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/pipeline.cpp @@ -0,0 +1,56 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + pipeline.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: + + *****************************************************************************/ + +/* Filename pipeline.cc */ +/* This is the implementation file for module `pipeline' */ + +#include "systemc.h" +#include "f_stage1.h" +#include "f_stage2.h" +#include "stage1_2.h" +#include "f_stage3.h" +#include "pipeline.h" +#include "f_pipeline.h" + +void f_pipeline(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& IN1, + const sc_signal<double>& IN2, + sc_signal<double>& OUT_) +{ + SC_NEW(pipeline(NAME, CLK, IN1, IN2, OUT_)); +} diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/pipeline.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/pipeline.h new file mode 100644 index 000000000..e328f5ac5 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/pipeline.h @@ -0,0 +1,62 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + pipeline.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: + + *****************************************************************************/ + +/* Filename pipeline.h */ +/* This is the interface file for module `pipeline' */ + +#include "systemc.h" + +struct pipeline : public sc_module { + sc_signal<double> prod; + sc_signal<double> quot; + + stage1_2 S1_2; // component + + //Constructor + pipeline(sc_module_name NAME, + sc_clock& CLK, + const sc_signal<double>& IN1, + const sc_signal<double>& IN2, + sc_signal<double>& OUT_) + : sc_module(NAME), + S1_2("Stage1_2", CLK, IN1, IN2, prod, quot) + { + f_stage3("Stage3", CLK, prod, quot, OUT_); + } +}; + + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1.cpp new file mode 100644 index 000000000..f09af1ef3 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1.cpp @@ -0,0 +1,67 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + stage1.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: + + *****************************************************************************/ + +/* Filename stage1.cc */ +/* This is the implementation file for synchronous process `stage1' */ + +#include "stage1.h" +#include "f_stage1.h" + +void stage1::entry() +{ + double a, b; + + a = 20.0; + b = 5.0; + while (true) { + sum.write(a+b); + diff.write(a-b); + wait(); + a = in1.read(); + b = in2.read(); + } +} // end of entry function + +void f_stage1(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& IN1, + const sc_signal<double>& IN2, + sc_signal<double>& SUM, + sc_signal<double>& DIFF) +{ + SC_NEW(stage1(NAME, CLK, IN1, IN2, SUM, DIFF)); +} diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1.h new file mode 100644 index 000000000..5f5cc8044 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1.h @@ -0,0 +1,71 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + stage1.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: + + *****************************************************************************/ + +/* Filename stage1.h */ +/* This is the interface file for synchronous process `stage1' */ + +#include "systemc.h" + +SC_MODULE( stage1 ) +{ + SC_HAS_PROCESS( stage1 ); + + sc_in_clk clk; + + const sc_signal<double>& in1; //input + const sc_signal<double>& in2; //input + sc_signal<double>& sum; //output + sc_signal<double>& diff; //output + + //Constructor + stage1(sc_module_name NAME, + sc_clock& CLK, + const sc_signal<double>& IN1, + const sc_signal<double>& IN2, + sc_signal<double>& SUM, + sc_signal<double>& DIFF) + : in1(IN1), in2(IN2), sum(SUM), diff(DIFF) + { + clk(CLK); + SC_CTHREAD( entry, clk.pos() ); + } + + // Process functionality in member function below + void entry(); +}; + + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1_2.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1_2.h new file mode 100644 index 000000000..166cc0be6 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1_2.h @@ -0,0 +1,61 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + stage1_2.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: + + *****************************************************************************/ + +/* Filename stage1_2.h */ +/* This is the interface file for module `stage1_2' */ + +#include "systemc.h" + +struct stage1_2 : public sc_module { + sc_signal<double> sum; // internal signal + sc_signal<double> diff; // internal signal + + //Constructor + stage1_2(sc_module_name NAME, + sc_clock& TICK, + const sc_signal<double>& IN1, + const sc_signal<double>& IN2, + sc_signal<double>& PROD, + sc_signal<double>& QUOT) + : sc_module(NAME) + { + f_stage1("Stage1", TICK, IN1, IN2, sum, diff); + f_stage2("Stage2", TICK, sum, diff, PROD, QUOT); + } +}; + + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage2.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage2.cpp new file mode 100644 index 000000000..9d3128b15 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage2.cpp @@ -0,0 +1,67 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + stage2.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: + + *****************************************************************************/ + +/* Filename stage2.cc */ +/* This is the implementation file for synchronous process `stage2' */ + +#include "stage2.h" +#include "f_stage2.h" + +void stage2::entry() +{ + double a, b; + + a = 20.0; + b = 5.0; + while (true) { + prod.write(a*b); + quot.write(a/b); + wait(); + a = sum.read(); + b = diff.read(); + } +} // end of entry function + +void f_stage2(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& SUM, + const sc_signal<double>& DIFF, + sc_signal<double>& PROD, + sc_signal<double>& QUOT) +{ + SC_NEW(stage2(NAME, CLK, SUM, DIFF, PROD, QUOT)); +} diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage2.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage2.h new file mode 100644 index 000000000..5e8e788d1 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage2.h @@ -0,0 +1,71 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + stage2.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: + + *****************************************************************************/ + +/* Filename stage2.h */ +/* This is the interface file for synchronous process `stage2' */ + +#include "systemc.h" + +SC_MODULE( stage2 ) +{ + SC_HAS_PROCESS( stage2 ); + + sc_in_clk clk; + + const sc_signal<double>& sum; //input + const sc_signal<double>& diff; //input + sc_signal<double>& prod; //output + sc_signal<double>& quot; //output + + //Constructor + stage2(sc_module_name NAME, + sc_clock& CLK, + const sc_signal<double>& SUM, + const sc_signal<double>& DIFF, + sc_signal<double>& PROD, + sc_signal<double>& QUOT) + : sum(SUM), diff(DIFF), prod(PROD), quot(QUOT) + { + clk(CLK); + SC_CTHREAD( entry, clk.pos() ); + } + + // Process functionality in member function below + void entry(); +}; + + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage3.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage3.cpp new file mode 100644 index 000000000..1a7c47489 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage3.cpp @@ -0,0 +1,70 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + stage3.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: + + *****************************************************************************/ + +/* Filename stage3.cc */ +/* This is the implementation file for synchronous process `stage3' */ + +#include <math.h> +#include "stage3.h" +#include "f_stage3.h" + +void stage3::entry() +{ + double a, b; + double c; + + a = 20.0; + b = 5.0; + while (true) { + c = pow(a, b); + powr.write(c); + wait(); + a = prod.read(); + b = quot.read(); + } +} // end of entry function + + +void f_stage3(const char *NAME, + sc_clock& CLK, + const sc_signal<double>& PROD, + const sc_signal<double>& QUOT, + sc_signal<double>& POWR) +{ + SC_NEW(stage3(NAME, CLK, PROD, QUOT, POWR)); +} + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage3.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage3.h new file mode 100644 index 000000000..60bb8caad --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage3.h @@ -0,0 +1,69 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + stage3.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: + + *****************************************************************************/ + +/* Filename stage3.h */ +/* This is the interface file for synchronous process `stage3' */ + +#include "systemc.h" + +SC_MODULE( stage3 ) +{ + SC_HAS_PROCESS( stage3 ); + + sc_in_clk clk; + + const sc_signal<double>& prod; //input + const sc_signal<double>& quot; //input + sc_signal<double>& powr; //output + + //Constructor + stage3(sc_module_name NAME, + sc_clock& CLK, + const sc_signal<double>& PROD, + const sc_signal<double>& QUOT, + sc_signal<double>& POWR) + : prod(PROD), quot(QUOT), powr(POWR) + { + clk(CLK); + SC_CTHREAD( entry, clk.pos() ); + } + + // Process functionality in member function below + void entry(); +}; + + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.4/testbench.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/testbench.h new file mode 100644 index 000000000..128433c2a --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.4/testbench.h @@ -0,0 +1,60 @@ +/***************************************************************************** + + 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. + + *****************************************************************************/ + +/***************************************************************************** + + testbench.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: + + *****************************************************************************/ + +/* Filename testbench.h */ +/* This is the interface file for module `testbench' */ + +#include "systemc.h" + +struct testbench : public sc_module { + numgen N; // component + display D; // component + + //Constructor + testbench(sc_module_name NAME, + sc_clock& CLK, + const sc_signal<double>& IN_, + sc_signal<double>& OUT1, + sc_signal<double>& OUT2) + : sc_module(NAME), + N("Numgen", CLK, OUT1, OUT2), + D("Display", CLK, IN_) + { + } +}; + + |