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/datatypes/int/from_bv_lv | |
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/datatypes/int/from_bv_lv')
6 files changed, 999 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test01/golden/test01.log b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test01/golden/test01.log new file mode 100644 index 000000000..9a94cc73c --- /dev/null +++ b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test01/golden/test01.log @@ -0,0 +1,61 @@ +SystemC Simulation +*** smaller *** +5 +10 +5 +10 + +5 +10 +5 +10 + +5 +10 +5 +10 + +5 +10 +5 +10 +*** equal *** +5 +-6 +5 +-6 + +5 +10 +5 +10 + +5 +-6 +5 +-6 + +5 +10 +5 +10 +*** larger *** +1 +-2 +1 +-2 + +1 +2 +1 +2 + +1 +-2 +1 +-2 + +1 +2 +1 +2 diff --git a/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test01/test01.cpp b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test01/test01.cpp new file mode 100644 index 000000000..362632fc4 --- /dev/null +++ b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test01/test01.cpp @@ -0,0 +1,224 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +/***************************************************************************** + + test01.cpp -- + + Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 + + *****************************************************************************/ + +/***************************************************************************** + + MODIFICATION LOG - modifiers, enter your name, affiliation, date and + changes you are making here. + + Name, Affiliation, Date: + Description of Modification: + + *****************************************************************************/ + +// test of assigning sc_bv_base to the integer types + +#include "systemc.h" + +void +test_smaller( const sc_bv<4>& bv_one, const sc_bv<4>& bv_two ) +{ + cout << "*** smaller ***" << endl; + { + sc_int<8> a( bv_one ); + sc_int<8> b( bv_two ); + sc_int<8> c; + sc_int<8> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<8> a( bv_one ); + sc_uint<8> b( bv_two ); + sc_uint<8> c; + sc_uint<8> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<8> a( bv_one ); + sc_bigint<8> b( bv_two ); + sc_bigint<8> c; + sc_bigint<8> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<8> a( bv_one ); + sc_biguint<8> b( bv_two ); + sc_biguint<8> c; + sc_biguint<8> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +void +test_equal( const sc_bv<4>& bv_one, const sc_bv<4>& bv_two ) +{ + cout << "*** equal ***" << endl; + { + sc_int<4> a( bv_one ); + sc_int<4> b( bv_two ); + sc_int<4> c; + sc_int<4> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<4> a( bv_one ); + sc_uint<4> b( bv_two ); + sc_uint<4> c; + sc_uint<4> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<4> a( bv_one ); + sc_bigint<4> b( bv_two ); + sc_bigint<4> c; + sc_bigint<4> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<4> a( bv_one ); + sc_biguint<4> b( bv_two ); + sc_biguint<4> c; + sc_biguint<4> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +void +test_larger( const sc_bv<4>& bv_one, const sc_bv<4>& bv_two ) +{ + cout << "*** larger ***" << endl; + { + sc_int<2> a( bv_one ); + sc_int<2> b( bv_two ); + sc_int<2> c; + sc_int<2> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<2> a( bv_one ); + sc_uint<2> b( bv_two ); + sc_uint<2> c; + sc_uint<2> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<2> a( bv_one ); + sc_bigint<2> b( bv_two ); + sc_bigint<2> c; + sc_bigint<2> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<2> a( bv_one ); + sc_biguint<2> b( bv_two ); + sc_biguint<2> c; + sc_biguint<2> d; + c = bv_one; + d = bv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +int +sc_main( int, char*[] ) +{ + sc_bv<4> bv_one( "0101" ); + sc_bv<4> bv_two( "1010" ); + + test_smaller( bv_one, bv_two ); + test_equal( bv_one, bv_two ); + test_larger( bv_one, bv_two ); + + return 0; +} diff --git a/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test02/golden/test02.log b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test02/golden/test02.log new file mode 100644 index 000000000..9a94cc73c --- /dev/null +++ b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test02/golden/test02.log @@ -0,0 +1,61 @@ +SystemC Simulation +*** smaller *** +5 +10 +5 +10 + +5 +10 +5 +10 + +5 +10 +5 +10 + +5 +10 +5 +10 +*** equal *** +5 +-6 +5 +-6 + +5 +10 +5 +10 + +5 +-6 +5 +-6 + +5 +10 +5 +10 +*** larger *** +1 +-2 +1 +-2 + +1 +2 +1 +2 + +1 +-2 +1 +-2 + +1 +2 +1 +2 diff --git a/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test02/test02.cpp b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test02/test02.cpp new file mode 100644 index 000000000..4b61e5793 --- /dev/null +++ b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test02/test02.cpp @@ -0,0 +1,224 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +/***************************************************************************** + + test02.cpp -- + + Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 + + *****************************************************************************/ + +/***************************************************************************** + + MODIFICATION LOG - modifiers, enter your name, affiliation, date and + changes you are making here. + + Name, Affiliation, Date: + Description of Modification: + + *****************************************************************************/ + +// test of assigning sc_lv_base to the integer types + +#include "systemc.h" + +void +test_smaller( const sc_lv<4>& lv_one, const sc_lv<4>& lv_two ) +{ + cout << "*** smaller ***" << endl; + { + sc_int<8> a( lv_one ); + sc_int<8> b( lv_two ); + sc_int<8> c; + sc_int<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<8> a( lv_one ); + sc_uint<8> b( lv_two ); + sc_uint<8> c; + sc_uint<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<8> a( lv_one ); + sc_bigint<8> b( lv_two ); + sc_bigint<8> c; + sc_bigint<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<8> a( lv_one ); + sc_biguint<8> b( lv_two ); + sc_biguint<8> c; + sc_biguint<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +void +test_equal( const sc_lv<4>& lv_one, const sc_lv<4>& lv_two ) +{ + cout << "*** equal ***" << endl; + { + sc_int<4> a( lv_one ); + sc_int<4> b( lv_two ); + sc_int<4> c; + sc_int<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<4> a( lv_one ); + sc_uint<4> b( lv_two ); + sc_uint<4> c; + sc_uint<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<4> a( lv_one ); + sc_bigint<4> b( lv_two ); + sc_bigint<4> c; + sc_bigint<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<4> a( lv_one ); + sc_biguint<4> b( lv_two ); + sc_biguint<4> c; + sc_biguint<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +void +test_larger( const sc_lv<4>& lv_one, const sc_lv<4>& lv_two ) +{ + cout << "*** larger ***" << endl; + { + sc_int<2> a( lv_one ); + sc_int<2> b( lv_two ); + sc_int<2> c; + sc_int<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<2> a( lv_one ); + sc_uint<2> b( lv_two ); + sc_uint<2> c; + sc_uint<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<2> a( lv_one ); + sc_bigint<2> b( lv_two ); + sc_bigint<2> c; + sc_bigint<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<2> a( lv_one ); + sc_biguint<2> b( lv_two ); + sc_biguint<2> c; + sc_biguint<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +int +sc_main( int, char*[] ) +{ + sc_lv<4> lv_one( "0101" ); + sc_lv<4> lv_two( "1010" ); + + test_smaller( lv_one, lv_two ); + test_equal( lv_one, lv_two ); + test_larger( lv_one, lv_two ); + + return 0; +} diff --git a/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test03/golden/test03.log b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test03/golden/test03.log new file mode 100644 index 000000000..2ecf45e97 --- /dev/null +++ b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test03/golden/test03.log @@ -0,0 +1,205 @@ +SystemC Simulation +*** smaller *** + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +10 +7 +10 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +10 +7 +10 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +10 +7 +10 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +10 +7 +10 +*** equal *** + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +-6 +7 +-6 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +10 +7 +10 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +-6 +7 +-6 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +7 +10 +7 +10 +*** larger *** + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +-1 +-2 +-1 +-2 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +3 +2 +3 +2 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +-1 +-2 +-1 +-2 + + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W212) sc_logic value 'X' cannot be converted to bool +In file: <removed by verify.pl> + +Warning: (W211) sc_logic value 'Z' cannot be converted to bool +In file: <removed by verify.pl> +3 +2 +3 +2 diff --git a/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test03/test03.cpp b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test03/test03.cpp new file mode 100644 index 000000000..d86284851 --- /dev/null +++ b/src/systemc/tests/systemc/datatypes/int/from_bv_lv/test03/test03.cpp @@ -0,0 +1,224 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +/***************************************************************************** + + test03.cpp -- + + Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 + + *****************************************************************************/ + +/***************************************************************************** + + MODIFICATION LOG - modifiers, enter your name, affiliation, date and + changes you are making here. + + Name, Affiliation, Date: + Description of Modification: + + *****************************************************************************/ + +// test of assigning sc_lv_base to the integer types + +#include "systemc.h" + +void +test_smaller( const sc_lv<4>& lv_one, const sc_lv<4>& lv_two ) +{ + cout << "*** smaller ***" << endl; + { + sc_int<8> a( lv_one ); + sc_int<8> b( lv_two ); + sc_int<8> c; + sc_int<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<8> a( lv_one ); + sc_uint<8> b( lv_two ); + sc_uint<8> c; + sc_uint<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<8> a( lv_one ); + sc_bigint<8> b( lv_two ); + sc_bigint<8> c; + sc_bigint<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<8> a( lv_one ); + sc_biguint<8> b( lv_two ); + sc_biguint<8> c; + sc_biguint<8> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +void +test_equal( const sc_lv<4>& lv_one, const sc_lv<4>& lv_two ) +{ + cout << "*** equal ***" << endl; + { + sc_int<4> a( lv_one ); + sc_int<4> b( lv_two ); + sc_int<4> c; + sc_int<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<4> a( lv_one ); + sc_uint<4> b( lv_two ); + sc_uint<4> c; + sc_uint<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<4> a( lv_one ); + sc_bigint<4> b( lv_two ); + sc_bigint<4> c; + sc_bigint<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<4> a( lv_one ); + sc_biguint<4> b( lv_two ); + sc_biguint<4> c; + sc_biguint<4> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +void +test_larger( const sc_lv<4>& lv_one, const sc_lv<4>& lv_two ) +{ + cout << "*** larger ***" << endl; + { + sc_int<2> a( lv_one ); + sc_int<2> b( lv_two ); + sc_int<2> c; + sc_int<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_uint<2> a( lv_one ); + sc_uint<2> b( lv_two ); + sc_uint<2> c; + sc_uint<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_bigint<2> a( lv_one ); + sc_bigint<2> b( lv_two ); + sc_bigint<2> c; + sc_bigint<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } + cout << endl; + { + sc_biguint<2> a( lv_one ); + sc_biguint<2> b( lv_two ); + sc_biguint<2> c; + sc_biguint<2> d; + c = lv_one; + d = lv_two; + cout << a << endl; + cout << b << endl; + cout << c << endl; + cout << d << endl; + } +} + +int +sc_main( int, char*[] ) +{ + sc_lv<4> lv_one( "01ZX" ); + sc_lv<4> lv_two( "1010" ); + + test_smaller( lv_one, lv_two ); + test_equal( lv_one, lv_two ); + test_larger( lv_one, lv_two ); + + return 0; +} |