Changeset 113 for trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/SelfTest/src/top_test.cpp
- Timestamp:
- Apr 14, 2009, 8:39:12 PM (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/SelfTest/src/top_test.cpp
r111 r113 7 7 */ 8 8 9 #include "Behavioural/@DIRECTORY/SelfTest/include/t est.h"9 #include "Behavioural/@DIRECTORY/SelfTest/include/top.h" 10 10 #include "Behavioural/include/Allocation.h" 11 11 12 void test (string name, 13 morpheo::behavioural::@NAMESPACE_USE::Parameters * _param) 12 void top::test (void) 14 13 { 15 msg(_("<%s> : Simulation SystemC.\n"),name.c_str());16 17 if (setlocale (LC_ALL, "") == NULL)18 msg(_("setlocale ko.\n"));19 20 #ifdef STATISTICS21 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX);22 #endif23 24 Tusage_t _usage = USE_ALL;25 26 // _usage = usage_unset(_usage,USE_SYSTEMC );27 // _usage = usage_unset(_usage,USE_VHDL );28 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH );29 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);30 // _usage = usage_unset(_usage,USE_POSITION );31 // _usage = usage_unset(_usage,USE_STATISTICS );32 // _usage = usage_unset(_usage,USE_INFORMATION );33 34 @COMPONENT * _@COMPONENT = new @COMPONENT35 (name.c_str(),36 #ifdef STATISTICS37 _parameters_statistics,38 #endif39 _param,40 _usage);41 42 14 #ifdef SYSTEMC 43 15 if (usage_is_set(_usage,USE_SYSTEMC)) 44 16 { 45 /********************************************************************* 46 * Déclarations des signaux 47 *********************************************************************/ 48 string rename; 49 50 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 51 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 52 53 /******************************************************** 54 * Instanciation 55 ********************************************************/ 56 57 msg(_("<%s> : Instanciation of _@COMPONENT.\n"),name.c_str()); 58 59 (*(_@COMPONENT->in_CLOCK)) (*(in_CLOCK)); 60 (*(_@COMPONENT->in_NRESET)) (*(in_NRESET)); 61 62 63 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); 64 65 Time * _time = new Time(); 66 67 /******************************************************** 68 * Simulation - Begin 69 ********************************************************/ 70 71 // Initialisation 72 73 const uint32_t seed = 0; 74 //const uint32_t seed = static_cast<uint32_t>(time(NULL)); 75 76 srand(seed); 77 78 SC_START(0); 79 LABEL("Initialisation"); 80 81 LABEL("Reset"); 82 in_NRESET->write(0); 83 SC_START(5); 84 in_NRESET->write(1); 85 86 LABEL("Loop of Test"); 87 88 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 89 { 90 LABEL("Iteration %d",iteration); 91 92 SC_START(1); 93 } 94 95 /******************************************************** 96 * Simulation - End 97 ********************************************************/ 98 99 TEST_OK ("End of Simulation"); 100 delete _time; 101 102 msg(_("<%s> : ............ Stop Simulation\n"),name.c_str()); 103 104 delete in_CLOCK; 105 delete in_NRESET; 17 msgInformation(_("<%s> : Start Simulation ............\n"),name.c_str()); 18 19 Time * _time = new Time(); 20 21 /******************************************************** 22 * Simulation - Begin 23 ********************************************************/ 24 25 // Initialisation 26 27 const uint32_t seed = 0; 28 //const uint32_t seed = static_cast<uint32_t>(time(NULL)); 29 30 srand(seed); 31 32 SC_CYCLE(0); 33 LABEL("Initialisation"); 34 35 LABEL("Reset"); 36 in_NRESET->write(0); 37 SC_CYCLE(5); 38 in_NRESET->write(1); 39 40 LABEL("Loop of Test"); 41 42 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 43 { 44 LABEL("Iteration %d",iteration); 45 46 SC_CYCLE(1); 47 } 48 49 /******************************************************** 50 * Simulation - End 51 ********************************************************/ 52 53 TEST_OK (""); 54 55 sc_stop(); 56 delete _time; 57 58 msgInformation(_("<%s> : ............ Stop Simulation\n"),name.c_str()); 106 59 } 107 60 #endif 108 109 delete _@COMPONENT;110 #ifdef STATISTICS111 delete _parameters_statistics;112 #endif113 61 }
Note: See TracChangeset
for help on using the changeset viewer.