Last change
on this file since 58 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
|
Line | |
---|
1 | |
---|
2 | |
---|
3 | #include <iostream> |
---|
4 | |
---|
5 | #include "systemc.h" |
---|
6 | #include "test.h" |
---|
7 | |
---|
8 | |
---|
9 | using namespace std; |
---|
10 | |
---|
11 | |
---|
12 | int sc_main (int argc, char ** argv) { |
---|
13 | |
---|
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; |
---|
23 | sc_uint<32> i; |
---|
24 | sc_uint<17> j; |
---|
25 | |
---|
26 | b = 0x7; |
---|
27 | c1 = 0x3; |
---|
28 | c2 = 0x1; |
---|
29 | d = 0xA; |
---|
30 | e = 0x11; |
---|
31 | g = 0xabcd; |
---|
32 | |
---|
33 | // Concatenation |
---|
34 | a = (b, (c1 | c2), d & (b, c1), e); |
---|
35 | j = (b, c1, d , e); |
---|
36 | |
---|
37 | f = b.range (0, 0); |
---|
38 | h = g.range (11, 4); |
---|
39 | i = e; |
---|
40 | |
---|
41 | cout << "a = 0x" << hex << (unsigned int) a << " = " << a.to_string(SC_BIN) << "\n"; |
---|
42 | //ASSERT(a.to_string(SC_BIN) == "0b000000111100010001"); |
---|
43 | |
---|
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 | |
---|
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"; |
---|
52 | |
---|
53 | return 0; |
---|
54 | } |
---|
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.