- Timestamp:
- Apr 14, 2009, 8:39:12 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe
- Files:
-
- 6 added
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/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_vbe/SelfTest/include/top.h
r111 r113 4 4 * [ Description ] 5 5 * 6 * Test " RegisterFile"6 * Test "@COMPONENT" 7 7 */ 8 8 … … 24 24 using namespace morpheo::behavioural::@NAMESPACE_USE; 25 25 26 void test (string name, 27 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_vbe/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 } … … 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_vbe/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_vbe/include/New_Component.h
r82 r113 13 13 #endif 14 14 15 15 #include "Behavioural/@DIRECTORY/include/Wrapper_@COMPONENT.h" 16 16 #include "Behavioural/@DIRECTORY/include/Parameters.h" 17 17 #include "Behavioural/@DIRECTORY/include/Types.h" … … 24 24 #endif 25 25 #include "Behavioural/include/Usage.h" 26 #include "Behavioural/include/Simulation.h" 26 27 27 28 #include "Common/include/ToString.h" … … 44 45 protected : const std::string _name; 45 46 protected : const Parameters * _param; 46 p rivate : constTusage_t _usage;47 public : Tusage_t _usage; 47 48 48 49 #ifdef STATISTICS … … 59 60 public : SC_IN (Tcontrol_t) * in_NRESET ; 60 61 61 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 63 63 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 64 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 64 65 65 66 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 67 #endif 68 69 #ifdef MODELSIM_COSIMULATION 70 // ~~~~~[ Wrapper ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 private : Wrapper_@COMPONENT * _wrapper; 66 72 #endif 67 73 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/include/Parameters.h
r88 r113 29 29 public : Parameters_test msg_error (void); 30 30 31 public : std::string id (void); 32 31 33 public : std::string print (uint32_t depth); 32 34 public : friend std::ostream& operator<< (std::ostream& output_stream, -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component.cpp
r88 r113 29 29 _name (name) 30 30 ,_param (param) 31 ,_usage (usage)32 31 { 33 32 log_begin(@COMPONENT,FUNCTION); 34 33 35 usage_environment(_usage); 34 _usage = usage_environment(usage); 35 36 #ifdef MODELSIM_COSIMULATION 37 if (_model.get_type(_param->_type) == MODEL_VHDL) 38 { 39 _usage = usage_cosimulation(_usage); 40 } 41 #endif 36 42 37 43 log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation"),_name.c_str()); … … 63 69 64 70 #ifdef SYSTEMC 65 if (usage_is_set(_usage,USE_SYSTEMC ))71 if (usage_is_set(_usage,USE_SYSTEMC_BODY)) 66 72 { 67 73 log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); … … 85 91 // # endif 86 92 93 } 87 94 #endif 88 } 95 89 96 log_end(@COMPONENT,FUNCTION); 90 97 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component_allocation.cpp
r82 r113 10 10 #include "Common/include/Max.h" 11 11 12 namespace morpheo 12 namespace morpheo { 13 13 namespace behavioural { 14 14 @NAMESPACE_BEGIN … … 30 30 31 31 Entity * entity = _component->set_entity (_name 32 , "@COMPONENT"32 ,_param->_type 33 33 #ifdef POSITION 34 34 ,COMBINATORY … … 58 58 #endif 59 59 60 #ifdef MODELSIM_COSIMULATION 61 if (usage_is_set(_usage,USE_COSIMULATION)) 62 { 63 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> : Create Wrapper"),_name.c_str()); 64 65 _wrapper = new Wrapper_@COMPONENT (_name.c_str(),"morpheo_behavioural","work"); 66 } 67 #endif 68 60 69 log_end(@COMPONENT,FUNCTION); 61 70 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component_deallocation.cpp
r82 r113 19 19 log_begin(@COMPONENT,FUNCTION); 20 20 21 if (usage_is_set(_usage,USE_SYSTEMC))22 { 23 delete in_CLOCK;24 delete in_NRESET;21 // if (usage_is_set(_usage,USE_SYSTEMC_INTERFACE)) 22 { 23 DELETE0_SIGNAL( in_CLOCK ,1); 24 DELETE0_SIGNAL( in_NRESET,1); 25 25 } 26 26 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 27 28 28 delete _component; 29 30 #ifdef MODELSIM_COSIMULATION 31 if (usage_is_set(_usage,USE_COSIMULATION)) 32 { 33 delete _wrapper; 34 } 35 #endif 29 36 30 37 log_end(@COMPONENT,FUNCTION); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/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_vbe/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); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/Parameters_msg_error.cpp
r82 r113 20 20 log_begin(@COMPONENT,FUNCTION); 21 21 22 Parameters_test test ( "@COMPONENT");22 Parameters_test test (_type); 23 23 24 24 log_end(@COMPONENT,FUNCTION);
Note: See TracChangeset
for help on using the changeset viewer.