source: sources/test_regression/07052005/system.cpp @ 60

Last change on this file since 60 was 60, checked in by meunier, 7 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
Line 
1
2
3#include <iostream>
4
5#include "systemc.h"
6#include "test.h"
7
8
9using namespace std;
10
11
12int 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    // Setup number of threads open-mp to 1 with the macro threads_omp()
42    threads_omp();
43
44    cout << "a = 0x" << hex << (unsigned int) a << " = " << a.to_string(SC_BIN) << "\n";
45    //ASSERT(a.to_string(SC_BIN) == "0b000000111100010001");
46
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
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
56    return 0;
57}
58
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.