T_2_5_1_1.cpp revision 12855:588919e0e4aa
1/***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 15 implied. See the License for the specific language governing 16 permissions and limitations under the License. 17 18 *****************************************************************************/ 19 20/***************************************************************************** 21 22 T_2_5_1_1.cpp -- 23 24 Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 25 26 *****************************************************************************/ 27 28/***************************************************************************** 29 30 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 31 changes you are making here. 32 33 Name, Affiliation, Date: 34 Description of Modification: 35 36 *****************************************************************************/ 37 38#include "systemc.h" 39 40#define MYNAME T_2_5_1_1 41 42const int WIDTH = 13; 43typedef sc_bv<WIDTH> my_vector; 44typedef sc_signal<my_vector> signal_vector; 45 46#include "T_2_5.h" 47 48sc_signed 49foobar1( const sc_signed& a, 50 sc_signed const& b ) 51{ 52 return a + b; 53} 54 55sc_unsigned 56foobar2( const sc_unsigned& a, 57 sc_unsigned const& b ) 58{ 59 return a + b; 60} 61 62sc_bv_base 63foobar3( const sc_bv_base& a, 64 sc_bv_base const& b ) 65{ 66 return a | b; 67} 68 69sc_lv_base 70foobar4( const sc_lv_base& a, 71 sc_lv_base const& b ) 72{ 73 return a & b; 74} 75 76void 77MYNAME::entry() 78{ 79 my_vector a; 80 my_vector b; 81 sc_biguint<WIDTH> c, d; 82 sc_biguint<WIDTH*2> e; 83 84 a = x; 85 b = y; 86 c = a; 87 c += d; 88 z = a | b; 89 wait(); 90 a = x.read() | y.read(); 91 b = x.read() ^ y.read(); 92 c = b; 93 c = c - d; 94 z = a & b; 95 wait(); 96 a = x.read() & y.read(); 97 b = x.read() | y.read(); 98 z = a ^ b; 99 c = a; 100 c = c * d; 101 wait(); 102 a = ~ x.read(); 103 b = ~ y.read(); 104 c = b; 105 e = c * d; 106 z = a | b; 107 wait(); 108 109 a1 = x.read().to_int(); 110 a2 = a1 + a1; 111 b1 = y.read().to_uint(); 112 b2 = b1 + b1; 113 c1 = x; 114 c2 = (c1, "00"); 115 d1 = y.read(); 116 d2 = ("00", d1); 117 wait(); 118} 119 120int sc_main(int argc, char* argv[] ) 121{ 122 return 0; 123} 124