00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 #ifndef SC_CONCATREF_H
00076 #define SC_CONCATREF_H
00077 
00078 #include "sysc/kernel/sc_object.h"
00079 #include "sysc/datatypes/misc/sc_value_base.h"
00080 #include "sysc/utils/sc_temporary.h"
00081 #include "sysc/datatypes/bit/sc_bv.h"
00082 #include "sysc/datatypes/bit/sc_lv.h"
00083 #include "sysc/datatypes/int/sc_int_base.h"
00084 #include "sysc/datatypes/int/sc_uint_base.h"
00085 #include "sysc/datatypes/int/sc_signed.h"
00086 #include "sysc/datatypes/int/sc_unsigned.h"
00087 
00088 namespace sc_core {
00089     extern sc_byte_heap sc_temp_heap; 
00090 } 
00091 
00092 namespace sc_dt
00093 {
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 class sc_concatref : public sc_generic_base<sc_concatref>, public sc_value_base
00102 {
00103 public:
00104     friend class sc_core::sc_vpool<sc_concatref>;
00105 
00106     inline void initialize( 
00107         sc_value_base& left, sc_value_base& right )
00108         {    
00109             bool left_xz;   
00110             bool right_xz;  
00111             
00112             m_left_p = (sc_value_base*)&left;
00113             m_right_p = (sc_value_base*)&right;
00114             m_len_r = right.concat_length(&right_xz);
00115             m_len = left.concat_length(&left_xz) + m_len_r;
00116             m_flags = ( left_xz || right_xz ) ? cf_xz_present : cf_none;
00117         }
00118 
00119 
00120     inline void initialize( 
00121         const sc_value_base& left, const sc_value_base& right )
00122         {    
00123             bool left_xz;   
00124             bool right_xz;  
00125 
00126             m_left_p = (sc_value_base*)&left;
00127             m_right_p = (sc_value_base*)&right;
00128             m_len_r = right.concat_length(&right_xz);
00129             m_len = left.concat_length(&left_xz) + m_len_r;
00130             m_flags = ( left_xz || right_xz ) ? cf_xz_present : cf_none;
00131         }
00132 
00133     
00134 
00135     virtual ~sc_concatref()
00136     {}
00137 
00138 
00139     
00140 
00141     unsigned int length() const
00142         { return m_len; }
00143 
00144 #ifdef SC_DT_DEPRECATED
00145     int bitwidth() const
00146         { return length(); }
00147 #endif
00148 
00149     
00150 
00151     virtual int concat_length( bool* xz_present_p ) const
00152     { 
00153         if ( xz_present_p ) 
00154             *xz_present_p = m_flags & cf_xz_present ? true : false;
00155         return m_len; 
00156     }
00157 
00158     virtual void concat_clear_data( bool to_ones )
00159     { 
00160         m_left_p->concat_clear_data(to_ones); 
00161         m_right_p->concat_clear_data(to_ones); 
00162     }
00163 
00164     virtual bool concat_get_ctrl( sc_digit* dst_p, int low_i ) const
00165     {
00166         bool rnz = m_right_p->concat_get_ctrl( dst_p, low_i );
00167         bool lnz = m_left_p->concat_get_ctrl( dst_p, low_i+m_len_r );
00168         return rnz || lnz;
00169     }
00170 
00171     virtual bool concat_get_data( sc_digit* dst_p, int low_i ) const
00172     {
00173         bool rnz = m_right_p->concat_get_data( dst_p, low_i );
00174         bool lnz = m_left_p->concat_get_data( dst_p, low_i+m_len_r );
00175         return rnz || lnz;
00176     }
00177 
00178     virtual uint64 concat_get_uint64() const
00179     {
00180         if ( m_len_r >= 64 )
00181             return m_right_p->concat_get_uint64();
00182         else
00183         {
00184             return (m_left_p->concat_get_uint64() << m_len_r) | 
00185                 m_right_p->concat_get_uint64();
00186         }
00187     }
00188 
00189     virtual void concat_set( int64 src, int low_i ) 
00190     { 
00191         m_right_p->concat_set( src, low_i );
00192         m_left_p->concat_set( src, low_i+m_len_r);
00193     }
00194 
00195     virtual void concat_set( const sc_signed& src, int low_i ) 
00196     {
00197         m_right_p->concat_set( src, low_i );
00198         m_left_p->concat_set( src, low_i+m_len_r);
00199     }
00200 
00201     virtual void concat_set( const sc_unsigned& src, int low_i ) 
00202     { 
00203         m_right_p->concat_set( src, low_i );
00204         m_left_p->concat_set( src, low_i+m_len_r);
00205     }
00206 
00207     virtual void concat_set( uint64 src, int low_i )
00208     { 
00209         m_right_p->concat_set( src, low_i );
00210         m_left_p->concat_set( src, low_i+m_len_r);
00211     }
00212 
00213 
00214     
00215 
00216     uint64 to_uint64() const 
00217         {
00218             uint64 mask;
00219             uint64 result;
00220 
00221             result = m_right_p->concat_get_uint64();
00222             if ( m_len_r < 64 )
00223             {
00224                 mask = (uint64)~0;
00225                 result = (m_left_p->concat_get_uint64() << m_len_r) | 
00226                             (result & ~(mask << m_len_r));
00227             }
00228             if ( m_len < 64 )
00229             {
00230                 mask = (uint64)~0;
00231                 result = result & ~(mask << m_len);
00232             }
00233             return result;
00234         }
00235 
00236     const sc_unsigned& value() const
00237         {
00238             bool           left_non_zero;
00239             sc_unsigned*   result_p = sc_unsigned::m_pool.allocate();
00240             bool           right_non_zero;
00241 
00242             result_p->nbits = result_p->num_bits(m_len);
00243             result_p->ndigits = DIV_CEIL(result_p->nbits);
00244             result_p->digit = (sc_digit*)sc_core::sc_temp_heap.allocate( 
00245                 sizeof(sc_digit)*result_p->ndigits );
00246 #if defined(_MSC_VER)
00247             
00248             memset( result_p->digit, 0, sizeof(sc_digit)*result_p->ndigits );
00249 #else
00250             result_p->digit[result_p->ndigits-1] = 0;
00251 #endif
00252             right_non_zero = m_right_p->concat_get_data( result_p->digit, 0 );
00253             left_non_zero = m_left_p->concat_get_data(result_p->digit, m_len_r); 
00254             if ( left_non_zero || right_non_zero ) 
00255                 result_p->sgn = SC_POS;
00256             else
00257                 result_p->sgn = SC_ZERO;
00258             return *result_p;
00259         }
00260 
00261     int64 to_int64() const
00262         { 
00263             return (int64)to_uint64();
00264         }
00265     int to_int() const
00266         { return (int)to_int64(); }
00267     unsigned int  to_uint() const
00268         { return (unsigned int)to_uint64(); }
00269     long to_long() const
00270         { return (long)to_int64(); }
00271     unsigned long to_ulong() const
00272         { return (unsigned long)to_uint64(); }
00273     double to_double() const
00274         { return value().to_double(); }
00275 
00276     void to_sc_signed( sc_signed& target ) const
00277         { target = value(); }
00278 
00279     void to_sc_unsigned( sc_unsigned& target ) const
00280         { target = value(); }
00281 
00282     
00283 
00284     operator  uint64 () const 
00285         { return to_uint64(); }
00286 
00287     operator const sc_unsigned& () const
00288         { return value(); }
00289 
00290     
00291 
00292     sc_unsigned operator + () const
00293         { return value(); } 
00294 
00295     sc_signed operator - () const
00296         { return -value(); } 
00297 
00298     sc_unsigned operator ~ () const
00299         { return ~value(); } 
00300 
00301     
00302 
00303     const std::string to_string( sc_numrep numrep = SC_DEC ) const
00304         { return value().to_string(numrep); }
00305 
00306     const std::string to_string( sc_numrep numrep, bool w_prefix ) const
00307         { return value().to_string(numrep,w_prefix); }
00308 
00309 
00310 
00311     
00312 
00313     inline const sc_concatref& operator = ( int v )
00314     {
00315         m_right_p->concat_set((int64)v, 0);
00316         m_left_p->concat_set((int64)v, m_len_r);
00317         return *this;
00318     }
00319 
00320     inline const sc_concatref& operator = ( long v )
00321     {
00322         m_right_p->concat_set((int64)v, 0);
00323         m_left_p->concat_set((int64)v, m_len_r);
00324         return *this;
00325     }
00326 
00327     inline const sc_concatref& operator = ( int64 v )
00328     {
00329         m_right_p->concat_set(v, 0);
00330         m_left_p->concat_set(v, m_len_r);
00331         return *this;
00332     }
00333 
00334     inline const sc_concatref& operator = ( unsigned int v )
00335     {
00336         m_right_p->concat_set((uint64)v, 0);
00337         m_left_p->concat_set((uint64)v, m_len_r);
00338         return *this;
00339     }
00340 
00341     inline const sc_concatref& operator = ( unsigned long v )
00342     {
00343         m_right_p->concat_set((uint64)v, 0);
00344         m_left_p->concat_set((uint64)v, m_len_r);
00345         return *this;
00346     }
00347 
00348     inline const sc_concatref& operator = ( uint64 v )
00349     {
00350         m_right_p->concat_set(v, 0);
00351         m_left_p->concat_set(v, m_len_r);
00352         return *this;
00353     }
00354 
00355     const sc_concatref& operator = ( const sc_concatref& v )
00356     {
00357         sc_unsigned temp(v.length());
00358         temp = v.value();
00359         m_right_p->concat_set(temp, 0);
00360         m_left_p->concat_set(temp, m_len_r);
00361         return *this;
00362     }
00363 
00364     const sc_concatref& operator = ( const sc_signed& v )
00365     {
00366         m_right_p->concat_set(v, 0);
00367         m_left_p->concat_set(v, m_len_r);
00368         return *this;
00369     }
00370 
00371     const sc_concatref& operator = ( const sc_unsigned& v )
00372     {
00373         m_right_p->concat_set(v, 0);
00374         m_left_p->concat_set(v, m_len_r);
00375         return *this;
00376     }
00377 
00378     const sc_concatref& operator = ( const char* v_p )
00379     {
00380         sc_unsigned v(m_len);
00381         v = v_p;
00382         m_right_p->concat_set(v, 0);
00383         m_left_p->concat_set(v, m_len_r);
00384         return *this;
00385     }
00386 
00387     const sc_concatref& operator = ( const sc_bv_base& v )
00388     {
00389         sc_unsigned temp(v.length());
00390         temp = v;
00391         m_right_p->concat_set(temp, 0);
00392         m_left_p->concat_set(temp, m_len_r);
00393         return *this;
00394     }
00395 
00396     const sc_concatref& operator = ( const sc_lv_base& v )
00397     {
00398         sc_unsigned data(v.length());
00399         data = v;
00400         m_right_p->concat_set(data, 0);
00401         m_left_p->concat_set(data, m_len_r);
00402         return *this;
00403     }
00404 
00405 
00406     
00407 
00408     bool and_reduce() const
00409         { return value().and_reduce(); }
00410 
00411     bool nand_reduce() const
00412         { return value().nand_reduce(); }
00413 
00414     bool or_reduce() const
00415         { return value().or_reduce(); }
00416 
00417     bool nor_reduce() const
00418         { return value().nor_reduce(); }
00419 
00420     bool xor_reduce() const
00421         { return value().xor_reduce(); }
00422 
00423     bool xnor_reduce() const
00424         { return value().xnor_reduce(); }
00425 
00426     
00427 
00428     void print( ::std::ostream& os = ::std::cout ) const
00429         { os << this->value(); }
00430 
00431     void scan( ::std::istream& is ) 
00432     { 
00433         std::string s; 
00434         is >> s; 
00435         *this = s.c_str(); 
00436     } 
00437 
00438 public:
00439     static sc_core::sc_vpool<sc_concatref> m_pool; 
00440 
00441 public:
00442     enum concat_flags {
00443         cf_none = 0,        
00444         cf_xz_present = 1   
00445     };
00446 
00447 protected:
00448     sc_value_base*  m_left_p;    
00449     sc_value_base*  m_right_p;   
00450     int             m_len;       
00451     int             m_len_r;     
00452     concat_flags    m_flags;     
00453 
00454 private:
00455     sc_concatref(const sc_concatref&);
00456     sc_concatref() : m_left_p(0), m_right_p(0), m_len(0), m_len_r(0), m_flags()
00457       {}
00458 };
00459 
00460 
00461 
00462 
00463 inline
00464 bool
00465 and_reduce( const sc_concatref& a )
00466 {
00467     return a.and_reduce();
00468 }
00469 
00470 inline
00471 bool
00472 nand_reduce( const sc_concatref& a )
00473 {
00474     return a.nand_reduce();
00475 }
00476 
00477 inline
00478 bool
00479 or_reduce( const sc_concatref& a )
00480 {
00481     return a.or_reduce();
00482 }
00483 
00484 inline
00485 bool
00486 nor_reduce( const sc_concatref& a )
00487 {
00488     return a.nor_reduce();
00489 }
00490 
00491 inline
00492 bool
00493 xor_reduce( const sc_concatref& a )
00494 {
00495     return a.xor_reduce();
00496 }
00497 
00498 inline
00499 bool
00500 xnor_reduce( const sc_concatref& a )
00501 {
00502     return a.xnor_reduce();
00503 }
00504 
00505 
00506 
00507 
00508 
00509 
00510 
00511 
00512 
00513 inline const sc_unsigned operator << (const sc_concatref& target, uint64 shift)
00514 {
00515     return target.value() << (int)shift;
00516 }
00517 
00518 inline const sc_unsigned operator << (const sc_concatref& target, int64 shift)
00519 {
00520     return target.value() << (int)shift;
00521 }
00522 
00523 inline const sc_unsigned operator << ( 
00524     const sc_concatref& target, unsigned long shift )
00525 {
00526     return target.value() << (int)shift;
00527 }
00528 
00529 inline const sc_unsigned operator << ( 
00530     const sc_concatref& target, int shift )
00531 {
00532     return target.value() << shift;
00533 }
00534 
00535 inline const sc_unsigned operator << ( 
00536     const sc_concatref& target, unsigned int shift )
00537 {
00538     return target.value() << (int)shift;
00539 }
00540 
00541 inline const sc_unsigned operator << ( const sc_concatref& target, long shift )
00542 {
00543     return target.value() << (int)shift;
00544 }
00545 
00546 inline const sc_unsigned operator >> (const sc_concatref& target, uint64 shift)
00547 {
00548     return target.value() >> (int)shift;
00549 }
00550 
00551 inline const sc_unsigned operator >> (const sc_concatref& target, int64 shift)
00552 {
00553     return target.value() >> (int)shift;
00554 }
00555 
00556 inline const sc_unsigned operator >> ( 
00557     const sc_concatref& target, unsigned long shift )
00558 {
00559     return target.value() >> (int)shift;
00560 }
00561 
00562 inline const sc_unsigned operator >> ( 
00563     const sc_concatref& target, int shift )
00564 {
00565     return target.value() >> shift;
00566 }
00567 
00568 inline const sc_unsigned operator >> ( 
00569     const sc_concatref& target, unsigned int shift )
00570 {
00571     return target.value() >> (int)shift;
00572 }
00573 
00574 inline const sc_unsigned operator >> ( const sc_concatref& target, long shift )
00575 {
00576     return target.value() >> (int)shift;
00577 }
00578 
00579 
00580 
00581 
00582 inline
00583 ::std::ostream&
00584 operator << ( ::std::ostream& os, const sc_concatref& v )
00585 { 
00586     return os << v.value();
00587 }
00588 
00589 inline
00590 ::std::istream&
00591 operator >> ( ::std::istream& is, sc_concatref& a )
00592 {
00593     sc_unsigned temp(a.concat_length(0));   
00594     temp.scan( is );
00595     a = temp;
00596     return is;
00597 }
00598 
00599 
00600 
00601 
00602 
00603 
00604 
00605 
00606 class sc_concat_bool : public sc_value_base
00607 {
00608   protected:
00609     static sc_core::sc_vpool<sc_concat_bool> m_pool;  
00610     bool                                     m_value; 
00611 
00612   public:
00613 
00614     
00615     
00616     sc_concat_bool()
00617     : sc_value_base(), m_value()
00618     {}
00619 
00620     
00621 
00622     virtual ~sc_concat_bool() 
00623         { }
00624 
00625     
00626 
00627     static inline sc_concat_bool* allocate( bool v )
00628     {
00629         sc_concat_bool* result_p = m_pool.allocate();
00630         result_p->m_value = v;
00631         return result_p;
00632     }
00633 
00634     
00635 
00636     virtual int concat_length( bool* xz_present_p ) const
00637     { 
00638         if ( xz_present_p ) *xz_present_p = false;
00639         return 1; 
00640     }
00641 
00642     virtual bool concat_get_ctrl( sc_digit* dst_p, int low_i ) const
00643     {
00644         int bit = 1 << (low_i % BITS_PER_DIGIT); 
00645         int word_i = low_i / BITS_PER_DIGIT;
00646         dst_p[word_i] &= ~bit;
00647         return false;
00648     }
00649 
00650     virtual bool concat_get_data( sc_digit* dst_p, int low_i ) const
00651     {
00652         int bit = 1 << (low_i % BITS_PER_DIGIT); 
00653         int word_i = low_i / BITS_PER_DIGIT;
00654         if ( m_value )
00655             dst_p[word_i] |= bit;
00656         else 
00657             dst_p[word_i] &= ~bit;
00658         return m_value;
00659     }
00660 
00661     virtual uint64 concat_get_uint64() const
00662     {
00663         return m_value ? 1 : 0;
00664     }
00665 };
00666 
00667 
00668 
00669 
00670 
00671 
00672 #define SC_CONCAT_OP_TYPE(RESULT,OP,OTHER_TYPE) \
00673     inline RESULT operator OP ( const sc_concatref& a, OTHER_TYPE b ) \
00674     { \
00675         return a.value() OP b; \
00676     } \
00677     inline RESULT operator OP ( OTHER_TYPE a, const sc_concatref& b ) \
00678     { \
00679         return a OP b.value(); \
00680     } 
00681 
00682 
00683 #define SC_CONCAT_OP(RESULT,OP) \
00684     inline RESULT operator OP ( const sc_concatref& a, const sc_concatref& b ) \
00685     { \
00686         return a.value() OP b.value(); \
00687     }  \
00688     SC_CONCAT_OP_TYPE(const sc_signed,OP,int) \
00689     SC_CONCAT_OP_TYPE(const sc_signed,OP,long) \
00690     SC_CONCAT_OP_TYPE(const sc_signed,OP,int64) \
00691     SC_CONCAT_OP_TYPE(RESULT,OP,unsigned int) \
00692     SC_CONCAT_OP_TYPE(RESULT,OP,unsigned long) \
00693     SC_CONCAT_OP_TYPE(RESULT,OP,uint64) \
00694     SC_CONCAT_OP_TYPE(const sc_signed,OP,const sc_int_base&) \
00695     SC_CONCAT_OP_TYPE(RESULT,OP,const sc_uint_base&) \
00696     SC_CONCAT_OP_TYPE(const sc_signed,OP,const sc_signed&) \
00697     SC_CONCAT_OP_TYPE(RESULT,OP,const sc_unsigned&) \
00698     inline RESULT operator OP ( const sc_concatref& a, bool b ) \
00699     { \
00700         return a.value() OP (int)b; \
00701     } \
00702     inline RESULT operator OP ( bool a, const sc_concatref& b ) \
00703     { \
00704         return (int)a OP b.value(); \
00705     } 
00706 
00707 #define SC_CONCAT_BOOL_OP(OP) \
00708     inline bool operator OP ( const sc_concatref& a, const sc_concatref& b ) \
00709     { \
00710         return a.value() OP b.value(); \
00711     }  \
00712     SC_CONCAT_OP_TYPE(bool,OP,int) \
00713     SC_CONCAT_OP_TYPE(bool,OP,long) \
00714     SC_CONCAT_OP_TYPE(bool,OP,int64) \
00715     SC_CONCAT_OP_TYPE(bool,OP,unsigned int) \
00716     SC_CONCAT_OP_TYPE(bool,OP,unsigned long) \
00717     SC_CONCAT_OP_TYPE(bool,OP,uint64) \
00718     SC_CONCAT_OP_TYPE(bool,OP,const sc_int_base&) \
00719     SC_CONCAT_OP_TYPE(bool,OP,const sc_uint_base&) \
00720     SC_CONCAT_OP_TYPE(bool,OP,const sc_signed&) \
00721     SC_CONCAT_OP_TYPE(bool,OP,const sc_unsigned&) \
00722     inline bool operator OP ( const sc_concatref& a, bool b ) \
00723     { \
00724         return a.value() OP (int)b; \
00725     } \
00726     inline bool operator OP ( bool a, const sc_concatref& b ) \
00727     { \
00728         return (int)a OP b.value(); \
00729     } 
00730 
00731 SC_CONCAT_OP(const sc_unsigned,+)
00732 SC_CONCAT_OP(const sc_signed,-)
00733 SC_CONCAT_OP(const sc_unsigned,*)
00734 SC_CONCAT_OP(const sc_unsigned,/)
00735 SC_CONCAT_OP(const sc_unsigned,%)
00736 SC_CONCAT_OP(const sc_unsigned,&)
00737 SC_CONCAT_OP(const sc_unsigned,|)
00738 SC_CONCAT_OP(const sc_unsigned,^)
00739 SC_CONCAT_BOOL_OP(==)
00740 SC_CONCAT_BOOL_OP(<=)
00741 SC_CONCAT_BOOL_OP(>=)
00742 SC_CONCAT_BOOL_OP(!=)
00743 SC_CONCAT_BOOL_OP(>)
00744 SC_CONCAT_BOOL_OP(<)
00745 
00746 #undef SC_CONCAT_OP
00747 #undef SC_CONCAT_OP_TYPE
00748 
00749 
00750 
00751 
00752 
00753 
00754 inline sc_dt::sc_concatref& concat(
00755     sc_dt::sc_value_base& a, sc_dt::sc_value_base& b)
00756 {
00757     sc_dt::sc_concatref* result_p;     
00758 
00759     result_p = sc_dt::sc_concatref::m_pool.allocate();
00760     result_p->initialize( a, b );
00761     return *result_p;
00762 }
00763 
00764 inline 
00765 const
00766 sc_dt::sc_concatref& concat(
00767     const sc_dt::sc_value_base& a, const sc_dt::sc_value_base& b)
00768 {
00769     sc_dt::sc_concatref* result_p;     
00770 
00771     result_p = sc_dt::sc_concatref::m_pool.allocate();
00772     result_p->initialize( a, b );
00773     return *result_p;
00774 }
00775 
00776 inline 
00777 const
00778 sc_dt::sc_concatref& concat(const sc_dt::sc_value_base& a, bool b)
00779 {
00780     const sc_dt::sc_concat_bool* b_p;        
00781     sc_dt::sc_concatref*         result_p;   
00782 
00783     b_p = sc_dt::sc_concat_bool::allocate(b);
00784     result_p = sc_dt::sc_concatref::m_pool.allocate();
00785     result_p->initialize( a, *b_p );
00786     return *result_p;
00787 }
00788 
00789 inline 
00790 const
00791 sc_dt::sc_concatref& concat(bool a, const sc_dt::sc_value_base& b)
00792 {
00793     const sc_dt::sc_concat_bool* a_p;        
00794     sc_dt::sc_concatref*         result_p;   
00795 
00796     a_p = sc_dt::sc_concat_bool::allocate(a);
00797     result_p = sc_dt::sc_concatref::m_pool.allocate();
00798     result_p->initialize( *a_p, b );
00799     return *result_p;
00800 }
00801 
00802 inline sc_dt::sc_concatref& operator , (
00803     sc_dt::sc_value_base& a, sc_dt::sc_value_base& b)
00804 {
00805     sc_dt::sc_concatref* result_p;     
00806 
00807     result_p = sc_dt::sc_concatref::m_pool.allocate();
00808     result_p->initialize( a, b );
00809     return *result_p;
00810 }
00811 
00812 inline 
00813 const
00814 sc_dt::sc_concatref& operator , (
00815     const sc_dt::sc_value_base& a, const sc_dt::sc_value_base& b)
00816 {
00817     sc_dt::sc_concatref* result_p;     
00818 
00819     result_p = sc_dt::sc_concatref::m_pool.allocate();
00820     result_p->initialize( a, b );
00821     return *result_p;
00822 }
00823 
00824 inline 
00825 const
00826 sc_dt::sc_concatref& operator , (const sc_dt::sc_value_base& a, bool b)
00827 {
00828     const sc_dt::sc_concat_bool* b_p;      
00829     sc_dt::sc_concatref*         result_p; 
00830 
00831     b_p = sc_dt::sc_concat_bool::allocate(b);
00832     result_p = sc_dt::sc_concatref::m_pool.allocate();
00833     result_p->initialize( a, *b_p );
00834     return *result_p;
00835 }
00836 
00837 inline 
00838 const
00839 sc_dt::sc_concatref& operator , (bool a, const sc_dt::sc_value_base& b)
00840 {
00841     const sc_dt::sc_concat_bool* a_p;      
00842     sc_dt::sc_concatref*         result_p; 
00843 
00844     a_p = sc_dt::sc_concat_bool::allocate(a);
00845     result_p = sc_dt::sc_concatref::m_pool.allocate();
00846     result_p->initialize( *a_p, b );
00847     return *result_p;
00848 }
00849 
00850 } 
00851 
00852 #endif //  SC_CONCATREF_H
00853