SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_value_base.h
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_value_base.h -- Base class for SystemC bit values.
23 */
32 /*****************************************************************************
33 
34  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
35  changes you are making here.
36 
37  Name, Affiliation, Date:
38  Description of Modification:
39 
40  *****************************************************************************/
41 
42 // $Log: sc_value_base.h,v $
43 // Revision 1.4 2011/08/29 18:04:32 acg
44 // Philipp A. Hartmann: miscellaneous clean ups.
45 //
46 // Revision 1.3 2011/08/24 22:05:48 acg
47 // Torsten Maehne: initialization changes to remove warnings.
48 //
49 // Revision 1.2 2011/06/28 21:23:04 acg
50 // Andy Goodrich: merging of SCV tree.
51 //
52 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
53 // SystemC 2.3
54 //
55 // Revision 1.3 2006/01/13 18:54:01 acg
56 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
57 // the source.
58 //
59 
60 #ifndef SC_VALUE_BASE_H
61 #define SC_VALUE_BASE_H
62 
63 
65 
66 namespace sc_dt
67 {
68 
69 class sc_signed;
70 class sc_unsigned;
71 
83 {
84  friend class sc_concatref;
85  private:
86  virtual void concat_clear_data( bool to_ones=false );
87  virtual bool concat_get_ctrl( sc_digit* dst_p, int low_i ) const;
88  virtual bool concat_get_data( sc_digit* dst_p, int low_i ) const;
89  virtual uint64 concat_get_uint64() const;
90  virtual int concat_length(bool* xz_present_p=0) const;
91  virtual void concat_set( int64 src, int low_i );
92  virtual void concat_set( const sc_signed& src, int low_i );
93  virtual void concat_set( const sc_unsigned& src, int low_i );
94  virtual void concat_set( uint64 src, int low_i );
95  public:
96  virtual ~sc_value_base() {}
97 };
98 
99 
119 template< class T >
121  public:
122  inline const T* operator-> () const
123  {
124  return (const T*)this;
125  }
126  inline T* operator-> ()
127  {
128  return (T*)this;
129  }
130 };
131 
132 } // namespace sc_dt
133 
134 #endif
Proxy class for sized bit concatenation.
Definition: sc_concatref.h:118
int64_t int64
Definition: sc_nbdefs.h:188
Arbitrary precision signed number.
Definition: sc_signed.h:1099
Abstract base class of all SystemC native variables.
Definition: sc_value_base.h:82
uint64_t uint64
Definition: sc_nbdefs.h:189
Arbitrary precision unsigned number.
Definition: sc_unsigned.h:1001
unsigned int sc_digit
Definition: sc_nbdefs.h:179
virtual ~sc_value_base()
Definition: sc_value_base.h:96
Proxy class for user-defined value classes and other classes that.
Top level header file for arbitrary precision signed/unsigned.
#define SC_API
Definition: sc_cmnhdr.h:168