gem5  v21.2.1.1
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); }
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  {
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); }
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  {
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 
122  operator = (const bool *a)
123  {
125  return *this;
126  }
127 
128  sc_bv<W> &
129  operator = (const sc_logic *a)
130  {
132  return *this;
133  }
134 
135  sc_bv<W> &
136  operator = (const sc_unsigned &a)
137  {
139  return *this;
140  }
141 
142  sc_bv<W> &
143  operator = (const sc_signed &a)
144  {
146  return *this;
147  }
148 
149  sc_bv<W> &
150  operator = (const sc_uint_base &a)
151  {
153  return *this;
154  }
155 
156  sc_bv<W> &
157  operator = (const sc_int_base &a)
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> &
171  operator = (long a)
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> &
185  operator = (int a)
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_dt
Definition: sc_bit.cc:67
sc_dt::sc_bv_base
Definition: sc_bv_base.hh:105
sc_dt::sc_int_base
Definition: sc_int_base.hh:494
gem5::ArmISA::a
Bitfield< 8 > a
Definition: misc_types.hh:66
sc_bv_base.hh
sc_dt::sc_signed
Definition: sc_signed.hh:984
sc_dt::sc_logic
Definition: sc_logic.hh:130
sc_dt::sc_bv::operator=
sc_bv< W > & operator=(const sc_proxy< X > &a)
Definition: sc_bv.hh:132
sc_dt::uint64
uint64_t uint64
Definition: sc_nbdefs.hh:206
sc_dt::sc_bv::sc_bv
sc_bv()
Definition: sc_bv.hh:102
sc_dt::sc_bv
Definition: sc_bv.hh:88
sc_dt::int64
int64_t int64
Definition: sc_nbdefs.hh:205
sc_dt::sc_uint_base
Definition: sc_uint_base.hh:465
sc_dt::sc_bv_base::operator=
sc_bv_base & operator=(const sc_proxy< X > &a)
Definition: sc_bv_base.hh:148
sc_dt::sc_unsigned
Definition: sc_unsigned.hh:890

Generated on Wed May 4 2022 12:14:04 for gem5 by doxygen 1.8.17