gem5  v22.1.0.0
sc_bv.hh
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 __SYSTEMC_EXT_DT_BIT_SC_BV_HH__
48 #define __SYSTEMC_EXT_DT_BIT_SC_BV_HH__
49 
50 #include "sc_bv_base.hh"
51 
52 namespace sc_dt
53 {
54 
55 // classes defined in this module
56 template <int W>
57 class sc_bv;
58 
59 
60 // ----------------------------------------------------------------------------
61 // CLASS TEMPLATE : sc_bv<W>
62 //
63 // Arbitrary size bit vector class.
64 // ----------------------------------------------------------------------------
65 
66 template <int W>
67 class 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); }
83  {
85  }
87  sc_bv(unsigned 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); }
93 
94  template <class X>
96  sc_bv(const sc_bv<W> &a) : sc_bv_base(a) {}
97 
98  // assignment operators
99  template <class X>
100  sc_bv<W> &
102  {
104  return *this;
105  }
106 
107  sc_bv<W> &
109  {
111  return *this;
112  }
113 
114  sc_bv<W> &
115  operator = (const char *a)
116  {
118  return *this;
119  }
120 
121  sc_bv<W> &
122  operator = (const bool *a)
123  {
125  return *this;
126  }
127 
128  sc_bv<W> &
130  {
132  return *this;
133  }
134 
135  sc_bv<W> &
137  {
139  return *this;
140  }
141 
142  sc_bv<W> &
144  {
146  return *this;
147  }
148 
149  sc_bv<W> &
151  {
153  return *this;
154  }
155 
156  sc_bv<W> &
158  {
160  return *this;
161  }
162 
163  sc_bv<W> &
164  operator = (unsigned long a)
165  {
167  return *this;
168  }
169 
170  sc_bv<W> &
172  {
174  return *this;
175  }
176 
177  sc_bv<W> &
178  operator = (unsigned int a)
179  {
181  return *this;
182  }
183 
184  sc_bv<W> &
186  {
188  return *this;
189  }
190 
191  sc_bv<W> &
193  {
195  return *this;
196  }
197 
198  sc_bv<W> &
200  {
202  return *this;
203  }
204 };
205 
206 } // namespace sc_dt
207 
208 #endif // __SYSTEMC_EXT_DT_BIT_SC_BV_HH__
sc_bv_base & operator=(const sc_proxy< X > &a)
Definition: sc_bv_base.hh:117
sc_bv(const sc_bv< W > &a)
Definition: sc_bv.hh:96
sc_bv(const char *a)
Definition: sc_bv.hh:77
sc_bv(const sc_signed &a)
Definition: sc_bv.hh:81
sc_bv(const sc_logic *a)
Definition: sc_bv.hh:79
sc_bv(bool init_value)
Definition: sc_bv.hh:73
sc_bv(unsigned long a)
Definition: sc_bv.hh:87
sc_bv(unsigned int a)
Definition: sc_bv.hh:89
sc_bv(const sc_unsigned &a)
Definition: sc_bv.hh:80
sc_bv(const sc_uint_base &a)
Definition: sc_bv.hh:82
sc_bv(int64 a)
Definition: sc_bv.hh:92
sc_bv(const sc_proxy< X > &a)
Definition: sc_bv.hh:95
sc_bv< W > & operator=(const sc_proxy< X > &a)
Definition: sc_bv.hh:101
sc_bv(uint64 a)
Definition: sc_bv.hh:91
sc_bv(long a)
Definition: sc_bv.hh:88
sc_bv(const sc_int_base &a)
Definition: sc_bv.hh:86
sc_bv(const bool *a)
Definition: sc_bv.hh:78
sc_bv(char init_value)
Definition: sc_bv.hh:75
sc_bv(int a)
Definition: sc_bv.hh:90
Bitfield< 8 > a
Definition: misc_types.hh:66
Definition: sc_bit.cc:68
uint64_t uint64
Definition: sc_nbdefs.hh:172
int64_t int64
Definition: sc_nbdefs.hh:171

Generated on Wed Dec 21 2022 10:22:41 for gem5 by doxygen 1.9.1