- Timestamp:
- Apr 14, 2009, 8:39:12 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst
- Files:
-
- 4 added
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/Makefile.defs
r82 r113 7 7 # 8 8 9 ENTITY = @COMPONENT 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = @DIR_MORPHEO -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/SelfTest/include/top.h
r111 r113 4 4 * [ Description ] 5 5 * 6 * Test " RegisterFile"6 * Test "@COMPONENT" 7 7 */ 8 8 … … 18 18 #include "Behavioural/@DIRECTORY/include/@COMPONENT.h" 19 19 20 #include <string>21 #include <iostream>22 #include <sys/time.h>23 24 20 using namespace std; 25 21 using namespace morpheo; … … 28 24 using namespace morpheo::behavioural::@NAMESPACE_USE; 29 25 30 void test (string name, 31 morpheo::behavioural::@NAMESPACE_USE::Parameters * param); 26 SC_MODULE(top) 27 { 28 #ifdef SYSTEMC 29 private: sc_clock * in_CLOCK ; 30 private: sc_signal<Tcontrol_t> * in_NRESET; 31 #endif 32 33 private: std::string name; 34 private: Tusage_t _usage; 35 private: morpheo::behavioural::@NAMESPACE_USE::Parameters * _param; 36 #ifdef STATISTICS 37 private: morpheo::behavioural::Parameters_Statistics * _param_stat; 38 #endif 39 private: @COMPONENT * component; 40 41 private: void usage 42 ( 43 #ifdef MTI_SYSTEMC 44 int argc, const char * const * argv 45 #else 46 int argc, char * argv[] 47 #endif 48 ); 49 private: void allocation (void); 50 private: void deallocation (void); 51 public : void test (void); 52 53 #ifdef MTI_SYSTEMC 54 SC_CTOR(top::top); 55 #else 56 public : top (sc_module_name module_name,int argc, char * argv[]); 57 #endif 58 public : ~top(void); 59 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/SelfTest/src/main.cpp
r88 r113 6 6 */ 7 7 8 #include "Behavioural/@DIRECTORY/SelfTest/include/t est.h"8 #include "Behavioural/@DIRECTORY/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 0 10 #ifndef MTI_SYSTEMC 11 # ifndef SYSTEMC 12 int main (int argc, char * argv[]) 13 # else 14 int sc_main (int argc, char * argv[]) 15 # endif 16 { 17 int _return = EXIT_SUCCESS; 11 18 12 void usage (int argc, char * argv[])13 {14 err (_("<Usage> %s name_instance list_params.\n"),argv[0]);15 err (_("list_params is :\n"));16 err (_(" * ()\n"));17 18 exit (1);19 }20 21 #ifndef SYSTEMC22 int main (int argc, char * argv[])23 #else24 int sc_main (int argc, char * argv[])25 #endif26 {27 if (argc != static_cast<int>(2+NB_PARAMS))28 usage (argc, argv);29 30 uint32_t x = 1;31 32 string name = argv[x++];33 34 int _return = EXIT_SUCCESS;35 19 try 36 20 { 37 morpheo::behavioural::@NAMESPACE_USE::Parameters * param = new morpheo::behavioural::@NAMESPACE_USE::Parameters 38 ( 39 true // is_toplevel 40 ); 41 42 msg(_("%s"),param->print(0).c_str()); 43 44 test (name,param); 21 top * my_top = new top ("my_top",argc,argv); 22 23 my_top->test(); 24 25 delete my_top; 45 26 } 46 27 catch (morpheo::ErrorMorpheo & error) 47 28 { 48 msg (_("<%s> :\n%s"),name.c_str(),error.what ());29 msgError(_("%s\n"),error.what ()); 49 30 _return = EXIT_FAILURE; 50 31 } 51 32 52 33 try 53 34 { … … 59 40 catch (morpheo::ErrorMorpheo & error) 60 41 { 61 // msg(_("<%s> :\n%s"),name.c_str(), error.what ());42 // msgError(_("<%s> :\n%s"),name.c_str(), error.what ()); 62 43 _return = EXIT_FAILURE; 63 44 } 64 45 65 return (_return);46 return _return; 66 47 } 48 #endif -
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 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/src/New_Component_allocation.cpp
r83 r113 30 30 31 31 Entity * entity = _component->set_entity (_name 32 , "@COMPONENT"32 ,_param->_type 33 33 #ifdef POSITION 34 34 ,COMBINATORY -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/src/New_Component_statistics_allocation.cpp
r82 r113 20 20 21 21 _stat = new Stat (static_cast<std::string>(_name), 22 "@COMPONENT",22 _param->_type, 23 23 param_statistics); 24 24 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/src/Parameters.cpp
r88 r113 14 14 #undef FUNCTION 15 15 #define FUNCTION "@COMPONENT::Parameters" 16 Parameters::Parameters (bool is_toplevel) 16 Parameters::Parameters (bool is_toplevel): 17 behavioural::Parameters ("@COMPONENT") 17 18 { 18 19 log_begin(@COMPONENT,FUNCTION);
Note: See TracChangeset
for help on using the changeset viewer.