SystemC 3.0.0
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
24 Original Author: Gene Bushuyev, Synopsys, Inc.
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// $Log: sc_bv.h,v $
39// Revision 1.1.1.1 2006/12/15 20:20:04 acg
40// SystemC 2.3
41//
42// Revision 1.3 2006/01/13 18:53:53 acg
43// Andy Goodrich: added $Log command so that CVS comments are reproduced in
44// the source.
45//
46
47#ifndef SC_BV_H
48#define SC_BV_H
49
50
52
53
54namespace sc_dt
55{
56
57// classes defined in this module
58
59template <int W> class sc_bv;
60
61// forward class references
62
63template <int W> class sc_bigint;
64template <int W> class sc_biguint;
65
66// ----------------------------------------------------------------------------
67// CLASS TEMPLATE : sc_bv<W>
68//
69// Arbitrary size bit vector class.
70// ----------------------------------------------------------------------------
71
72template <int W>
73class sc_bv
74 : public sc_bv_base
75{
76public:
77
78 // constructors
79
81 :sc_bv_base( W )
82 {}
83
84 explicit sc_bv( bool init_value )
85 : sc_bv_base( init_value, W )
86 {}
87
88 explicit sc_bv( char init_value )
89 : sc_bv_base( (init_value != '0'), W )
90 {}
91
92 sc_bv( const char* a )
93 : sc_bv_base( W )
95
96 sc_bv( const bool* a )
97 : sc_bv_base( W )
99
100 sc_bv( const sc_logic* a )
101 : sc_bv_base( W )
103
104 sc_bv( const sc_unsigned& a )
105 : sc_bv_base( W )
107
108
109 sc_bv( const sc_signed& a )
110 : sc_bv_base( W )
112
113 template<int WO> sc_bv( const sc_bigint<WO>& a );
114
115 template<int WO> sc_bv( const sc_biguint<WO>& a );
116
117 sc_bv( const sc_uint_base& a )
118 : sc_bv_base( W )
120
121 sc_bv( const sc_int_base& a )
122 : sc_bv_base( W )
124
125 sc_bv( unsigned long a )
126 : sc_bv_base( W )
128
129 sc_bv( long a )
130 : sc_bv_base( W )
132
133 sc_bv( unsigned int a )
134 : sc_bv_base( W )
136
137 sc_bv( int a )
138 : sc_bv_base( W )
140
142 : sc_bv_base( W )
144
146 : sc_bv_base( W )
148
149 template <class X>
150 sc_bv( const sc_proxy<X>& a )
151 : sc_bv_base( W )
153
154 sc_bv( const sc_bv<W>& a )
155 : sc_bv_base( a )
156 {}
157
158
159 // assignment operators
160
161 template <class X>
163 { sc_bv_base::operator = ( a ); return *this; }
164
166 { sc_bv_base::operator = ( a ); return *this; }
167
168 sc_bv<W>& operator = ( const char* a )
169 { sc_bv_base::operator = ( a ); return *this; }
170
171 sc_bv<W>& operator = ( const bool* a )
172 { sc_bv_base::operator = ( a ); return *this; }
173
175 { sc_bv_base::operator = ( a ); return *this; }
176
177
179 { sc_bv_base::operator = ( a ); return *this; }
180
182 { sc_bv_base::operator = ( a ); return *this; }
183
185 { sc_bv_base::operator = ( a ); return *this; }
186
188 { sc_bv_base::operator = ( a ); return *this; }
189
190 sc_bv<W>& operator = ( unsigned long a )
191 { sc_bv_base::operator = ( a ); return *this; }
192
194 { sc_bv_base::operator = ( a ); return *this; }
195
196 sc_bv<W>& operator = ( unsigned int a )
197 { sc_bv_base::operator = ( a ); return *this; }
198
200 { sc_bv_base::operator = ( a ); return *this; }
201
203 { sc_bv_base::operator = ( a ); return *this; }
204
206 { sc_bv_base::operator = ( a ); return *this; }
207};
208
209} // namespace sc_dt
210
211
212#endif
unsigned long long uint64
Definition: sc_nbdefs.h:216
long long int64
Definition: sc_nbdefs.h:215
sc_bv(const sc_bv< W > &a)
Definition: sc_bv.h:154
sc_bv(const char *a)
Definition: sc_bv.h:92
sc_bv(const sc_signed &a)
Definition: sc_bv.h:109
sc_bv(const sc_logic *a)
Definition: sc_bv.h:100
sc_bv(bool init_value)
Definition: sc_bv.h:84
sc_bv(unsigned long a)
Definition: sc_bv.h:125
sc_bv(unsigned int a)
Definition: sc_bv.h:133
sc_bv(const sc_unsigned &a)
Definition: sc_bv.h:104
sc_bv(const sc_uint_base &a)
Definition: sc_bv.h:117
sc_bv< W > & operator=(const sc_proxy< X > &a)
Definition: sc_bv.h:162
sc_bv(int64 a)
Definition: sc_bv.h:145
sc_bv(const sc_proxy< X > &a)
Definition: sc_bv.h:150
sc_bv(uint64 a)
Definition: sc_bv.h:141
sc_bv(long a)
Definition: sc_bv.h:129
sc_bv(const sc_int_base &a)
Definition: sc_bv.h:121
sc_bv(const bool *a)
Definition: sc_bv.h:96
sc_bv(char init_value)
Definition: sc_bv.h:88
sc_bv(int a)
Definition: sc_bv.h:137
sc_bv_base & operator=(const sc_proxy< X > &a)
Definition: sc_bv_base.h:147