| 1 | /*------------------------------------------------------------\ | 
|---|
| 2 | |                                                             | | 
|---|
| 3 | | Tool    :                  systemcass                       | | 
|---|
| 4 | |                                                             | | 
|---|
| 5 | | File    :                 sc_bv.h                           | | 
|---|
| 6 | |                                                             | | 
|---|
| 7 | | Author  :                 Buchmann Richard                  | | 
|---|
| 8 | |                                                             | | 
|---|
| 9 | | Date    :                   14_04_2005                      | | 
|---|
| 10 | |                                                             | | 
|---|
| 11 | \------------------------------------------------------------*/ | 
|---|
| 12 | #ifndef __SC_BV_H__ | 
|---|
| 13 | #define __SC_BV_H__ | 
|---|
| 14 |  | 
|---|
| 15 | // ---------------------------------------------------------------------------- | 
|---|
| 16 | //  CLASS : sc_bv | 
|---|
| 17 | // | 
|---|
| 18 | // ---------------------------------------------------------------------------- | 
|---|
| 19 |  | 
|---|
| 20 | #include "sc_nbdefs.h" | 
|---|
| 21 | #include "sc_logic.h" | 
|---|
| 22 | #include "sc_unsigned.h" | 
|---|
| 23 | #include "sc_signed.h" | 
|---|
| 24 | #include "sc_uint.h" | 
|---|
| 25 | #include "sc_int.h" | 
|---|
| 26 |  | 
|---|
| 27 | namespace sc_dt { | 
|---|
| 28 |  | 
|---|
| 29 | class sc_bv_base | 
|---|
| 30 | { | 
|---|
| 31 | public: | 
|---|
| 32 | // constructors | 
|---|
| 33 | /* | 
|---|
| 34 | explicit sc_bv_base (int length_ = sc_length_param ().len ()); | 
|---|
| 35 | explicit sc_bv_base (bool a, int length_ = sc_length_param ().len ()); | 
|---|
| 36 | */ | 
|---|
| 37 | sc_bv_base (const char *a); | 
|---|
| 38 | sc_bv_base (const char *a, int length_); | 
|---|
| 39 | template < class X > sc_bv_base (const sc_bv_base & a); | 
|---|
| 40 | virtual ~ sc_bv_base (); | 
|---|
| 41 | // assignment operators | 
|---|
| 42 | template < class X > sc_bv_base & operator = (const sc_bv_base & a); | 
|---|
| 43 | sc_bv_base & operator = (const char *a); | 
|---|
| 44 | sc_bv_base & operator = (const bool * a); | 
|---|
| 45 | sc_bv_base & operator = (const sc_logic * a); | 
|---|
| 46 | sc_bv_base & operator = (const sc_unsigned & a); | 
|---|
| 47 | sc_bv_base & operator = (const sc_signed & a); | 
|---|
| 48 | /* | 
|---|
| 49 | sc_bv_base & operator = (const sc_uint_base & a); | 
|---|
| 50 | sc_bv_base & operator = (const sc_int_base & a); | 
|---|
| 51 | */ | 
|---|
| 52 | sc_bv_base & operator = (unsigned long a); | 
|---|
| 53 | sc_bv_base & operator = (long a); | 
|---|
| 54 | sc_bv_base & operator = (unsigned int a); | 
|---|
| 55 | sc_bv_base & operator = (int a); | 
|---|
| 56 | sc_bv_base & operator = (uint64 a); | 
|---|
| 57 | sc_bv_base & operator = (int64 a); | 
|---|
| 58 |  | 
|---|
| 59 | // methods | 
|---|
| 60 | int length () const; | 
|---|
| 61 | bool is_01 () const; | 
|---|
| 62 | }; | 
|---|
| 63 |  | 
|---|
| 64 |  | 
|---|
| 65 | template < int W > class sc_bv:public sc_bv_base | 
|---|
| 66 | { | 
|---|
| 67 | public: | 
|---|
| 68 | // constructors | 
|---|
| 69 | sc_bv (); | 
|---|
| 70 | explicit sc_bv (bool init_value); | 
|---|
| 71 | explicit sc_bv (char init_value); | 
|---|
| 72 | sc_bv (const char *a); | 
|---|
| 73 | sc_bv (const bool * a); | 
|---|
| 74 | sc_bv (const sc_logic * a); | 
|---|
| 75 | sc_bv (const sc_unsigned & a); | 
|---|
| 76 | sc_bv (const sc_signed & a); | 
|---|
| 77 | /* | 
|---|
| 78 | sc_bv (const sc_uint_base & a); | 
|---|
| 79 | sc_bv (const sc_int_base & a); | 
|---|
| 80 | */ | 
|---|
| 81 | sc_bv (unsigned long a); | 
|---|
| 82 | sc_bv (long a); | 
|---|
| 83 | sc_bv (unsigned int a); | 
|---|
| 84 | sc_bv (int a); | 
|---|
| 85 | sc_bv (uint64 a); | 
|---|
| 86 | sc_bv (int64 a); | 
|---|
| 87 | sc_bv (const sc_bv_base & a); | 
|---|
| 88 | sc_bv (const sc_bv < W > &a); | 
|---|
| 89 | // assignment operators | 
|---|
| 90 | template < class X > sc_bv < W > &operator = (const sc_bv_base & a); | 
|---|
| 91 | sc_bv < W > &operator = (const sc_bv < W > &a); | 
|---|
| 92 | sc_bv < W > &operator = (const char *a); | 
|---|
| 93 | sc_bv < W > &operator = (const bool * a); | 
|---|
| 94 | sc_bv < W > &operator = (const sc_logic * a); | 
|---|
| 95 | sc_bv < W > &operator = (const sc_unsigned & a); | 
|---|
| 96 | sc_bv < W > &operator = (const sc_signed & a); | 
|---|
| 97 | /* | 
|---|
| 98 | sc_bv < W > &operator = (const sc_uint_base & a); | 
|---|
| 99 | sc_bv < W > &operator = (const sc_int_base & a); | 
|---|
| 100 | */ | 
|---|
| 101 | sc_bv < W > &operator = (unsigned long a); | 
|---|
| 102 | sc_bv < W > &operator = (long a); | 
|---|
| 103 | sc_bv < W > &operator = (unsigned int a); | 
|---|
| 104 | sc_bv < W > &operator = (int a); | 
|---|
| 105 | sc_bv < W > &operator = (uint64 a); | 
|---|
| 106 | sc_bv < W > &operator = (int64 a); | 
|---|
| 107 | }; | 
|---|
| 108 |  | 
|---|
| 109 | } /* end of sc_dt namespace */ | 
|---|
| 110 |  | 
|---|
| 111 | #endif /* __SC_BV_H__ */ | 
|---|