source: sources/test_regression/15042009c/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.4 KB
Line 
1
2#include <iostream>
3
4#include "systemc.h"
5#include "test.h"
6
7
8using namespace std;
9
10
11typedef sc_uint<36> data_type; 
12
13
14class param_t {
15    public:
16    static const unsigned int B = 36;
17    typedef sc_dt::sc_uint<B> be_t;
18};
19
20
21template <typename param_t>
22class test_t {
23    public:
24    typedef typename param_t::be_t test_be_t;
25
26    test_be_t test_be;
27};
28
29
30int sc_main (int argc, char ** argv) {
31    sc_uint<36> a;
32    const long long int ca = 0xf00000000LLU;
33    a = ca;
34
35    // Setup number of threads open-mp to 1 with the macro threads_omp()
36    threads_omp();
37
38    test_t<param_t> test1, test2;
39    test1.test_be = a;
40    test2.test_be = ca;
41
42    if (test1.test_be != test2.test_be) {
43        return 1;
44    }
45
46    bool ret = (test1.test_be == a);
47    if (!ret) {
48        return 1;
49    }
50
51    cout << "OK" << endl;
52    return 0;
53
54    /* the following should be compiled and not executed */
55    // QM : je ne sais pas pourquoi ; je n'ai pas cherché mais ça seg faulte...
56    sc_signal<test_t<param_t>::test_be_t > sig_test;
57    sig_test = test1.test_be;
58
59    ret = (sig_test.read() == test2.test_be); /* OK */
60    if (!ret) {
61        return 1;
62    }
63
64    return 0;
65}
66
67
68/*
69# Local Variables:
70# tab-width: 4;
71# c-basic-offset: 4;
72# c-file-offsets:((innamespace . 0)(inline-open . 0));
73# indent-tabs-mode: nil;
74# End:
75#
76# vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
77*/
78
Note: See TracBrowser for help on using the repository browser.