Last change
on this file since 57 was
56,
checked in by meunier, 11 years ago
|
- Tried to fix a problem with echo
- Started to resolve some tests failing (often because of the test itself)
|
File size:
1.4 KB
|
Rev | Line | |
---|
[55] | 1 | |
---|
| 2 | |
---|
[1] | 3 | #include <iostream> |
---|
| 4 | |
---|
[55] | 5 | #include "systemc.h" |
---|
| 6 | #include "test.h" |
---|
[1] | 7 | |
---|
[55] | 8 | |
---|
[1] | 9 | using namespace std; |
---|
| 10 | |
---|
| 11 | |
---|
[55] | 12 | int sc_main (int argc, char ** argv) { |
---|
[1] | 13 | |
---|
[55] | 14 | sc_uint<17> a; |
---|
| 15 | sc_uint<3> b; |
---|
| 16 | sc_uint<2> c1; |
---|
| 17 | sc_uint<2> c2; |
---|
| 18 | sc_uint<5> d; |
---|
| 19 | sc_uint<7> e; |
---|
| 20 | sc_uint<1> f; |
---|
| 21 | sc_uint<16> g; |
---|
| 22 | sc_uint<8> h; |
---|
[56] | 23 | sc_uint<32> i; |
---|
| 24 | sc_uint<17> j; |
---|
[1] | 25 | |
---|
[55] | 26 | b = 0x7; |
---|
| 27 | c1 = 0x3; |
---|
| 28 | c2 = 0x1; |
---|
[56] | 29 | d = 0xA; |
---|
[55] | 30 | e = 0x11; |
---|
| 31 | g = 0xabcd; |
---|
[1] | 32 | |
---|
[56] | 33 | // Concatenation |
---|
| 34 | a = (b, (c1 | c2), d & (b, c1), e); |
---|
| 35 | j = (b, c1, d , e); |
---|
[1] | 36 | |
---|
[55] | 37 | f = b.range (0, 0); |
---|
| 38 | h = g.range (11, 4); |
---|
[56] | 39 | i = e; |
---|
[1] | 40 | |
---|
[55] | 41 | cout << "a = 0x" << hex << (unsigned int) a << " = " << a.to_string(SC_BIN) << "\n"; |
---|
| 42 | //ASSERT(a.to_string(SC_BIN) == "0b000000111100010001"); |
---|
[1] | 43 | |
---|
[55] | 44 | cout << "f = 0x" << hex << (unsigned int) f << " = " << f.to_string(SC_BIN) << "\n"; |
---|
| 45 | //ASSERT(f.to_string(SC_BIN) == "0b01"); |
---|
| 46 | |
---|
| 47 | cout << "h = 0x" << hex << (unsigned int) h << " = " << h.to_string(SC_BIN) << "\n"; |
---|
| 48 | //ASSERT(h.to_string(SC_BIN) == "0b010111100"); |
---|
| 49 | |
---|
[56] | 50 | cout << "i = 0x" << hex << (unsigned int) i << " = " << i.to_string(SC_BIN) << "\n"; |
---|
| 51 | cout << "j = 0x" << hex << (unsigned int) j << " = " << j.to_string(SC_BIN) << "\n"; |
---|
[55] | 52 | |
---|
| 53 | return 0; |
---|
[1] | 54 | } |
---|
| 55 | |
---|
[55] | 56 | |
---|
| 57 | /* |
---|
| 58 | # Local Variables: |
---|
| 59 | # tab-width: 4; |
---|
| 60 | # c-basic-offset: 4; |
---|
| 61 | # c-file-offsets:((innamespace . 0)(inline-open . 0)); |
---|
| 62 | # indent-tabs-mode: nil; |
---|
| 63 | # End: |
---|
| 64 | # |
---|
| 65 | # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 66 | */ |
---|
| 67 | |
---|
Note: See
TracBrowser
for help on using the repository browser.