- Timestamp:
- Aug 17, 2007, 6:00:56 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/include/test.h
r2 r50 13 13 #include <string> 14 14 #include <iostream> 15 #include <sys/time.h> 15 16 16 17 #include "Behavioural/@DIRECTORY/include/@COMPONENT.h" … … 23 24 24 25 void test (string name, 25 morpheo::behavioural::@NAMESPACE_USE::Parameters param); 26 morpheo::behavioural::@NAMESPACE_USE::Parameters * param); 27 28 class Time 29 { 30 private : timeval time_begin; 31 // private : timeval time_end; 32 33 public : Time () 34 { 35 gettimeofday(&time_begin ,NULL); 36 }; 37 38 public : ~Time () 39 { 40 cout << *this; 41 }; 42 43 public : friend ostream& operator<< (ostream& output_stream, 44 const Time & x) 45 { 46 timeval time_end; 47 48 gettimeofday(&time_end ,NULL); 49 50 uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time()); 51 52 double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec); 53 54 output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl; 55 56 return output_stream; 57 } 58 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp
r15 r50 40 40 try 41 41 { 42 morpheo::behavioural::@NAMESPACE_USE::Parameters param (//size_data, 43 //nb_port 44 ); 42 morpheo::behavioural::@NAMESPACE_USE::Parameters * param = new morpheo::behavioural::@NAMESPACE_USE::Parameters 43 (//size_data, 44 //nb_port 45 ); 45 46 46 cout << param .print(1);47 cout << param->print(1); 47 48 48 49 test (name,param); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/test.cpp
r44 r50 7 7 */ 8 8 9 #define NB_ITERATION 110 11 #define LABEL(str) do {cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; _@COMPONENT->vhdl_testbench_label(str);} while (0)12 13 9 #include "Behavioural/@DIRECTORY/SelfTest/include/test.h" 14 10 #include "Common/include/Test.h" 15 11 12 #define NB_ITERATION 1 13 #define CYCLE_MAX (128*NB_ITERATION) 14 15 #define LABEL(str) \ 16 { \ 17 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; \ 18 } while(0) 19 20 #define SC_START(cycle) \ 21 do \ 22 { \ 23 if (static_cast<uint32_t>(sc_simulation_time()) > CYCLE_MAX) \ 24 { \ 25 TEST_KO("Maximal cycles Reached"); \ 26 } \ 27 sc_start(cycle); \ 28 } while(0) 29 16 30 void test (string name, 17 morpheo::behavioural::@NAMESPACE_USE::Parameters _param)31 morpheo::behavioural::@NAMESPACE_USE::Parameters * _param) 18 32 { 19 33 cout << "<" << name << "> : Simulation SystemC" << endl; … … 23 37 morpheo::behavioural::Parameters_Statistics(5,50), 24 38 #endif 25 _param);39 *_param); 26 40 27 41 #ifdef SYSTEMC … … 48 62 49 63 cout << "<" << name << "> Start Simulation ............" << endl; 64 Time * _time = new Time(); 50 65 51 66 /******************************************************** … … 60 75 srand(seed); 61 76 62 sc_start(0);77 SC_START(0); 63 78 LABEL("Initialisation"); 64 79 … … 69 84 LABEL("Iteration "+toString(iteration)); 70 85 71 sc_start(1);86 SC_START(1); 72 87 } 73 88 … … 76 91 ********************************************************/ 77 92 93 TEST_OK ("End of Simulation"); 94 delete _time; 78 95 cout << "<" << name << "> ............ Stop Simulation" << endl; 79 96 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h
r44 r50 100 100 #if VHDL 101 101 public : void vhdl (void); 102 private : void vhdl_declaration (Vhdl & vhdl);103 private : void vhdl_body (Vhdl & vhdl);102 private : void vhdl_declaration (Vhdl * & vhdl); 103 private : void vhdl_body (Vhdl * & vhdl); 104 104 #endif 105 105 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_allocation.cpp
r42 r50 22 22 23 23 Entity * entity = _component->set_entity (_name 24 ,"@COMPONENT" 24 25 #ifdef POSITION 25 ,"@COMPONENT"26 26 ,COMBINATORY 27 27 #endif … … 40 40 ); 41 41 42 in_CLOCK = interface->set_signal_clk ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO); 43 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1); 44 42 in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); 43 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); 45 44 46 45 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 50 49 #endif 51 50 52 Log_printf(FUNC,@COMPONENT,"allocation","End");51 log_printf(FUNC,@COMPONENT,"allocation","End"); 53 52 }; 54 53 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl.cpp
r42 r50 18 18 log_printf(FUNC,@COMPONENT,"vhdl","Begin"); 19 19 20 Vhdl vhdl (_name);20 Vhdl * vhdl = new Vhdl (_name); 21 21 22 22 _interfaces->set_port(vhdl); … … 26 26 vhdl_body (vhdl); 27 27 28 vhdl .generate_file();28 vhdl->generate_file(); 29 29 30 30 delete vhdl; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_body.cpp
r2 r50 13 13 @NAMESPACE_BEGIN 14 14 15 void @COMPONENT::vhdl_body (Vhdl & vhdl)15 void @COMPONENT::vhdl_body (Vhdl * & vhdl) 16 16 { 17 17 log_printf(FUNC,@COMPONENT,"vhdl_body","Begin"); 18 vhdl .set_body ("");18 vhdl->set_body (""); 19 19 log_printf(FUNC,@COMPONENT,"vhdl_body","End"); 20 20 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_declaration.cpp
r2 r50 13 13 @NAMESPACE_BEGIN 14 14 15 void @COMPONENT::vhdl_declaration (Vhdl & vhdl)15 void @COMPONENT::vhdl_declaration (Vhdl * & vhdl) 16 16 { 17 17 log_printf(FUNC,@COMPONENT,"vhdl_declaration","Begin");
Note: See TracChangeset
for help on using the changeset viewer.