00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2004 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License Version 2.3 (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.systemc.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 sc_lv.h -- Arbitrary size logic vector class. 00021 00022 Original Author: Gene Bushuyev, Synopsys, Inc. 00023 00024 *****************************************************************************/ 00025 00026 /***************************************************************************** 00027 00028 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00029 changes you are making here. 00030 00031 Name, Affiliation, Date: 00032 Description of Modification: 00033 00034 *****************************************************************************/ 00035 00036 #ifndef SC_LV_H 00037 #define SC_LV_H 00038 00039 00040 #include "systemc/datatypes/bit/sc_lv_base.h" 00041 00042 00043 namespace sc_dt 00044 { 00045 00046 // classes defined in this module 00047 template <int W> class sc_lv; 00048 00049 00050 // ---------------------------------------------------------------------------- 00051 // CLASS TEMPLATE : sc_lv<W> 00052 // 00053 // Arbitrary size logic vector class. 00054 // ---------------------------------------------------------------------------- 00055 00056 template <int W> 00057 class sc_lv 00058 : public sc_lv_base 00059 { 00060 public: 00061 00062 // constructors 00063 00064 sc_lv() 00065 : sc_lv_base( W ) 00066 {} 00067 00068 explicit sc_lv( const sc_logic& init_value ) 00069 : sc_lv_base( init_value, W ) 00070 {} 00071 00072 explicit sc_lv( bool init_value ) 00073 : sc_lv_base( sc_logic( init_value ), W ) 00074 {} 00075 00076 explicit sc_lv( char init_value ) 00077 : sc_lv_base( sc_logic( init_value ), W ) 00078 {} 00079 00080 sc_lv( const char* a ) 00081 : sc_lv_base( W ) 00082 { sc_lv_base::operator = ( a ); } 00083 00084 sc_lv( const bool* a ) 00085 : sc_lv_base( W ) 00086 { sc_lv_base::operator = ( a ); } 00087 00088 sc_lv( const sc_logic* a ) 00089 : sc_lv_base( W ) 00090 { sc_lv_base::operator = ( a ); } 00091 00092 sc_lv( const sc_unsigned& a ) 00093 : sc_lv_base( W ) 00094 { sc_lv_base::operator = ( a ); } 00095 00096 sc_lv( const sc_signed& a ) 00097 : sc_lv_base( W ) 00098 { sc_lv_base::operator = ( a ); } 00099 00100 sc_lv( const sc_uint_base& a ) 00101 : sc_lv_base( W ) 00102 { sc_lv_base::operator = ( a ); } 00103 00104 sc_lv( const sc_int_base& a ) 00105 : sc_lv_base( W ) 00106 { sc_lv_base::operator = ( a ); } 00107 00108 sc_lv( unsigned long a ) 00109 : sc_lv_base( W ) 00110 { sc_lv_base::operator = ( a ); } 00111 00112 sc_lv( long a ) 00113 : sc_lv_base( W ) 00114 { sc_lv_base::operator = ( a ); } 00115 00116 sc_lv( unsigned int a ) 00117 : sc_lv_base( W ) 00118 { sc_lv_base::operator = ( a ); } 00119 00120 sc_lv( int a ) 00121 : sc_lv_base( W ) 00122 { sc_lv_base::operator = ( a ); } 00123 00124 sc_lv( uint64 a ) 00125 : sc_lv_base( W ) 00126 { sc_lv_base::operator = ( a ); } 00127 00128 sc_lv( int64 a ) 00129 : sc_lv_base( W ) 00130 { sc_lv_base::operator = ( a ); } 00131 00132 template <class X> 00133 sc_lv( const sc_proxy<X>& a ) 00134 : sc_lv_base( W ) 00135 { sc_lv_base::operator = ( a ); } 00136 00137 sc_lv( const sc_lv<W>& a ) 00138 : sc_lv_base( a ) 00139 {} 00140 00141 00142 // assignment operators 00143 00144 template <class X> 00145 sc_lv<W>& operator = ( const sc_proxy<X>& a ) 00146 { sc_lv_base::operator = ( a ); return *this; } 00147 00148 sc_lv<W>& operator = ( const sc_lv<W>& a ) 00149 { sc_lv_base::operator = ( a ); return *this; } 00150 00151 sc_lv<W>& operator = ( const char* a ) 00152 { sc_lv_base::operator = ( a ); return *this; } 00153 00154 sc_lv<W>& operator = ( const bool* a ) 00155 { sc_lv_base::operator = ( a ); return *this; } 00156 00157 sc_lv<W>& operator = ( const sc_logic* a ) 00158 { sc_lv_base::operator = ( a ); return *this; } 00159 00160 sc_lv<W>& operator = ( const sc_unsigned& a ) 00161 { sc_lv_base::operator = ( a ); return *this; } 00162 00163 sc_lv<W>& operator = ( const sc_signed& a ) 00164 { sc_lv_base::operator = ( a ); return *this; } 00165 00166 sc_lv<W>& operator = ( const sc_uint_base& a ) 00167 { sc_lv_base::operator = ( a ); return *this; } 00168 00169 sc_lv<W>& operator = ( const sc_int_base& a ) 00170 { sc_lv_base::operator = ( a ); return *this; } 00171 00172 sc_lv<W>& operator = ( unsigned long a ) 00173 { sc_lv_base::operator = ( a ); return *this; } 00174 00175 sc_lv<W>& operator = ( long a ) 00176 { sc_lv_base::operator = ( a ); return *this; } 00177 00178 sc_lv<W>& operator = ( unsigned int a ) 00179 { sc_lv_base::operator = ( a ); return *this; } 00180 00181 sc_lv<W>& operator = ( int a ) 00182 { sc_lv_base::operator = ( a ); return *this; } 00183 00184 sc_lv<W>& operator = ( uint64 a ) 00185 { sc_lv_base::operator = ( a ); return *this; } 00186 00187 sc_lv<W>& operator = ( int64 a ) 00188 { sc_lv_base::operator = ( a ); return *this; } 00189 }; 00190 00191 } // namespace sc_dt 00192 00193 00194 #endif
1.2.18