SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_bv.h
Go to the documentation of this file.
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  sc_bv.h -- Arbitrary size bit vector class.
23 */
32 /*****************************************************************************
33 
34  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
35  changes you are making here.
36 
37  Name, Affiliation, Date:
38  Description of Modification:
39 
40  *****************************************************************************/
41 
42 // $Log: sc_bv.h,v $
43 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
44 // SystemC 2.3
45 //
46 // Revision 1.3 2006/01/13 18:53:53 acg
47 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
48 // the source.
49 //
50 
51 #ifndef SC_BV_H
52 #define SC_BV_H
53 
54 
56 
57 
58 namespace sc_dt
59 {
60 
61 // classes defined in this module
62 template <int W> class sc_bv;
63 
64 
71 template <int W>
72 class sc_bv
73  : public sc_bv_base
74 {
75 public:
76 
77  // constructors
78 
80  :sc_bv_base( W )
81  {}
82 
83  explicit sc_bv( bool init_value )
84  : sc_bv_base( init_value, W )
85  {}
86 
87  explicit sc_bv( char init_value )
88  : sc_bv_base( (init_value != '0'), W )
89  {}
90 
91  sc_bv( const char* a )
92  : sc_bv_base( W )
93  { sc_bv_base::operator = ( a ); }
94 
95  sc_bv( const bool* a )
96  : sc_bv_base( W )
97  { sc_bv_base::operator = ( a ); }
98 
99  sc_bv( const sc_logic* a )
100  : sc_bv_base( W )
101  { sc_bv_base::operator = ( a ); }
102 
103  sc_bv( const sc_unsigned& a )
104  : sc_bv_base( W )
105  { sc_bv_base::operator = ( a ); }
106 
107  sc_bv( const sc_signed& a )
108  : sc_bv_base( W )
109  { sc_bv_base::operator = ( a ); }
110 
111  sc_bv( const sc_uint_base& a )
112  : sc_bv_base( W )
113  { sc_bv_base::operator = ( a ); }
114 
115  sc_bv( const sc_int_base& a )
116  : sc_bv_base( W )
117  { sc_bv_base::operator = ( a ); }
118 
119  sc_bv( unsigned long a )
120  : sc_bv_base( W )
121  { sc_bv_base::operator = ( a ); }
122 
123  sc_bv( long a )
124  : sc_bv_base( W )
125  { sc_bv_base::operator = ( a ); }
126 
127  sc_bv( unsigned int a )
128  : sc_bv_base( W )
129  { sc_bv_base::operator = ( a ); }
130 
131  sc_bv( int a )
132  : sc_bv_base( W )
133  { sc_bv_base::operator = ( a ); }
134 
136  : sc_bv_base( W )
137  { sc_bv_base::operator = ( a ); }
138 
140  : sc_bv_base( W )
141  { sc_bv_base::operator = ( a ); }
142 
143  template <class X>
144  sc_bv( const sc_proxy<X>& a )
145  : sc_bv_base( W )
146  { sc_bv_base::operator = ( a ); }
147 
148  sc_bv( const sc_bv<W>& a )
149  : sc_bv_base( a )
150  {}
151 
152 
153  // assignment operators
154 
155  template <class X>
157  { sc_bv_base::operator = ( a ); return *this; }
158 
160  { sc_bv_base::operator = ( a ); return *this; }
161 
162  sc_bv<W>& operator = ( const char* a )
163  { sc_bv_base::operator = ( a ); return *this; }
164 
165  sc_bv<W>& operator = ( const bool* a )
166  { sc_bv_base::operator = ( a ); return *this; }
167 
169  { sc_bv_base::operator = ( a ); return *this; }
170 
172  { sc_bv_base::operator = ( a ); return *this; }
173 
175  { sc_bv_base::operator = ( a ); return *this; }
176 
178  { sc_bv_base::operator = ( a ); return *this; }
179 
181  { sc_bv_base::operator = ( a ); return *this; }
182 
183  sc_bv<W>& operator = ( unsigned long a )
184  { sc_bv_base::operator = ( a ); return *this; }
185 
187  { sc_bv_base::operator = ( a ); return *this; }
188 
189  sc_bv<W>& operator = ( unsigned int a )
190  { sc_bv_base::operator = ( a ); return *this; }
191 
193  { sc_bv_base::operator = ( a ); return *this; }
194 
196  { sc_bv_base::operator = ( a ); return *this; }
197 
199  { sc_bv_base::operator = ( a ); return *this; }
200 };
201 
202 } // namespace sc_dt
203 
204 
205 #endif
sc_bv(const sc_signed &a)
Definition: sc_bv.h:107
sc_bv(bool init_value)
Definition: sc_bv.h:83
sc_bv(int64 a)
Definition: sc_bv.h:139
sc_bv(int a)
Definition: sc_bv.h:131
sc_bv(const sc_bv< W > &a)
Definition: sc_bv.h:148
int64_t int64
Definition: sc_nbdefs.h:188
Base class for sc_uint.
Definition: sc_uint_base.h:534
Arbitrary precision signed number.
Definition: sc_signed.h:1099
sc_bv(unsigned int a)
Definition: sc_bv.h:127
Base class template for bit/logic vector classes.
Definition: sc_proxy.h:84
uint64_t uint64
Definition: sc_nbdefs.h:189
Arbitrary precision unsigned number.
Definition: sc_unsigned.h:1001
sc_bv(const sc_unsigned &a)
Definition: sc_bv.h:103
Four-valued logic type.
Definition: sc_logic.h:104
sc_bv(long a)
Definition: sc_bv.h:123
Arbitrary size bit vector class.
Definition: sc_bv.h:62
sc_bv(unsigned long a)
Definition: sc_bv.h:119
Base class for sc_int.
Definition: sc_int_base.h:548
sc_bv(const sc_uint_base &a)
Definition: sc_bv.h:111
sc_bv(const sc_logic *a)
Definition: sc_bv.h:99
Arbitrary size bit vector class.
sc_bv(const sc_int_base &a)
Definition: sc_bv.h:115
sc_bv(uint64 a)
Definition: sc_bv.h:135
sc_bv(char init_value)
Definition: sc_bv.h:87
sc_bv(const char *a)
Definition: sc_bv.h:91
sc_bv_base & operator=(const sc_proxy< X > &a)
Definition: sc_bv_base.h:150
sc_bv(const bool *a)
Definition: sc_bv.h:95
sc_bv< W > & operator=(const sc_proxy< X > &a)
Definition: sc_bv.h:156
sc_bv(const sc_proxy< X > &a)
Definition: sc_bv.h:144
Arbitrary size bit vector base class.
Definition: sc_bv_base.h:80