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
51#include "sysc/datatypes/bit/sc_lv_base.h"
52
53
54namespace sc_dt
55{
56
57// classes defined in this module
58template <int W> class sc_lv;
59
60
61// ----------------------------------------------------------------------------
62//  CLASS TEMPLATE : sc_lv<W>
63//
64//  Arbitrary size logic vector class.
65// ----------------------------------------------------------------------------
66
67template <int W>
68class sc_lv
69    : public sc_lv_base
70{
71public:
72
73    // constructors
74
75    sc_lv()
76	: sc_lv_base( W )
77	{}
78
79    explicit sc_lv( const sc_logic& init_value )
80	: sc_lv_base( init_value, W )
81	{}
82
83    explicit sc_lv( bool init_value )
84	: sc_lv_base( sc_logic( init_value ), W )
85	{}
86
87    explicit sc_lv( char init_value )
88	: sc_lv_base( sc_logic( init_value ), W )
89	{}
90
91    sc_lv( const char* a )
92	: sc_lv_base( W )
93	{ sc_lv_base::operator = ( a ); }
94
95    sc_lv( const bool* a )
96	: sc_lv_base( W )
97	{ sc_lv_base::operator = ( a ); }
98
99    sc_lv( const sc_logic* a )
100	: sc_lv_base( W )
101	{ sc_lv_base::operator = ( a ); }
102
103    sc_lv( const sc_unsigned& a )
104	: sc_lv_base( W )
105	{ sc_lv_base::operator = ( a ); }
106
107    sc_lv( const sc_signed& a )
108	: sc_lv_base( W )
109	{ sc_lv_base::operator = ( a ); }
110
111    sc_lv( const sc_uint_base& a )
112	: sc_lv_base( W )
113	{ sc_lv_base::operator = ( a ); }
114
115    sc_lv( const sc_int_base& a )
116	: sc_lv_base( W )
117	{ sc_lv_base::operator = ( a ); }
118
119    sc_lv( unsigned long a )
120	: sc_lv_base( W )
121	{ sc_lv_base::operator = ( a ); }
122
123    sc_lv( long a )
124	: sc_lv_base( W )
125	{ sc_lv_base::operator = ( a ); }
126
127    sc_lv( unsigned int a )
128	: sc_lv_base( W )
129	{ sc_lv_base::operator = ( a ); }
130
131    sc_lv( int a )
132	: sc_lv_base( W )
133	{ sc_lv_base::operator = ( a ); }
134
135    sc_lv( uint64 a )
136	: sc_lv_base( W )
137	{ sc_lv_base::operator = ( a ); }
138
139    sc_lv( int64 a )
140	: sc_lv_base( W )
141	{ sc_lv_base::operator = ( a ); }
142
143    template <class X>
144    sc_lv( const sc_proxy<X>& a )
145	: sc_lv_base( W )
146	{ sc_lv_base::operator = ( a ); }
147
148    sc_lv( const sc_lv<W>& a )
149	: sc_lv_base( a )
150	{}
151
152
153    // assignment operators
154
155    template <class X>
156    sc_lv<W>& operator = ( const sc_proxy<X>& a )
157	{ sc_lv_base::operator = ( a ); return *this; }
158
159    sc_lv<W>& operator = ( const sc_lv<W>& a )
160	{ sc_lv_base::operator = ( a ); return *this; }
161
162    sc_lv<W>& operator = ( const char* a )
163	{ sc_lv_base::operator = ( a ); return *this; }
164
165    sc_lv<W>& operator = ( const bool* a )
166	{ sc_lv_base::operator = ( a ); return *this; }
167
168    sc_lv<W>& operator = ( const sc_logic* a )
169	{ sc_lv_base::operator = ( a ); return *this; }
170
171    sc_lv<W>& operator = ( const sc_unsigned& a )
172	{ sc_lv_base::operator = ( a ); return *this; }
173
174    sc_lv<W>& operator = ( const sc_signed& a )
175	{ sc_lv_base::operator = ( a ); return *this; }
176
177    sc_lv<W>& operator = ( const sc_uint_base& a )
178	{ sc_lv_base::operator = ( a ); return *this; }
179
180    sc_lv<W>& operator = ( const sc_int_base& a )
181	{ sc_lv_base::operator = ( a ); return *this; }
182
183    sc_lv<W>& operator = ( unsigned long a )
184	{ sc_lv_base::operator = ( a ); return *this; }
185
186    sc_lv<W>& operator = ( long a )
187	{ sc_lv_base::operator = ( a ); return *this; }
188
189    sc_lv<W>& operator = ( unsigned int a )
190	{ sc_lv_base::operator = ( a ); return *this; }
191
192    sc_lv<W>& operator = ( int a )
193	{ sc_lv_base::operator = ( a ); return *this; }
194
195    sc_lv<W>& operator = ( uint64 a )
196	{ sc_lv_base::operator = ( a ); return *this; }
197
198    sc_lv<W>& operator = ( int64 a )
199	{ sc_lv_base::operator = ( a ); return *this; }
200};
201
202} // namespace sc_dt
203
204
205#endif
206