SystemC 3.0.0
Accellera SystemC proof-of-concept library
sc_lv.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_lv.h -- Arbitrary size logic 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_lv.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_LV_H
48#define SC_LV_H
49
50
52
53
54namespace sc_dt
55{
56
57// classes defined in this module
58
59template <int W> class sc_lv;
60
61// forward class references
62
63template <int W> class sc_bigint;
64template <int W> class sc_biguint;
65
66// ----------------------------------------------------------------------------
67// CLASS TEMPLATE : sc_lv<W>
68//
69// Arbitrary size logic vector class.
70// ----------------------------------------------------------------------------
71
72template <int W>
73class sc_lv
74 : public sc_lv_base
75{
76public:
77
78 // constructors
79
81 : sc_lv_base( W )
82 {}
83
84 explicit sc_lv( const sc_logic& init_value )
85 : sc_lv_base( init_value, W )
86 {}
87
88 explicit sc_lv( bool init_value )
89 : sc_lv_base( sc_logic( init_value ), W )
90 {}
91
92 explicit sc_lv( char init_value )
93 : sc_lv_base( sc_logic( init_value ), W )
94 {}
95
96 sc_lv( const char* a )
97 : sc_lv_base( W )
99
100 sc_lv( const bool* a )
101 : sc_lv_base( W )
103
104 sc_lv( const sc_logic* a )
105 : sc_lv_base( W )
107
108 sc_lv( const sc_unsigned& a )
109 : sc_lv_base( W )
111
112 sc_lv( const sc_signed& a )
113 : sc_lv_base( W )
115
116 template<int WO> sc_lv( const sc_bigint<WO>& a );
117
118 template<int WO> sc_lv( const sc_biguint<WO>& a );
119
120 sc_lv( const sc_uint_base& a )
121 : sc_lv_base( W )
123
124 sc_lv( const sc_int_base& a )
125 : sc_lv_base( W )
127
128 sc_lv( unsigned long a )
129 : sc_lv_base( W )
131
132 sc_lv( long a )
133 : sc_lv_base( W )
135
136 sc_lv( unsigned int a )
137 : sc_lv_base( W )
139
140 sc_lv( int a )
141 : sc_lv_base( W )
143
145 : sc_lv_base( W )
147
149 : sc_lv_base( W )
151
152 template <class X>
153 sc_lv( const sc_proxy<X>& a )
154 : sc_lv_base( W )
156
157 sc_lv( const sc_lv<W>& a )
158 : sc_lv_base( a )
159 {}
160
161
162 // assignment operators
163
164 template <class X>
166 { sc_lv_base::operator = ( a ); return *this; }
167
169 { sc_lv_base::operator = ( a ); return *this; }
170
171 sc_lv<W>& operator = ( const char* a )
172 { sc_lv_base::operator = ( a ); return *this; }
173
174 sc_lv<W>& operator = ( const bool* a )
175 { sc_lv_base::operator = ( a ); return *this; }
176
178 { sc_lv_base::operator = ( a ); return *this; }
179
181 { sc_lv_base::operator = ( a ); return *this; }
182
184 { sc_lv_base::operator = ( a ); return *this; }
185
187 { sc_lv_base::operator = ( a ); return *this; }
188
190 { sc_lv_base::operator = ( a ); return *this; }
191
192 sc_lv<W>& operator = ( unsigned long a )
193 { sc_lv_base::operator = ( a ); return *this; }
194
196 { sc_lv_base::operator = ( a ); return *this; }
197
198 sc_lv<W>& operator = ( unsigned int a )
199 { sc_lv_base::operator = ( a ); return *this; }
200
202 { sc_lv_base::operator = ( a ); return *this; }
203
205 { sc_lv_base::operator = ( a ); return *this; }
206
208 { sc_lv_base::operator = ( a ); return *this; }
209};
210
211} // namespace sc_dt
212
213
214#endif
unsigned long long uint64
Definition: sc_nbdefs.h:216
long long int64
Definition: sc_nbdefs.h:215
sc_lv(const char *a)
Definition: sc_lv.h:96
sc_lv(const sc_logic *a)
Definition: sc_lv.h:104
sc_lv(char init_value)
Definition: sc_lv.h:92
sc_lv(const sc_signed &a)
Definition: sc_lv.h:112
sc_lv(const sc_unsigned &a)
Definition: sc_lv.h:108
sc_lv(unsigned int a)
Definition: sc_lv.h:136
sc_lv(unsigned long a)
Definition: sc_lv.h:128
sc_lv(const sc_proxy< X > &a)
Definition: sc_lv.h:153
sc_lv(const sc_uint_base &a)
Definition: sc_lv.h:120
sc_lv(int64 a)
Definition: sc_lv.h:148
sc_lv(uint64 a)
Definition: sc_lv.h:144
sc_lv(const sc_int_base &a)
Definition: sc_lv.h:124
sc_lv(int a)
Definition: sc_lv.h:140
sc_lv(const bool *a)
Definition: sc_lv.h:100
sc_lv(bool init_value)
Definition: sc_lv.h:88
sc_lv< W > & operator=(const sc_proxy< X > &a)
Definition: sc_lv.h:165
sc_lv(const sc_logic &init_value)
Definition: sc_lv.h:84
sc_lv(const sc_lv< W > &a)
Definition: sc_lv.h:157
sc_lv(long a)
Definition: sc_lv.h:132
sc_lv_base & operator=(const sc_proxy< X > &a)
Definition: sc_lv_base.h:157