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 <stdint.h> |
---|
21 | |
---|
22 | #include "sc_nbdefs.h" |
---|
23 | #include "sc_logic.h" |
---|
24 | #include "sc_unsigned.h" |
---|
25 | #include "sc_signed.h" |
---|
26 | #include "sc_uint.h" |
---|
27 | #include "sc_int.h" |
---|
28 | |
---|
29 | namespace sc_dt { |
---|
30 | |
---|
31 | class sc_bv_base { |
---|
32 | public: |
---|
33 | // constructors |
---|
34 | sc_bv_base (const char * a); |
---|
35 | sc_bv_base (const char * a, int length_); |
---|
36 | template < class X > sc_bv_base (const sc_bv_base & a); |
---|
37 | virtual ~ sc_bv_base (); |
---|
38 | // assignment operators |
---|
39 | template < class X > sc_bv_base & operator = (const sc_bv_base & a); |
---|
40 | sc_bv_base & operator = (const char *a); |
---|
41 | sc_bv_base & operator = (const bool * a); |
---|
42 | sc_bv_base & operator = (const sc_logic * a); |
---|
43 | sc_bv_base & operator = (const sc_unsigned & a); |
---|
44 | sc_bv_base & operator = (const sc_signed & a); |
---|
45 | sc_bv_base & operator = (unsigned int a); |
---|
46 | sc_bv_base & operator = (unsigned long a); |
---|
47 | sc_bv_base & operator = (long a); |
---|
48 | sc_bv_base & operator = (int a); |
---|
49 | sc_bv_base & operator = (uint64 a); |
---|
50 | sc_bv_base & operator = (int64 a); |
---|
51 | |
---|
52 | // methods |
---|
53 | int length () const; |
---|
54 | bool is_01 () const; |
---|
55 | }; |
---|
56 | |
---|
57 | |
---|
58 | template < int W > |
---|
59 | class sc_bv : public sc_bv_base { |
---|
60 | public: |
---|
61 | // constructors |
---|
62 | sc_bv (); |
---|
63 | explicit sc_bv (bool init_value); |
---|
64 | explicit sc_bv (char init_value); |
---|
65 | sc_bv (const char *a); |
---|
66 | sc_bv (const bool * a); |
---|
67 | sc_bv (const sc_logic * a); |
---|
68 | sc_bv (const sc_unsigned & a); |
---|
69 | sc_bv (const sc_signed & a); |
---|
70 | sc_bv (unsigned int a); |
---|
71 | sc_bv (unsigned long a); |
---|
72 | sc_bv (long a); |
---|
73 | sc_bv (int a); |
---|
74 | sc_bv (uint64 a); |
---|
75 | sc_bv (int64 a); |
---|
76 | sc_bv (const sc_bv_base & a); |
---|
77 | sc_bv (const sc_bv < W > & a); |
---|
78 | // assignment operators |
---|
79 | template < class X > sc_bv < W > & operator = (const sc_bv_base & a); |
---|
80 | sc_bv < W > & operator = (const sc_bv < W > &a); |
---|
81 | sc_bv < W > & operator = (const char *a); |
---|
82 | sc_bv < W > & operator = (const bool * a); |
---|
83 | sc_bv < W > & operator = (const sc_logic * a); |
---|
84 | sc_bv < W > & operator = (const sc_unsigned & a); |
---|
85 | sc_bv < W > & operator = (const sc_signed & a); |
---|
86 | sc_bv < W > & operator = (unsigned int a); |
---|
87 | sc_bv < W > & operator = (unsigned long a); |
---|
88 | sc_bv < W > & operator = (long a); |
---|
89 | sc_bv < W > & operator = (int a); |
---|
90 | sc_bv < W > & operator = (uint64 a); |
---|
91 | sc_bv < W > & operator = (int64 a); |
---|
92 | }; |
---|
93 | |
---|
94 | } /* end of sc_dt namespace */ |
---|
95 | |
---|
96 | #endif /* __SC_BV_H__ */ |
---|
97 | |
---|
98 | /* |
---|
99 | # Local Variables: |
---|
100 | # tab-width: 4; |
---|
101 | # c-basic-offset: 4; |
---|
102 | # c-file-offsets:((innamespace . 0)(inline-open . 0)); |
---|
103 | # indent-tabs-mode: nil; |
---|
104 | # End: |
---|
105 | # |
---|
106 | # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
107 | */ |
---|
108 | |
---|