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