SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_lv.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_lv.h -- Arbitrary size logic vector class.
21 
22  Original Author: Gene Bushuyev, Synopsys, Inc.
23 
24  *****************************************************************************/
25 
26 /*****************************************************************************
27 
28  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
29  changes you are making here.
30 
31  Name, Affiliation, Date:
32  Description of Modification:
33 
34  *****************************************************************************/
35 
36 // $Log: sc_lv.h,v $
37 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
38 // SystemC 2.3
39 //
40 // Revision 1.3 2006/01/13 18:53:53 acg
41 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
42 // the source.
43 //
44 
45 #ifndef SC_LV_H
46 #define SC_LV_H
47 
48 
50 
51 
52 namespace sc_dt
53 {
54 
55 // classes defined in this module
56 template <int W> class sc_lv;
57 
58 
59 // ----------------------------------------------------------------------------
60 // CLASS TEMPLATE : sc_lv<W>
61 //
62 // Arbitrary size logic vector class.
63 // ----------------------------------------------------------------------------
64 
65 template <int W>
66 class sc_lv
67  : public sc_lv_base
68 {
69 public:
70 
71  // constructors
72 
74  : sc_lv_base( W )
75  {}
76 
77  explicit sc_lv( const sc_logic& init_value )
78  : sc_lv_base( init_value, W )
79  {}
80 
81  explicit sc_lv( bool init_value )
82  : sc_lv_base( sc_logic( init_value ), W )
83  {}
84 
85  explicit sc_lv( char init_value )
86  : sc_lv_base( sc_logic( init_value ), W )
87  {}
88 
89  sc_lv( const char* a )
90  : sc_lv_base( W )
91  { sc_lv_base::operator = ( a ); }
92 
93  sc_lv( const bool* a )
94  : sc_lv_base( W )
95  { sc_lv_base::operator = ( a ); }
96 
97  sc_lv( const sc_logic* a )
98  : sc_lv_base( W )
99  { sc_lv_base::operator = ( a ); }
100 
101  sc_lv( const sc_unsigned& a )
102  : sc_lv_base( W )
103  { sc_lv_base::operator = ( a ); }
104 
105  sc_lv( const sc_signed& a )
106  : sc_lv_base( W )
107  { sc_lv_base::operator = ( a ); }
108 
109  sc_lv( const sc_uint_base& a )
110  : sc_lv_base( W )
111  { sc_lv_base::operator = ( a ); }
112 
113  sc_lv( const sc_int_base& a )
114  : sc_lv_base( W )
115  { sc_lv_base::operator = ( a ); }
116 
117  sc_lv( unsigned long a )
118  : sc_lv_base( W )
119  { sc_lv_base::operator = ( a ); }
120 
121  sc_lv( long a )
122  : sc_lv_base( W )
123  { sc_lv_base::operator = ( a ); }
124 
125  sc_lv( unsigned int a )
126  : sc_lv_base( W )
127  { sc_lv_base::operator = ( a ); }
128 
129  sc_lv( int a )
130  : sc_lv_base( W )
131  { sc_lv_base::operator = ( a ); }
132 
134  : sc_lv_base( W )
135  { sc_lv_base::operator = ( a ); }
136 
138  : sc_lv_base( W )
139  { sc_lv_base::operator = ( a ); }
140 
141  template <class X>
142  sc_lv( const sc_proxy<X>& a )
143  : sc_lv_base( W )
144  { sc_lv_base::operator = ( a ); }
145 
146  sc_lv( const sc_lv<W>& a )
147  : sc_lv_base( a )
148  {}
149 
150 
151  // assignment operators
152 
153  template <class X>
155  { sc_lv_base::operator = ( a ); return *this; }
156 
158  { sc_lv_base::operator = ( a ); return *this; }
159 
160  sc_lv<W>& operator = ( const char* a )
161  { sc_lv_base::operator = ( a ); return *this; }
162 
163  sc_lv<W>& operator = ( const bool* a )
164  { sc_lv_base::operator = ( a ); return *this; }
165 
167  { sc_lv_base::operator = ( a ); return *this; }
168 
170  { sc_lv_base::operator = ( a ); return *this; }
171 
173  { sc_lv_base::operator = ( a ); return *this; }
174 
176  { sc_lv_base::operator = ( a ); return *this; }
177 
179  { sc_lv_base::operator = ( a ); return *this; }
180 
181  sc_lv<W>& operator = ( unsigned long a )
182  { sc_lv_base::operator = ( a ); return *this; }
183 
185  { sc_lv_base::operator = ( a ); return *this; }
186 
187  sc_lv<W>& operator = ( unsigned int a )
188  { sc_lv_base::operator = ( a ); return *this; }
189 
191  { sc_lv_base::operator = ( a ); return *this; }
192 
194  { sc_lv_base::operator = ( a ); return *this; }
195 
197  { sc_lv_base::operator = ( a ); return *this; }
198 };
199 
200 } // namespace sc_dt
201 
202 
203 #endif
sc_lv(const sc_logic *a)
Definition: sc_lv.h:97
sc_lv< W > & operator=(const sc_proxy< X > &a)
Definition: sc_lv.h:154
sc_lv(const bool *a)
Definition: sc_lv.h:93
int64_t int64
Definition: sc_nbdefs.h:182
sc_lv(const char *a)
Definition: sc_lv.h:89
sc_lv(bool init_value)
Definition: sc_lv.h:81
sc_lv(const sc_proxy< X > &a)
Definition: sc_lv.h:142
sc_lv(const sc_lv< W > &a)
Definition: sc_lv.h:146
sc_lv(int a)
Definition: sc_lv.h:129
sc_lv(int64 a)
Definition: sc_lv.h:137
sc_lv(const sc_signed &a)
Definition: sc_lv.h:105
sc_lv(const sc_logic &init_value)
Definition: sc_lv.h:77
sc_lv(unsigned long a)
Definition: sc_lv.h:117
uint64_t uint64
Definition: sc_nbdefs.h:183
sc_lv(const sc_int_base &a)
Definition: sc_lv.h:113
sc_lv(const sc_uint_base &a)
Definition: sc_lv.h:109
sc_lv(char init_value)
Definition: sc_lv.h:85
sc_lv(const sc_unsigned &a)
Definition: sc_lv.h:101
sc_lv_base & operator=(const sc_proxy< X > &a)
Definition: sc_lv_base.h:154
sc_lv(uint64 a)
Definition: sc_lv.h:133
sc_lv(long a)
Definition: sc_lv.h:121
sc_lv(unsigned int a)
Definition: sc_lv.h:125