00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 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 (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.accellera.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 // $Log: sc_lv.h,v $ 00037 // Revision 1.1.1.1 2006/12/15 20:20:04 acg 00038 // SystemC 2.3 00039 // 00040 // Revision 1.3 2006/01/13 18:53:53 acg 00041 // Andy Goodrich: added $Log command so that CVS comments are reproduced in 00042 // the source. 00043 // 00044 00045 #ifndef SC_LV_H 00046 #define SC_LV_H 00047 00048 00049 #include "sysc/datatypes/bit/sc_lv_base.h" 00050 00051 00052 namespace sc_dt 00053 { 00054 00055 // classes defined in this module 00056 template <int W> class sc_lv; 00057 00058 00059 // ---------------------------------------------------------------------------- 00060 // CLASS TEMPLATE : sc_lv<W> 00061 // 00062 // Arbitrary size logic vector class. 00063 // ---------------------------------------------------------------------------- 00064 00065 template <int W> 00066 class sc_lv 00067 : public sc_lv_base 00068 { 00069 public: 00070 00071 // constructors 00072 00073 sc_lv() 00074 : sc_lv_base( W ) 00075 {} 00076 00077 explicit sc_lv( const sc_logic& init_value ) 00078 : sc_lv_base( init_value, W ) 00079 {} 00080 00081 explicit sc_lv( bool init_value ) 00082 : sc_lv_base( sc_logic( init_value ), W ) 00083 {} 00084 00085 explicit sc_lv( char init_value ) 00086 : sc_lv_base( sc_logic( init_value ), W ) 00087 {} 00088 00089 sc_lv( const char* a ) 00090 : sc_lv_base( W ) 00091 { sc_lv_base::operator = ( a ); } 00092 00093 sc_lv( const bool* a ) 00094 : sc_lv_base( W ) 00095 { sc_lv_base::operator = ( a ); } 00096 00097 sc_lv( const sc_logic* a ) 00098 : sc_lv_base( W ) 00099 { sc_lv_base::operator = ( a ); } 00100 00101 sc_lv( const sc_unsigned& a ) 00102 : sc_lv_base( W ) 00103 { sc_lv_base::operator = ( a ); } 00104 00105 sc_lv( const sc_signed& a ) 00106 : sc_lv_base( W ) 00107 { sc_lv_base::operator = ( a ); } 00108 00109 sc_lv( const sc_uint_base& a ) 00110 : sc_lv_base( W ) 00111 { sc_lv_base::operator = ( a ); } 00112 00113 sc_lv( const sc_int_base& a ) 00114 : sc_lv_base( W ) 00115 { sc_lv_base::operator = ( a ); } 00116 00117 sc_lv( unsigned long a ) 00118 : sc_lv_base( W ) 00119 { sc_lv_base::operator = ( a ); } 00120 00121 sc_lv( long a ) 00122 : sc_lv_base( W ) 00123 { sc_lv_base::operator = ( a ); } 00124 00125 sc_lv( unsigned int a ) 00126 : sc_lv_base( W ) 00127 { sc_lv_base::operator = ( a ); } 00128 00129 sc_lv( int a ) 00130 : sc_lv_base( W ) 00131 { sc_lv_base::operator = ( a ); } 00132 00133 sc_lv( uint64 a ) 00134 : sc_lv_base( W ) 00135 { sc_lv_base::operator = ( a ); } 00136 00137 sc_lv( int64 a ) 00138 : sc_lv_base( W ) 00139 { sc_lv_base::operator = ( a ); } 00140 00141 template <class X> 00142 sc_lv( const sc_proxy<X>& a ) 00143 : sc_lv_base( W ) 00144 { sc_lv_base::operator = ( a ); } 00145 00146 sc_lv( const sc_lv<W>& a ) 00147 : sc_lv_base( a ) 00148 {} 00149 00150 00151 // assignment operators 00152 00153 template <class X> 00154 sc_lv<W>& operator = ( const sc_proxy<X>& a ) 00155 { sc_lv_base::operator = ( a ); return *this; } 00156 00157 sc_lv<W>& operator = ( const sc_lv<W>& a ) 00158 { sc_lv_base::operator = ( a ); return *this; } 00159 00160 sc_lv<W>& operator = ( const char* a ) 00161 { sc_lv_base::operator = ( a ); return *this; } 00162 00163 sc_lv<W>& operator = ( const bool* a ) 00164 { sc_lv_base::operator = ( a ); return *this; } 00165 00166 sc_lv<W>& operator = ( const sc_logic* a ) 00167 { sc_lv_base::operator = ( a ); return *this; } 00168 00169 sc_lv<W>& operator = ( const sc_unsigned& a ) 00170 { sc_lv_base::operator = ( a ); return *this; } 00171 00172 sc_lv<W>& operator = ( const sc_signed& a ) 00173 { sc_lv_base::operator = ( a ); return *this; } 00174 00175 sc_lv<W>& operator = ( const sc_uint_base& a ) 00176 { sc_lv_base::operator = ( a ); return *this; } 00177 00178 sc_lv<W>& operator = ( const sc_int_base& a ) 00179 { sc_lv_base::operator = ( a ); return *this; } 00180 00181 sc_lv<W>& operator = ( unsigned long a ) 00182 { sc_lv_base::operator = ( a ); return *this; } 00183 00184 sc_lv<W>& operator = ( long a ) 00185 { sc_lv_base::operator = ( a ); return *this; } 00186 00187 sc_lv<W>& operator = ( unsigned int a ) 00188 { sc_lv_base::operator = ( a ); return *this; } 00189 00190 sc_lv<W>& operator = ( int a ) 00191 { sc_lv_base::operator = ( a ); return *this; } 00192 00193 sc_lv<W>& operator = ( uint64 a ) 00194 { sc_lv_base::operator = ( a ); return *this; } 00195 00196 sc_lv<W>& operator = ( int64 a ) 00197 { sc_lv_base::operator = ( a ); return *this; } 00198 }; 00199 00200 } // namespace sc_dt 00201 00202 00203 #endif