diff options
author | Gabe Black <gabeblack@google.com> | 2018-05-24 01:37:55 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-08-08 10:09:54 +0000 |
commit | 16fa8d7cc8c92f5ab879e4cf9c6c0bbb3567860f (patch) | |
tree | 7b6faaacb4574a555e561534aa4a8508c0624c32 /src/systemc/tests/systemc/misc/user_guide/chpt4.1 | |
parent | 7235d3b5211d0ba8f528d930a4c1e7ad62eec51a (diff) | |
download | gem5-16fa8d7cc8c92f5ab879e4cf9c6c0bbb3567860f.tar.xz |
systemc: Import tests from the Accellera systemc distribution.
Change-Id: Iad76b398949a55d768a34d027a2d8e3739953da6
Reviewed-on: https://gem5-review.googlesource.com/10845
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/tests/systemc/misc/user_guide/chpt4.1')
24 files changed, 1310 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.1/chpt4.1.f b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/chpt4.1.f new file mode 100644 index 000000000..e0ed6002a --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/chpt4.1.f @@ -0,0 +1,6 @@ +chpt4.1/display.cpp +chpt4.1/main.cpp +chpt4.1/numgen.cpp +chpt4.1/stage1.cpp +chpt4.1/stage2.cpp +chpt4.1/stage3.cpp diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.1/display.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/display.cpp new file mode 100644 index 000000000..ae725e8b2 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/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.1/display.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/display.h new file mode 100644 index 000000000..176856285 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/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.1/golden/chpt4.1.log b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log new file mode 100644 index 000000000..2632f0378 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.bsd b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.bsd new file mode 100644 index 000000000..be6a13764 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.bsd64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.bsd64 new file mode 100644 index 000000000..be6a13764 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.cygwin64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.cygwin64 new file mode 100644 index 000000000..be6a13764 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.mingw b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.mingw new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.mingw64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.mingw64 new file mode 100644 index 000000000..cbad61984 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.msvc10 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.msvc10 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.msvc10-x64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.msvc10-x64 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.msvc11 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.msvc11 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.msvc11-x64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.msvc11-x64 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.msvc12 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.msvc12 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/golden/chpt4.1.log.msvc12-x64 b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.log.msvc12-x64 new file mode 100644 index 000000000..59ff54c34 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/golden/chpt4.1.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.1/main.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/main.cpp new file mode 100644 index 000000000..d9b80752d --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/main.cpp @@ -0,0 +1,68 @@ +/***************************************************************************** + + 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 "stage1.h" +#include "stage2.h" +#include "stage3.h" +#include "display.h" +#include "numgen.h" + +int sc_main(int ac, char *av[]) +{ + sc_signal<double> in1; + sc_signal<double> in2; + sc_signal<double> sum; + sc_signal<double> diff; + sc_signal<double> prod; + sc_signal<double> quot; + sc_signal<double> powr; + powr = 0.0; + + sc_clock clk("CLOCK", 20.0, SC_NS, 0.5, 0.0, SC_NS); + + numgen N("STIMULUS", clk, in1, in2); + stage1 S1("Stage1", clk, in1, in2, sum, diff); + stage2 S2("Stage2", clk, sum, diff, prod, quot); + stage3 S3("Stage3", clk, prod, quot, powr); + display D("Display", clk, powr); + + sc_start(1000, SC_NS); + return 0; +} + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.1/numgen.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/numgen.cpp new file mode 100644 index 000000000..77887df1a --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/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.1/numgen.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/numgen.h new file mode 100644 index 000000000..c56670c86 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/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.1/stage1.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage1.cpp new file mode 100644 index 000000000..58a59f7ab --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage1.cpp @@ -0,0 +1,57 @@ +/***************************************************************************** + + 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" + +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 + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage1.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage1.h new file mode 100644 index 000000000..5f5cc8044 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/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.1/stage2.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage2.cpp new file mode 100644 index 000000000..7a80f1f50 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage2.cpp @@ -0,0 +1,57 @@ +/***************************************************************************** + + 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" + +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 + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage2.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage2.h new file mode 100644 index 000000000..5e8e788d1 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/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.1/stage3.cpp b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage3.cpp new file mode 100644 index 000000000..2cdb4f519 --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage3.cpp @@ -0,0 +1,59 @@ +/***************************************************************************** + + 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" + +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 + diff --git a/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage3.h b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage3.h new file mode 100644 index 000000000..60bb8caad --- /dev/null +++ b/src/systemc/tests/systemc/misc/user_guide/chpt4.1/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(); +}; + + |