1 | /* |
---|
2 | * $Id: top_allocation.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | * Test |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/@DIRECTORY/SelfTest/include/top.h" |
---|
10 | #include "Behavioural/include/Allocation.h" |
---|
11 | |
---|
12 | void top::allocation (void) |
---|
13 | { |
---|
14 | if (setlocale (LC_ALL, "") == NULL) |
---|
15 | msgWarning(_("setlocale ko.\n")); |
---|
16 | |
---|
17 | try |
---|
18 | { |
---|
19 | _param->test(); |
---|
20 | } |
---|
21 | catch (morpheo::ErrorMorpheo & error) |
---|
22 | { |
---|
23 | msgError(_("<%s> : %s"),name.c_str(),error.what()); |
---|
24 | return; |
---|
25 | } |
---|
26 | catch (...) |
---|
27 | { |
---|
28 | msgError(_("<%s> : This test must generate a error"),name.c_str()); |
---|
29 | exit (EXIT_FAILURE); |
---|
30 | } |
---|
31 | |
---|
32 | _usage = USE_ALL; |
---|
33 | // _usage = usage_unset(_usage,USE_SYSTEMC ); |
---|
34 | // _usage = usage_unset(_usage,USE_VHDL ); |
---|
35 | // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); |
---|
36 | // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); |
---|
37 | // _usage = usage_unset(_usage,USE_POSITION ); |
---|
38 | // _usage = usage_unset(_usage,USE_STATISTICS ); |
---|
39 | // _usage = usage_unset(_usage,USE_INFORMATION ); |
---|
40 | |
---|
41 | #ifdef STATISTICS |
---|
42 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
43 | _param_stat = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX); |
---|
44 | #endif |
---|
45 | |
---|
46 | component = new @COMPONENT |
---|
47 | (name.c_str(), |
---|
48 | #ifdef STATISTICS |
---|
49 | _param_stat, |
---|
50 | #endif |
---|
51 | _param, |
---|
52 | _usage |
---|
53 | ); |
---|
54 | |
---|
55 | #ifdef SYSTEMC |
---|
56 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
57 | { |
---|
58 | /********************************************************************* |
---|
59 | * Déclarations des signaux |
---|
60 | *********************************************************************/ |
---|
61 | msgInformation(_("<%s> : Create signal.\n"),name.c_str()); |
---|
62 | |
---|
63 | in_CLOCK = new sc_clock ("clock", TIME_PERIOD, TIME_UNIT, 0.5); //name,period,time_unit,duty_cycle |
---|
64 | |
---|
65 | ALLOC0_SC_SIGNAL( in_NRESET ," in_NRESET ",Tcontrol_t); |
---|
66 | |
---|
67 | /******************************************************** |
---|
68 | * Instanciation |
---|
69 | ********************************************************/ |
---|
70 | |
---|
71 | msgInformation(_("<%s> : Instanciation of _@COMPONENT.\n"),name.c_str()); |
---|
72 | |
---|
73 | INSTANCE0_SC_SIGNAL(component, in_CLOCK ); |
---|
74 | INSTANCE0_SC_SIGNAL(component, in_NRESET ); |
---|
75 | } |
---|
76 | #endif |
---|
77 | } |
---|