Last change
on this file since 61 was
60,
checked in by meunier, 8 years ago
|
- Intégration des modifications de Clément,
qui a intégré la version parallélisée de systemcass
faite par Manuel.
|
File size:
1.5 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 | |
---|
[60] | 41 | // Setup number of threads open-mp to 1 with the macro threads_omp() |
---|
| 42 | threads_omp(); |
---|
| 43 | |
---|
[55] | 44 | cout << "a = 0x" << hex << (unsigned int) a << " = " << a.to_string(SC_BIN) << "\n"; |
---|
| 45 | //ASSERT(a.to_string(SC_BIN) == "0b000000111100010001"); |
---|
[1] | 46 | |
---|
[55] | 47 | cout << "f = 0x" << hex << (unsigned int) f << " = " << f.to_string(SC_BIN) << "\n"; |
---|
| 48 | //ASSERT(f.to_string(SC_BIN) == "0b01"); |
---|
| 49 | |
---|
| 50 | cout << "h = 0x" << hex << (unsigned int) h << " = " << h.to_string(SC_BIN) << "\n"; |
---|
| 51 | //ASSERT(h.to_string(SC_BIN) == "0b010111100"); |
---|
| 52 | |
---|
[56] | 53 | cout << "i = 0x" << hex << (unsigned int) i << " = " << i.to_string(SC_BIN) << "\n"; |
---|
| 54 | cout << "j = 0x" << hex << (unsigned int) j << " = " << j.to_string(SC_BIN) << "\n"; |
---|
[55] | 55 | |
---|
| 56 | return 0; |
---|
[1] | 57 | } |
---|
| 58 | |
---|
[55] | 59 | |
---|
| 60 | /* |
---|
| 61 | # Local Variables: |
---|
| 62 | # tab-width: 4; |
---|
| 63 | # c-basic-offset: 4; |
---|
| 64 | # c-file-offsets:((innamespace . 0)(inline-open . 0)); |
---|
| 65 | # indent-tabs-mode: nil; |
---|
| 66 | # End: |
---|
| 67 | # |
---|
| 68 | # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 69 | */ |
---|
| 70 | |
---|
Note: See
TracBrowser
for help on using the repository browser.