- Timestamp:
- Apr 5, 2007, 4:17:30 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp
r2 r15 10 10 #define NB_PARAMS 0 11 11 12 void usage ( string exec)12 void usage (int argc, char * argv[]) 13 13 { 14 cerr << "<Usage> " << exec<< " name_instance list_params" << endl15 << "list_params is :" << endl ;14 cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl 15 << "list_params is :" << endl 16 16 // << " - size_data (unsigned int)" << endl 17 17 // << " - nb_port (unsigned int)" << endl; 18 << "" << endl; 19 20 for (int i=0; i<argc; i++) 21 cerr << argv[i] << " "; 22 cerr << endl; 18 23 19 24 exit (1); … … 26 31 #endif 27 32 { 28 if (argc !=2+NB_PARAMS)29 usage (arg v[0]);33 if (argc < 2+NB_PARAMS) 34 usage (argc, argv); 30 35 31 36 const string name = argv[1]; … … 46 51 { 47 52 cout << "<" << name << "> : " << error.what (); 48 return;53 exit (EXIT_FAILURE); 49 54 } 50 55 catch (...) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/test.cpp
r2 r15 9 9 #define NB_ITERATION 1 10 10 11 #define LABEL(str) do {cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; _@COMPONENT->vhdl_testbench_label(str);} while (0) 12 11 13 #include "Behavioural/@DIRECTORY/SelfTest/include/test.h" 12 14 #include "Include/Test.h" 13 15 14 16 void test (string name, 15 morpheo::behavioural::@NAMESPACE_USE::Parameters param)17 morpheo::behavioural::@NAMESPACE_USE::Parameters _param) 16 18 { 17 19 cout << "<" << name << "> : Simulation SystemC" << endl; … … 21 23 morpheo::behavioural::Parameters_Statistics(5,50), 22 24 #endif 23 param);25 _param); 24 26 25 27 #ifdef SYSTEMC … … 28 30 *********************************************************************/ 29 31 sc_clock * CLOCK; 30 32 sc_signal<Tcontrol_t> * NRESET; 31 33 32 34 string rename; 33 35 34 36 CLOCK = new sc_clock ("clock", 1.0, 0.5); 37 NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 35 38 36 39 /******************************************************** … … 41 44 42 45 (*(_@COMPONENT->in_CLOCK)) (*(CLOCK)); 46 (*(_@COMPONENT->in_NRESET)) (*(NRESET)); 47 48 49 cout << "<" << name << "> Start Simulation ............" << endl; 43 50 44 51 /******************************************************** … … 46 53 ********************************************************/ 47 54 48 cout << "<" << name << "> Start Simulation ............" << endl;49 55 // Initialisation 50 56 … … 55 61 56 62 sc_start(0); 57 _@COMPONENT->vhdl_testbench_label("Initialisation"); 58 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl; 63 LABEL("Initialisation"); 59 64 60 61 _@COMPONENT->vhdl_testbench_label("Loop of Test"); 62 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl; 65 LABEL("Loop of Test"); 63 66 64 67 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 65 68 { 66 _@COMPONENT->vhdl_testbench_label("Iteration "+toString(iteration));69 LABEL("Iteration "+toString(iteration)); 67 70 68 71 sc_start(1); … … 75 78 cout << "<" << name << "> ............ Stop Simulation" << endl; 76 79 80 delete CLOCK; 81 delete NRESET; 77 82 #endif 78 83
Note: See TracChangeset
for help on using the changeset viewer.