Changeset 113 for trunk/IPs/systemC/processor/Morpheo
- Timestamp:
- Apr 14, 2009, 8:39:12 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo
- Files:
-
- 54 added
- 1 deleted
- 249 edited
- 12 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Configuration 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Core_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Dcache_Access 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Icache_Access/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Icache_Access 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Core 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Execute_loop_Glue/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Execute_loop_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Execute_loop_Glue/SelfTest/src/test.cpp
r88 r113 48 48 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 49 49 50 sc_signal<Tcontrol_t > ** in_GPR_WRITE_WRITE_UNIT_VAL ; 51 sc_signal<Tcontrol_t > ** out_GPR_WRITE_WRITE_UNIT_ACK ; 52 sc_signal<Tcontext_t > ** in_GPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID ; 53 sc_signal<Tgeneral_address_t> ** in_GPR_WRITE_WRITE_UNIT_NUM_REG ; 54 sc_signal<Tgeneral_data_t > ** in_GPR_WRITE_WRITE_UNIT_DATA ; 55 sc_signal<Tcontrol_t > ** out_GPR_WRITE_REGISTER_FILE_VAL ; 56 sc_signal<Tcontrol_t > ** in_GPR_WRITE_REGISTER_FILE_ACK ; 57 sc_signal<Tcontext_t > ** out_GPR_WRITE_REGISTER_FILE_OOO_ENGINE_ID ; 58 sc_signal<Tgeneral_address_t> ** out_GPR_WRITE_REGISTER_FILE_NUM_REG ; 59 sc_signal<Tgeneral_data_t > ** out_GPR_WRITE_REGISTER_FILE_DATA ; 60 sc_signal<Tcontrol_t > ** out_GPR_WRITE_READ_UNIT_VAL ; 61 sc_signal<Tcontext_t > ** out_GPR_WRITE_READ_UNIT_OOO_ENGINE_ID ; 62 sc_signal<Tgeneral_address_t> ** out_GPR_WRITE_READ_UNIT_NUM_REG ; 63 sc_signal<Tgeneral_data_t > ** out_GPR_WRITE_READ_UNIT_DATA ; 64 sc_signal<Tcontrol_t > ** in_SPR_WRITE_WRITE_UNIT_VAL ; 65 sc_signal<Tcontrol_t > ** out_SPR_WRITE_WRITE_UNIT_ACK ; 66 sc_signal<Tcontext_t > ** in_SPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID ; 67 sc_signal<Tspecial_address_t> ** in_SPR_WRITE_WRITE_UNIT_NUM_REG ; 68 sc_signal<Tspecial_data_t > ** in_SPR_WRITE_WRITE_UNIT_DATA ; 69 sc_signal<Tcontrol_t > ** out_SPR_WRITE_REGISTER_FILE_VAL ; 70 sc_signal<Tcontrol_t > ** in_SPR_WRITE_REGISTER_FILE_ACK ; 71 sc_signal<Tcontext_t > ** out_SPR_WRITE_REGISTER_FILE_OOO_ENGINE_ID ; 72 sc_signal<Tspecial_address_t> ** out_SPR_WRITE_REGISTER_FILE_NUM_REG ; 73 sc_signal<Tspecial_data_t > ** out_SPR_WRITE_REGISTER_FILE_DATA ; 74 sc_signal<Tcontrol_t > ** out_SPR_WRITE_READ_UNIT_VAL ; 75 sc_signal<Tcontext_t > ** out_SPR_WRITE_READ_UNIT_OOO_ENGINE_ID ; 76 sc_signal<Tspecial_address_t> ** out_SPR_WRITE_READ_UNIT_NUM_REG ; 77 sc_signal<Tspecial_data_t > ** out_SPR_WRITE_READ_UNIT_DATA ; 78 50 79 ALLOC1_SC_SIGNAL( in_GPR_WRITE_WRITE_UNIT_VAL ," in_GPR_WRITE_WRITE_UNIT_VAL ",Tcontrol_t ,_param->_nb_gpr_write); 51 80 ALLOC1_SC_SIGNAL(out_GPR_WRITE_WRITE_UNIT_ACK ,"out_GPR_WRITE_WRITE_UNIT_ACK ",Tcontrol_t ,_param->_nb_gpr_write); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Execute_loop 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Functionnal_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Operation/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Operation 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Load_store_unit 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Memory.h
r101 r113 147 147 trace_memory_t trace; 148 148 149 trace._cycle = s c_simulation_time();149 trace._cycle = simulation_cycle(); 150 150 trace._context = context; 151 151 trace._address = address; … … 229 229 trace_memory_t trace; 230 230 231 trace._cycle = s c_simulation_time();231 trace._cycle = simulation_cycle(); 232 232 trace._context = context; 233 233 trace._address = address; … … 247 247 trace_memory_t trace; 248 248 249 trace._cycle = s c_simulation_time();249 trace._cycle = simulation_cycle(); 250 250 trace._context = context; 251 251 trace._address = address; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test1.cpp
r82 r113 270 270 load_queue_use [i] = false; 271 271 272 double current_cycle = s c_simulation_time();272 double current_cycle = simulation_cycle(); 273 273 double cycle_min = current_cycle; 274 274 … … 451 451 in_MEMORY_IN_VAL ->write((not fifo_request.empty()) and 452 452 can_execute and 453 (s c_simulation_time() >= fifo_request.top()._cycle));453 (simulation_cycle() >= fifo_request.top()._cycle)); 454 454 455 455 if (_param->_have_port_context_id) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test2.cpp
r104 r113 412 412 if (not fifo_request.empty()) 413 413 { 414 can_execute = s c_simulation_time() >= fifo_request.top()._cycle;414 can_execute = simulation_cycle() >= fifo_request.top()._cycle; 415 415 if (is_operation_memory_store(fifo_request.top()._operation)) 416 416 can_execute &= (not store_queue_use [fifo_request.top()._store_queue_ptr_write] and (nb_store_slot_use < _param->_size_store_queue-1)) or is_operation_memory_store_head(fifo_request.top()._operation); … … 512 512 } 513 513 514 std::cout << "kane - nb_request_memory_out : " << nb_request_memory_out << std::endl;515 516 514 // a lot of test 517 515 TEST(Tpacket_t , out_MEMORY_OUT_PACKET_ID [0]->read(), tab_request[packet_id]._packet_id ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Read_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Read_queue 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Reservation_station 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Execute_queue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/include/top.h
r111 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 * Test " RegisterFile"6 * Test "Execute_queue" 7 7 */ 8 8 … … 11 11 #endif 12 12 13 #include <string> 14 #include <iostream> 15 #include <sys/time.h> 13 #define NB_ITERATION 16 14 #define CYCLE_MAX (1024*NB_ITERATION) 16 15 16 #include "Common/include/Test.h" 17 17 #include "Common/include/Time.h" 18 18 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h" … … 29 29 using namespace morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue; 30 30 31 void test (string name, 32 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters * param); 31 SC_MODULE(top) 32 { 33 #ifdef SYSTEMC 34 private: sc_clock * in_CLOCK ; 35 private: sc_signal<Tcontrol_t> * in_NRESET; 36 37 private: sc_signal<Tcontrol_t > * in_EXECUTE_QUEUE_IN_VAL ; 38 private: sc_signal<Tcontrol_t > * out_EXECUTE_QUEUE_IN_ACK ; 39 private: sc_signal<Tcontext_t > * in_EXECUTE_QUEUE_IN_CONTEXT_ID ; 40 private: sc_signal<Tcontext_t > * in_EXECUTE_QUEUE_IN_FRONT_END_ID ; 41 private: sc_signal<Tcontext_t > * in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID ; 42 private: sc_signal<Tpacket_t > * in_EXECUTE_QUEUE_IN_PACKET_ID ; 43 //private: sc_signal<Toperation_t > * in_EXECUTE_QUEUE_IN_OPERATION ; 44 //private: sc_signal<Ttype_t > * in_EXECUTE_QUEUE_IN_TYPE ; 45 private: sc_signal<Tspecial_data_t > * in_EXECUTE_QUEUE_IN_FLAGS ; 46 private: sc_signal<Texception_t > * in_EXECUTE_QUEUE_IN_EXCEPTION ; 47 private: sc_signal<Tcontrol_t > * in_EXECUTE_QUEUE_IN_NO_SEQUENCE ; 48 private: sc_signal<Taddress_t > * in_EXECUTE_QUEUE_IN_ADDRESS ; 49 private: sc_signal<Tgeneral_data_t > * in_EXECUTE_QUEUE_IN_DATA ; 50 51 private: sc_signal<Tcontrol_t > * out_EXECUTE_QUEUE_OUT_VAL ; 52 private: sc_signal<Tcontrol_t > * in_EXECUTE_QUEUE_OUT_ACK ; 53 private: sc_signal<Tcontext_t > * out_EXECUTE_QUEUE_OUT_CONTEXT_ID ; 54 private: sc_signal<Tcontext_t > * out_EXECUTE_QUEUE_OUT_FRONT_END_ID ; 55 private: sc_signal<Tcontext_t > * out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID; 56 private: sc_signal<Tpacket_t > * out_EXECUTE_QUEUE_OUT_PACKET_ID ; 57 //private: sc_signal<Toperation_t > * out_EXECUTE_QUEUE_OUT_OPERATION ; 58 //private: sc_signal<Ttype_t > * out_EXECUTE_QUEUE_OUT_TYPE ; 59 private: sc_signal<Tspecial_data_t > * out_EXECUTE_QUEUE_OUT_FLAGS ; 60 private: sc_signal<Texception_t > * out_EXECUTE_QUEUE_OUT_EXCEPTION ; 61 private: sc_signal<Tcontrol_t > * out_EXECUTE_QUEUE_OUT_NO_SEQUENCE ; 62 private: sc_signal<Taddress_t > * out_EXECUTE_QUEUE_OUT_ADDRESS ; 63 private: sc_signal<Tgeneral_data_t > * out_EXECUTE_QUEUE_OUT_DATA ; 64 65 #endif 66 67 private: std::string name; 68 private: Tusage_t _usage; 69 private: morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters * _param; 70 #ifdef STATISTICS 71 private: morpheo::behavioural::Parameters_Statistics * _param_stat; 72 #endif 73 private: Execute_queue * component; 74 75 private: void usage 76 ( 77 #ifdef MTI_SYSTEMC 78 int argc, const char * const * argv 79 #else 80 int argc, char * argv[] 81 #endif 82 ); 83 private: void allocation (void); 84 private: void deallocation (void); 85 public : void test (void); 86 87 #ifdef MTI_SYSTEMC 88 SC_CTOR(top::top); 89 #else 90 public : top (sc_module_name module_name,int argc, char * argv[]); 91 #endif 92 public : ~top(void); 93 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/src/main.cpp
r88 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ 7 7 8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/include/t est.h"8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 7 11 12 void usage (int argc, char * argv[]) 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 13 16 { 14 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 err (_("list_params is :\n")); 16 err (_(" * size_queue (uint32_t)\n")); 17 err (_(" * nb_context (uint32_t)\n")); 18 err (_(" * nb_front_end (uint32_t)\n")); 19 err (_(" * nb_ooo_engine (uint32_t)\n")); 20 err (_(" * nb_packet (uint32_t)\n")); 21 err (_(" * size_general_data (uint32_t)\n")); 22 err (_(" * size_special_data (uint32_t)\n")); 23 24 exit (1); 25 } 26 27 #ifndef SYSTEMC 28 int main (int argc, char * argv[]) 29 #else 30 int sc_main (int argc, char * argv[]) 31 #endif 32 { 33 if (argc != 2+NB_PARAMS) 34 usage (argc, argv); 35 36 uint32_t x = 1; 37 38 const string name = argv[x++]; 39 const uint32_t size_queue = atoi(argv[x++]); 40 const uint32_t nb_context = atoi(argv[x++]); 41 const uint32_t nb_front_end = atoi(argv[x++]); 42 const uint32_t nb_ooo_engine = atoi(argv[x++]); 43 const uint32_t nb_packet = atoi(argv[x++]); 44 const uint32_t size_general_data = atoi(argv[x++]); 45 const uint32_t size_special_data = atoi(argv[x++]); 17 int _return = EXIT_SUCCESS; 46 18 47 19 try 48 20 { 49 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters 50 (size_queue , 51 nb_context , 52 nb_front_end , 53 nb_ooo_engine , 54 nb_packet , 55 size_general_data , 56 size_special_data , 57 true // is_toplevel 58 ); 59 60 msg(_("%s"),param->print(1).c_str()); 61 62 test (name,param); 21 top * my_top = new top ("my_top",argc,argv); 22 23 my_top->test(); 24 25 delete my_top; 63 26 } 64 27 catch (morpheo::ErrorMorpheo & error) 65 28 { 66 msg (_("<%s> : %s.\n"),name.c_str(),error.what ());67 exit (EXIT_FAILURE);29 msgError(_("%s\n"),error.what ()); 30 _return = EXIT_FAILURE; 68 31 } 69 catch (...) 32 33 try 70 34 { 71 err (_("<%s> : This test must generate a error.\n"),name.c_str()); 72 exit (EXIT_FAILURE); 35 if (_return == EXIT_SUCCESS) 36 TEST_OK("Execute_queue : no error"); 37 else 38 TEST_KO("Execute_queue : a lot of error"); 39 } 40 catch (morpheo::ErrorMorpheo & error) 41 { 42 // msgError(_("<%s> :\n%s"),name.c_str(), error.what ()); 43 _return = EXIT_FAILURE; 73 44 } 74 45 75 return (EXIT_SUCCESS);46 return _return; 76 47 } 77 48 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h
r101 r113 18 18 #include "Common/include/Debug.h" 19 19 20 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Wrapper_Execute_queue.h" 20 21 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Parameters.h" 21 22 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Types.h" … … 28 29 #endif 29 30 #include "Behavioural/include/Usage.h" 31 #include "Behavioural/include/Simulation.h" 32 33 #include "Behavioural/Generic/Queue/include/Queue.h" 30 34 31 35 namespace morpheo { … … 47 51 protected : const std::string _name; 48 52 protected : const Parameters * _param; 49 p rivate : constTusage_t _usage;53 public : Tusage_t _usage; 50 54 51 55 #ifdef STATISTICS … … 95 99 public : SC_OUT(Taddress_t ) * out_EXECUTE_QUEUE_OUT_ADDRESS ; 96 100 public : SC_OUT(Tgeneral_data_t ) * out_EXECUTE_QUEUE_OUT_DATA ; 97 98 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~99 101 100 102 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 103 105 private : Tcontrol_t internal_EXECUTE_QUEUE_IN_ACK ; 104 106 private : Tcontrol_t internal_EXECUTE_QUEUE_OUT_VAL; 107 108 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 109 # ifdef VHDL 110 private : morpheo::behavioural::generic::queue::Parameters * _param_queue; 111 private : morpheo::behavioural::generic::queue::Queue * _component_queue; 112 # endif 113 #endif 114 115 #ifdef MODELSIM_COSIMULATION 116 // ~~~~~[ Wrapper ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 private : Wrapper_Execute_queue * _wrapper; 105 118 #endif 106 119 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Parameters.h
r98 r113 61 61 public : Parameters_test msg_error (void); 62 62 63 public : std::string print (uint32_t depth); 64 public : friend std::ostream& operator<< (std::ostream& output_stream, 65 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters & x); 63 public : std::string id (void) const; 64 65 public : std::string print (uint32_t depth); 66 public : friend std::ostream& operator<< (std::ostream& output_stream, 67 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters & x); 66 68 }; 67 69 … … 72 74 }; // end namespace multi_execute_loop 73 75 }; // end namespace core 74 75 76 }; // end namespace behavioural 76 77 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue.cpp
r88 r113 35 35 _name (name) 36 36 ,_param (param) 37 ,_usage (usage)38 37 { 39 log_ printf(FUNC,Execute_queue,FUNCTION,"Begin");38 log_begin(Execute_queue,FUNCTION); 40 39 41 #if DEBUG_Execute_queue == true 42 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Parameters"),_name.c_str()); 40 _usage = usage_environment(usage); 43 41 44 std::cout << *param << std::endl; 45 #endif 42 // #if DEBUG_Execute_queue == true 43 // log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Parameters"),_name.c_str()); 46 44 47 log_printf(INFO,Execute_queue,FUNCTION,"Allocation"); 45 // std::cout << *param << std::endl; 46 // #endif 47 48 #ifdef MODELSIM_COSIMULATION 49 { 50 std::string param_id = param->id(); 51 52 if ((_model.get_type(_param->_type) == MODEL_VHDL) and 53 (param_id != "") 54 ) 55 { 56 std::string vhdl_id = vhdl_get_id(_name); 57 58 if (vhdl_id == param_id) 59 { 60 msgInformation(_("<%s> Use VHDL model\n"),_name.c_str()); 61 _usage = usage_cosimulation(_usage); 62 } 63 else 64 { 65 log_printf(TRACE,Execute_queue,FUNCTION,"get_id : %s",vhdl_id.c_str()); 66 log_printf(TRACE,Execute_queue,FUNCTION,"id : %s",param_id.c_str()); 67 68 msgWarning(_("<%s> Can't load VHDL model, continue with SystemC model\n"),_name.c_str()); 69 } 70 } 71 } 72 #endif 73 74 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Allocation"),_name.c_str()); 48 75 allocation (); 49 76 … … 51 78 if (usage_is_set(_usage,USE_STATISTICS)) 52 79 { 53 log_printf(INFO,Execute_queue,FUNCTION, "Allocation of statistics");80 log_printf(INFO,Execute_queue,FUNCTION,("<%s> Allocation of statistics"),_name.c_str()); 54 81 55 82 statistics_declaration(param_statistics); … … 61 88 { 62 89 // generate the vhdl 63 log_printf(INFO,Execute_queue,FUNCTION, "Generate the vhdl");90 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str()); 64 91 65 92 vhdl(); … … 68 95 69 96 #ifdef SYSTEMC 70 if (usage_is_set(_usage,USE_SYSTEMC ))97 if (usage_is_set(_usage,USE_SYSTEMC_BODY)) 71 98 { 72 log_printf(INFO,Execute_queue,FUNCTION, "Method - transition");99 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str()); 73 100 74 101 SC_METHOD (transition); … … 80 107 # endif 81 108 82 log_printf(INFO,Execute_queue,FUNCTION, "Method - genMoore");109 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str()); 83 110 84 111 SC_METHOD (genMoore); … … 89 116 // List dependency information 90 117 # endif 91 118 } 92 119 #endif 93 } 94 log_printf(FUNC,Execute_queue,FUNCTION,"End"); 120 log_end(Execute_queue,FUNCTION); 95 121 }; 96 122 … … 99 125 Execute_queue::~Execute_queue (void) 100 126 { 101 log_ printf(FUNC,Execute_queue,FUNCTION,"Begin");127 log_begin(Execute_queue,FUNCTION); 102 128 103 129 #ifdef STATISTICS 104 130 if (usage_is_set(_usage,USE_STATISTICS)) 105 131 { 106 log_printf(INFO,Execute_queue,FUNCTION, "Generate Statistics file");132 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str()); 107 133 108 134 delete _stat; … … 110 136 #endif 111 137 112 log_printf(INFO,Execute_queue,FUNCTION, "Deallocation");138 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str()); 113 139 deallocation (); 114 140 115 log_ printf(FUNC,Execute_queue,FUNCTION,"End");141 log_end(Execute_queue,FUNCTION); 116 142 }; 117 143 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_allocation.cpp
r112 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ 7 7 8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Wrapper_Execute_queue.h" 8 9 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h" 9 10 #include "Behavioural/include/Allocation.h" … … 27 28 28 29 Entity * entity = _component->set_entity (_name 29 , "Execute_queue"30 ,_param->_type 30 31 #ifdef POSITION 31 32 ,COMBINATORY … … 35 36 _interfaces = entity->set_interfaces(); 36 37 37 // ~~~~~[ 38 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 39 39 40 Interface * interface = _interfaces->set_interface("" … … 54 55 ALLOC0_VALACK_IN ( in_EXECUTE_QUEUE_IN_VAL,VAL); 55 56 ALLOC0_VALACK_OUT(out_EXECUTE_QUEUE_IN_ACK,ACK); 56 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id );57 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id );58 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t ,_param->_size_ooo_engine_id );59 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_rob_ptr );60 // ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation );61 // ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type );62 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_FLAGS ,"flags" ,Tspecial_data_t ,_param->_size_special_data );63 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception );64 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_NO_SEQUENCE ,"no_sequence" ,Tcontrol_t ,1 );57 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); 58 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); 59 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t ,_param->_size_ooo_engine_id ); 60 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_rob_ptr ); 61 // ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); 62 // ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 63 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_FLAGS ,"flags" ,Tspecial_data_t ,_param->_size_special_data ); 64 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception ); 65 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_NO_SEQUENCE ,"no_sequence" ,Tcontrol_t ,1 ); 65 66 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address); 66 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_DATA ,"data" ,Tgeneral_data_t ,_param->_size_general_data );67 ALLOC0_SIGNAL_IN ( in_EXECUTE_QUEUE_IN_DATA ,"data" ,Tgeneral_data_t ,_param->_size_general_data ); 67 68 68 69 ALLOC0_INTERFACE_END(); … … 90 91 } 91 92 92 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 94 _queue = new std::list<execute_queue_entry_t *>; 93 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 94 if (usage_is_set(_usage,USE_SYSTEMC_BODY)) 95 { 96 _queue = new std::list<execute_queue_entry_t *>; 97 } 98 99 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100 #ifdef VHDL 101 if (usage_is_set(_usage,USE_VHDL)) 102 { 103 _param_queue = new morpheo::behavioural::generic::queue::Parameters 104 (_param->_size_queue, 105 _param->_size_internal_queue, 106 0, 107 false, 108 false 109 ); 110 111 std::string queue_name = _name + "_queue"; 112 _component_queue = new morpheo::behavioural::generic::queue::Queue 113 (queue_name.c_str() 114 # ifdef STATISTICS 115 ,NULL 116 # endif 117 ,_param_queue 118 ,USE_VHDL); 119 120 _component->set_component(_component_queue->_component 121 # ifdef POSITION 122 , 0, 0, 0, 0 123 # endif 124 , INSTANCE_LIBRARY 125 ); 126 } 127 #endif 95 128 96 129 #ifdef POSITION 97 if (usage_is_set(_usage,USE_POSITION)) 98 _component->generate_file(); 99 #endif 100 130 if (usage_is_set(_usage,USE_POSITION)) 131 _component->generate_file(); 132 #endif 133 134 #ifdef MODELSIM_COSIMULATION 135 if (usage_is_set(_usage,USE_COSIMULATION)) 136 { 137 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> : Create Wrapper"),_name.c_str()); 138 139 _wrapper = new Wrapper_Execute_queue(_name.c_str(),"morpheo_behavioural","/dsk/l1/misc/Morpheo/work",_param); 140 // _wrapper = new Wrapper_Execute_queue(_name.c_str(),"morpheo_behavioural","work"); 141 142 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> : Wrapper Instanciation"),_name.c_str()); 143 144 // INSTANCE0_FOREIGN_SIGNAL_CLOCK(_wrapper, in_CLOCK , "in_CLOCK" ,1); 145 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_NRESET ,Tcontrol_t , "in_NRESET" ,1); 146 147 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_VAL ,Tcontrol_t , "in_EXECUTE_QUEUE_IN_VAL" ,1 ); 148 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_IN_ACK ,Tcontrol_t ,"out_EXECUTE_QUEUE_IN_ACK" ,1 ); 149 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_CONTEXT_ID ,Tcontext_t , "in_EXECUTE_QUEUE_IN_CONTEXT_ID" ,_param->_size_context_id ); 150 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_FRONT_END_ID ,Tcontext_t , "in_EXECUTE_QUEUE_IN_FRONT_END_ID" ,_param->_size_front_end_id ); 151 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID ,Tcontext_t , "in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID" ,_param->_size_ooo_engine_id ); 152 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_PACKET_ID ,Tpacket_t , "in_EXECUTE_QUEUE_IN_PACKET_ID" ,_param->_size_rob_ptr ); 153 // // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_OPERATION ,Toperation_t , "in_EXECUTE_QUEUE_IN_OPERATION" ,_param->_size_operation ); 154 // // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_TYPE ,Ttype_t , "in_EXECUTE_QUEUE_IN_TYPE" ,_param->_size_type ); 155 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_FLAGS ,Tspecial_data_t , "in_EXECUTE_QUEUE_IN_FLAGS" ,_param->_size_special_data ); 156 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_EXCEPTION ,Texception_t , "in_EXECUTE_QUEUE_IN_EXCEPTION" ,_param->_size_exception ); 157 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_NO_SEQUENCE ,Tcontrol_t , "in_EXECUTE_QUEUE_IN_NO_SEQUENCE" ,1 ); 158 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_ADDRESS ,Taddress_t , "in_EXECUTE_QUEUE_IN_ADDRESS" ,_param->_size_instruction_address); 159 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_IN_DATA ,Tgeneral_data_t , "in_EXECUTE_QUEUE_IN_DATA" ,_param->_size_general_data ); 160 161 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_VAL ,Tcontrol_t ,"out_EXECUTE_QUEUE_OUT_VAL" ,1 ); 162 // INSTANCE0_FOREIGN_SIGNAL_IN (_wrapper, in_EXECUTE_QUEUE_OUT_ACK ,Tcontrol_t , "in_EXECUTE_QUEUE_OUT_ACK" ,1 ); 163 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_CONTEXT_ID ,Tcontext_t ,"out_EXECUTE_QUEUE_OUT_CONTEXT_ID" ,_param->_size_context_id ); 164 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_FRONT_END_ID ,Tcontext_t ,"out_EXECUTE_QUEUE_OUT_FRONT_END_ID" ,_param->_size_front_end_id ); 165 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID ,Tcontext_t ,"out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID" ,_param->_size_ooo_engine_id ); 166 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_PACKET_ID ,Tpacket_t ,"out_EXECUTE_QUEUE_OUT_PACKET_ID" ,_param->_size_rob_ptr ); 167 // // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_OPERATION ,Toperation_t ,"out_EXECUTE_QUEUE_OUT_OPERATION" ,_param->_size_operation ); 168 // // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_TYPE ,Ttype_t ,"out_EXECUTE_QUEUE_OUT_TYPE" ,_param->_size_type ); 169 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_FLAGS ,Tspecial_data_t ,"out_EXECUTE_QUEUE_OUT_FLAGS" ,_param->_size_special_data ); 170 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_EXCEPTION ,Texception_t ,"out_EXECUTE_QUEUE_OUT_EXCEPTION" ,_param->_size_exception ); 171 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_NO_SEQUENCE ,Tcontrol_t ,"out_EXECUTE_QUEUE_OUT_NO_SEQUENCE" ,1 ); 172 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_ADDRESS ,Taddress_t ,"out_EXECUTE_QUEUE_OUT_ADDRESS" ,_param->_size_instruction_address); 173 // INSTANCE0_FOREIGN_SIGNAL_OUT (_wrapper,out_EXECUTE_QUEUE_OUT_DATA ,Tgeneral_data_t ,"out_EXECUTE_QUEUE_OUT_DATA" ,_param->_size_general_data ); 174 175 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_CLOCK ,Tcontrol_t , "in_CLOCK" ,1); 176 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_NRESET ,Tcontrol_t , "in_NRESET" ,1); 177 178 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_VAL ,Tcontrol_t , "in_EXECUTE_QUEUE_IN_VAL" ,1 ); 179 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_IN_ACK ,Tcontrol_t ,"out_EXECUTE_QUEUE_IN_ACK" ,1 ); 180 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_CONTEXT_ID ,Tcontext_t , "in_EXECUTE_QUEUE_IN_CONTEXT_ID" ,_param->_size_context_id ); 181 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_FRONT_END_ID ,Tcontext_t , "in_EXECUTE_QUEUE_IN_FRONT_END_ID" ,_param->_size_front_end_id ); 182 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID ,Tcontext_t , "in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID" ,_param->_size_ooo_engine_id ); 183 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_PACKET_ID ,Tpacket_t , "in_EXECUTE_QUEUE_IN_PACKET_ID" ,_param->_size_rob_ptr ); 184 // INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_OPERATION ,Toperation_t , "in_EXECUTE_QUEUE_IN_OPERATION" ,_param->_size_operation ); 185 // INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_TYPE ,Ttype_t , "in_EXECUTE_QUEUE_IN_TYPE" ,_param->_size_type ); 186 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_FLAGS ,Tspecial_data_t, "in_EXECUTE_QUEUE_IN_FLAGS" ,_param->_size_special_data ); 187 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_EXCEPTION ,Texception_t , "in_EXECUTE_QUEUE_IN_EXCEPTION" ,_param->_size_exception ); 188 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_NO_SEQUENCE ,Tcontrol_t , "in_EXECUTE_QUEUE_IN_NO_SEQUENCE" ,1 ); 189 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_ADDRESS ,Taddress_t , "in_EXECUTE_QUEUE_IN_ADDRESS" ,_param->_size_instruction_address); 190 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_IN_DATA ,Tgeneral_data_t, "in_EXECUTE_QUEUE_IN_DATA" ,_param->_size_general_data ); 191 192 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_VAL ,Tcontrol_t ,"out_EXECUTE_QUEUE_OUT_VAL" ,1 ); 193 INSTANCE0_FOREIGN_SIGNAL(_wrapper, in_EXECUTE_QUEUE_OUT_ACK ,Tcontrol_t , "in_EXECUTE_QUEUE_OUT_ACK" ,1 ); 194 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_CONTEXT_ID ,Tcontext_t ,"out_EXECUTE_QUEUE_OUT_CONTEXT_ID" ,_param->_size_context_id ); 195 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_FRONT_END_ID ,Tcontext_t ,"out_EXECUTE_QUEUE_OUT_FRONT_END_ID" ,_param->_size_front_end_id ); 196 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID ,Tcontext_t ,"out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID" ,_param->_size_ooo_engine_id ); 197 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_PACKET_ID ,Tpacket_t ,"out_EXECUTE_QUEUE_OUT_PACKET_ID" ,_param->_size_rob_ptr ); 198 // INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_OPERATION ,Toperation_t ,"out_EXECUTE_QUEUE_OUT_OPERATION" ,_param->_size_operation ); 199 // INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_TYPE ,Ttype_t ,"out_EXECUTE_QUEUE_OUT_TYPE" ,_param->_size_type ); 200 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_FLAGS ,Tspecial_data_t,"out_EXECUTE_QUEUE_OUT_FLAGS" ,_param->_size_special_data ); 201 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_EXCEPTION ,Texception_t ,"out_EXECUTE_QUEUE_OUT_EXCEPTION" ,_param->_size_exception ); 202 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_NO_SEQUENCE ,Tcontrol_t ,"out_EXECUTE_QUEUE_OUT_NO_SEQUENCE" ,1 ); 203 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_ADDRESS ,Taddress_t ,"out_EXECUTE_QUEUE_OUT_ADDRESS" ,_param->_size_instruction_address); 204 INSTANCE0_FOREIGN_SIGNAL(_wrapper,out_EXECUTE_QUEUE_OUT_DATA ,Tgeneral_data_t,"out_EXECUTE_QUEUE_OUT_DATA" ,_param->_size_general_data ); 205 206 log_printf(INFO,Execute_queue,FUNCTION,_("<%s> : Wrapper Instanciation end"),_name.c_str()); 207 } 208 #endif 209 101 210 log_printf(FUNC,Execute_queue,FUNCTION,"End"); 102 211 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_deallocation.cpp
r112 r113 25 25 log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); 26 26 27 if (usage_is_set(_usage,USE_SYSTEMC ))27 if (usage_is_set(_usage,USE_SYSTEMC_INTERFACE)) 28 28 { 29 29 delete in_CLOCK ; … … 60 60 61 61 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 while (not _queue->empty())62 if (usage_is_set(_usage,USE_SYSTEMC_BODY)) 63 63 { 64 delete _queue->front(); 65 _queue->pop_front(); 64 while (not _queue->empty()) 65 { 66 delete _queue->front(); 67 _queue->pop_front(); 68 } 69 delete _queue; 66 70 } 67 delete _queue;68 71 69 72 delete _component; 73 74 #ifdef VHDL 75 if (usage_is_set(_usage,USE_VHDL)) 76 { 77 delete _component_queue; 78 delete _param_queue; 79 } 80 #endif 81 82 #ifdef MODELSIM_COSIMULATION 83 if (usage_is_set(_usage,USE_COSIMULATION)) 84 { 85 delete _wrapper; 86 } 87 #endif 70 88 71 89 log_printf(FUNC,Execute_queue,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_statistics_declaration.cpp
r81 r113 26 26 27 27 _stat = new Stat (static_cast<std::string>(_name), 28 "Execute_queue",28 _param->_type, 29 29 param_statistics); 30 30 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_vhdl.cpp
r101 r113 9 9 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h" 10 10 #include "Behavioural/include/Vhdl.h" 11 #include "Behavioural/Generic/Queue/include/Queue.h"12 11 13 12 namespace morpheo { … … 23 22 #undef FUNCTION 24 23 #define FUNCTION "Execute_queue::vhdl" 25 void Execute_queue::vhdl (void) 24 void Execute_queue::vhdl (void) 26 25 { 27 26 log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); 28 27 29 //----- Queue ----- 30 31 morpheo::behavioural::generic::queue::Parameters * param_queue; 32 morpheo::behavioural::generic::queue::Queue * queue; 33 34 param_queue = new morpheo::behavioural::generic::queue::Parameters 35 (_param->_size_queue, 36 _param->_size_internal_queue, 37 0, 38 false, 39 false 40 ); 41 42 std::string queue_name = _name + "_queue"; 43 queue = new morpheo::behavioural::generic::queue::Queue 44 (queue_name.c_str() 45 #ifdef STATISTICS 46 ,NULL 47 #endif 48 ,param_queue 49 ,USE_VHDL); 50 51 _component->set_component(queue->_component 52 #ifdef POSITION 53 , 0, 0, 0, 0 54 #endif 55 , INSTANCE_LIBRARY 56 ); 57 58 Vhdl * vhdl = new Vhdl (_name); 28 Vhdl * vhdl = new Vhdl (_name,_param->id()); 59 29 60 30 _interfaces->set_port(vhdl); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_vhdl_body.cpp
r98 r113 57 57 size = _param->_size_context_id; 58 58 max = min-1+size; 59 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_CONTEXT_ID ;");59 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_CONTEXT_ID "+std_logic_range(size)+";"); 60 60 min = max+1; 61 61 } … … 64 64 size = _param->_size_front_end_id; 65 65 max = min-1+size; 66 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_FRONT_END_ID ;");66 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_FRONT_END_ID"+std_logic_range(size)+";"); 67 67 min = max+1; 68 68 } … … 71 71 size = _param->_size_ooo_engine_id; 72 72 max = min-1+size; 73 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID ;");73 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID"+std_logic_range(size)+";"); 74 74 min = max+1; 75 75 } … … 78 78 size = _param->_size_rob_ptr; 79 79 max = min-1+size; 80 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_PACKET_ID ;");80 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_PACKET_ID"+std_logic_range(size)+";"); 81 81 min = max+1; 82 82 } … … 84 84 // size = _param->_size_operation; 85 85 // max = min-1+size; 86 // vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_OPERATION ;");86 // vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_OPERATION"+std_logic_range(size)+";"); 87 87 // min = max+1; 88 88 // 89 89 // size = _param->_size_type; 90 90 // max = min-1+size; 91 // vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_TYPE ;");91 // vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_TYPE"+std_logic_range(size)+";"); 92 92 // min = max+1; 93 93 94 94 size = _param->_size_special_data; 95 95 max = min-1+size; 96 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_FLAGS ;");96 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_FLAGS"+std_logic_range(size)+";"); 97 97 min = max+1; 98 98 99 99 size = _param->_size_exception; 100 100 max = min-1+size; 101 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_EXCEPTION ;");101 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_EXCEPTION"+std_logic_range(size)+";"); 102 102 min = max+1; 103 103 104 104 size = 1; 105 105 max = min-1+size; 106 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_NO_SEQUENCE ;");106 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_NO_SEQUENCE"+std_logic_range(size)+";"); 107 107 min = max+1; 108 108 109 109 size = _param->_size_instruction_address; 110 110 max = min-1+size; 111 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_ADDRESS ;");111 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_ADDRESS"+std_logic_range(size)+";"); 112 112 min = max+1; 113 113 114 114 size = _param->_size_general_data; 115 115 max = min-1+size; 116 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_DATA ;");116 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_DATA"+std_logic_range(size)+";"); 117 117 min = max+1; 118 118 } … … 125 125 126 126 if(_param->_have_port_context_id) 127 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_CONTEXT_ID <= internal_EXECUTE_QUEUE_OUT_CONTEXT_ID ;");127 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_CONTEXT_ID "+std_logic_range(_param->_size_context_id )+" <= internal_EXECUTE_QUEUE_OUT_CONTEXT_ID ;"); 128 128 if(_param->_have_port_front_end_id) 129 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FRONT_END_ID <= internal_EXECUTE_QUEUE_OUT_FRONT_END_ID ;");129 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FRONT_END_ID "+std_logic_range(_param->_size_front_end_id )+" <= internal_EXECUTE_QUEUE_OUT_FRONT_END_ID ;"); 130 130 if(_param->_have_port_ooo_engine_id) 131 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID <= internal_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID;");131 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID "+std_logic_range(_param->_size_ooo_engine_id )+" <= internal_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID;"); 132 132 if(_param->_have_port_rob_ptr) 133 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_PACKET_ID <= internal_EXECUTE_QUEUE_OUT_PACKET_ID ;");134 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OPERATION <= internal_EXECUTE_QUEUE_OUT_OPERATION ;");135 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_TYPE <= internal_EXECUTE_QUEUE_OUT_TYPE ;");136 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FLAGS <= internal_EXECUTE_QUEUE_OUT_FLAGS ;");137 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_EXCEPTION <= internal_EXECUTE_QUEUE_OUT_EXCEPTION ;");138 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_NO_SEQUENCE <= internal_EXECUTE_QUEUE_OUT_NO_SEQUENCE ;");139 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_ADDRESS <= internal_EXECUTE_QUEUE_OUT_ADDRESS ;");140 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_DATA <= internal_EXECUTE_QUEUE_OUT_DATA ;");133 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_PACKET_ID "+std_logic_range(_param->_size_rob_ptr )+" <= internal_EXECUTE_QUEUE_OUT_PACKET_ID ;"); 134 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OPERATION "+std_logic_range(_param->_size_operation )+" <= internal_EXECUTE_QUEUE_OUT_OPERATION ;"); 135 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_TYPE "+std_logic_range(_param->_size_type )+" <= internal_EXECUTE_QUEUE_OUT_TYPE ;"); 136 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FLAGS "+std_logic_range(_param->_size_special_data )+" <= internal_EXECUTE_QUEUE_OUT_FLAGS ;"); 137 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_EXCEPTION "+std_logic_range(_param->_size_exception )+" <= internal_EXECUTE_QUEUE_OUT_EXCEPTION ;"); 138 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_NO_SEQUENCE "+std_logic_range(1 )+" <= internal_EXECUTE_QUEUE_OUT_NO_SEQUENCE ;"); 139 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_ADDRESS "+std_logic_range(_param->_size_instruction_address)+" <= internal_EXECUTE_QUEUE_OUT_ADDRESS ;"); 140 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_DATA "+std_logic_range(_param->_size_general_data )+" <= internal_EXECUTE_QUEUE_OUT_DATA ;"); 141 141 142 143 // vhdl->set_body (0,""); 144 // vhdl->set_body (0,"process (in_CLOCK)"); 145 // vhdl->set_body (0,"begin"); 146 // vhdl->set_body (1,"if in_CLOCK'event and in_CLOCK = '1' then"); 147 // // vhdl->set_body (2,"if in_NRESET = '0' then"); 148 // // vhdl->set_body (3,"reg_CURRENT_STATE <= STATE_0;"); 149 // // vhdl->set_body (2,"else"); 150 // vhdl->set_body (3,"reg_CURRENT_STATE <= sig_NEXT_STATE;"); 151 // // vhdl->set_body (2,"end if;"); 152 153 // for (uint32_t i = 0; i <_param->_size_queue - 1; i++) 154 // { 155 // vhdl->set_body (2,"if sig_WEN_"+toString(i)+" = '1' then"); 156 // vhdl->set_body (3,"if sig_SEL_"+toString(i)+" = '0' then"); 157 // if (_param->_have_port_context_id) 158 // vhdl->set_body (4,"reg_CONTEXT_ID_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_CONTEXT_ID;"); 159 // if (_param->_have_port_front_end_id) 160 // vhdl->set_body (4,"reg_FRONT_END_ID_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_FRONT_END_ID;"); 161 // if (_param->_have_port_ooo_engine_id) 162 // vhdl->set_body (4,"reg_OOO_ENGINE_ID_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID;"); 163 // if (_param->_have_port_rob_ptr) 164 // vhdl->set_body (4,"reg_PACKET_ID_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_PACKET_ID;"); 165 // vhdl->set_body (4, "reg_FLAGS_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_FLAGS;"); 166 // vhdl->set_body (4, "reg_EXCEPTION_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_EXCEPTION;"); 167 // vhdl->set_body (4, "reg_NO_SEQUENCE_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_NO_SEQUENCE;"); 168 // vhdl->set_body (4, "reg_ADDRESS_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_ADDRESS;"); 169 // vhdl->set_body (4, "reg_DATA_"+toString(i)+" <= in_EXECUTE_QUEUE_IN_DATA;"); 170 171 // vhdl->set_body (3, "else"); 172 // if (_param->_have_port_context_id) 173 // vhdl->set_body (4,"reg_CONTEXT_ID_"+toString(i)+" <= reg_CONTEXT_ID_"+toString(i+1)+";"); 174 // if (_param->_have_port_front_end_id) 175 // vhdl->set_body (4,"reg_FRONT_END_ID_"+toString(i)+" <= reg_FRONT_END_ID_"+toString(i+1)+";"); 176 // if (_param->_have_port_ooo_engine_id) 177 // vhdl->set_body (4,"reg_OOO_ENGINE_ID_"+toString(i)+" <= reg_OOO_ENGINE_ID_"+toString(i+1)+";"); 178 // if (_param->_have_port_rob_ptr) 179 // vhdl->set_body (4,"reg_PACKET_ID_"+toString(i)+" <= reg_PACKET_ID_"+toString(i+1)+";"); 180 // vhdl->set_body (4, "reg_FLAGS_"+toString(i)+" <= reg_FLAGS_"+toString(i+1)+";"); 181 // vhdl->set_body (4, "reg_EXCEPTION_"+toString(i)+" <= reg_EXCEPTION_"+toString(i+1)+";"); 182 // vhdl->set_body (4, "reg_NO_SEQUENCE_"+toString(i)+" <= reg_NO_SEQUENCE_"+toString(i+1)+";"); 183 // vhdl->set_body (4, "reg_ADDRESS_"+toString(i)+" <= reg_ADDRESS_"+toString(i+1)+";"); 184 // vhdl->set_body (4, "reg_DATA_"+toString(i)+" <= reg_DATA_"+toString(i+1)+";"); 185 186 // vhdl->set_body (3,"end if;"); 187 188 // vhdl->set_body (2,"end if;"); 189 // } 190 191 // vhdl->set_body (2,"if sig_WEN_"+toString(_param->_size_queue-1)+" = '1' then"); 192 // if (_param->_have_port_context_id) 193 // vhdl->set_body (3,"reg_CONTEXT_ID_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_CONTEXT_ID;"); 194 // if (_param->_have_port_front_end_id) 195 // vhdl->set_body (3,"reg_FRONT_END_ID_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_FRONT_END_ID;"); 196 // if (_param->_have_port_ooo_engine_id) 197 // vhdl->set_body (3,"reg_OOO_ENGINE_ID_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID;"); 198 // if (_param->_have_port_rob_ptr) 199 // vhdl->set_body (3,"reg_PACKET_ID_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_PACKET_ID;"); 200 // vhdl->set_body (3, "reg_FLAGS_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_FLAGS;"); 201 // vhdl->set_body (3, "reg_EXCEPTION_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_EXCEPTION;"); 202 // vhdl->set_body (3, "reg_NO_SEQUENCE_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_NO_SEQUENCE;"); 203 // vhdl->set_body (3, "reg_ADDRESS_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_ADDRESS;"); 204 // vhdl->set_body (3, "reg_DATA_"+toString(_param->_size_queue-1)+" <= in_EXECUTE_QUEUE_IN_DATA;"); 205 // vhdl->set_body (2,"end if;"); 206 207 208 // vhdl->set_body (1,"end if;"); 209 // vhdl->set_body (0,"end process;"); 210 211 212 // vhdl->set_body (0,""); 213 // vhdl->set_body (0,""); 214 // vhdl->set_body (0,""); 215 216 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_VAL <= sig_OUT_VAL;"); 217 // vhdl->set_body (0,"out_EXECUTE_QUEUE_IN_ACK <= sig_IN_ACK;"); 218 // if (_param->_have_port_context_id) 219 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_CONTEXT_ID <= reg_CONTEXT_ID_0;"); 220 // if (_param->_have_port_front_end_id) 221 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FRONT_END_ID <= reg_FRONT_END_ID_0;"); 222 // if (_param->_have_port_ooo_engine_id) 223 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID <= reg_OOO_ENGINE_ID_0;"); 224 // if (_param->_have_port_rob_ptr) 225 // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_PACKET_ID <= reg_PACKET_ID_0;"); 226 // vhdl->set_body (0, "out_EXECUTE_QUEUE_OUT_FLAGS <= reg_FLAGS_0;"); 227 // vhdl->set_body (0, "out_EXECUTE_QUEUE_OUT_EXCEPTION <= reg_EXCEPTION_0;"); 228 // vhdl->set_body (0, "out_EXECUTE_QUEUE_OUT_NO_SEQUENCE <= reg_NO_SEQUENCE_0;"); 229 // vhdl->set_body (0, "out_EXECUTE_QUEUE_OUT_ADDRESS <= reg_ADDRESS_0;"); 230 // vhdl->set_body (0, "out_EXECUTE_QUEUE_OUT_DATA <= reg_DATA_0;"); 231 232 233 // vhdl->set_body (0,""); 234 235 // vhdl->set_body (0,"process (reg_CURRENT_STATE, in_EXECUTE_QUEUE_OUT_ACK, in_EXECUTE_QUEUE_IN_VAL, in_NRESET)"); 236 // vhdl->set_body (0,"begin"); 237 // vhdl->set_body (1,"if in_NRESET = '0' then"); 238 // vhdl->set_body (2,"sig_NEXT_STATE <= STATE_0;"); 239 // vhdl->set_body (1,"else"); 240 // vhdl->set_body (2,"case reg_CURRENT_STATE is"); 241 // for (uint32_t i = 0; i <_param->_size_queue + 1; i++) 242 // { 243 // vhdl->set_body (3,"when STATE_"+toString(i)+" =>"); 244 // if (i == 0) 245 // { 246 // vhdl->set_body (4,"if in_EXECUTE_QUEUE_IN_VAL = '1' then"); 247 // vhdl->set_body (5,"sig_NEXT_STATE <= reg_CURRENT_STATE ("+toString(_param->_size_queue-1)+" downto 0) & '0';"); 248 // vhdl->set_body (4,"else"); 249 // vhdl->set_body (5,"sig_NEXT_STATE <= reg_CURRENT_STATE;"); 250 // vhdl->set_body (4,"end if;"); 251 // continue; 252 // } 253 // if (i == (_param->_size_queue)) 254 // { 255 // vhdl->set_body (4,"if in_EXECUTE_QUEUE_OUT_ACK = '1' then"); 256 // vhdl->set_body (5,"sig_NEXT_STATE <= '0' & reg_CURRENT_STATE ("+toString(_param->_size_queue)+" downto 1);"); 257 // vhdl->set_body (4,"else"); 258 // vhdl->set_body (5,"sig_NEXT_STATE <= reg_CURRENT_STATE;"); 259 // vhdl->set_body (4,"end if;"); 260 // continue; 261 // } 262 // vhdl->set_body (4,"if in_EXECUTE_QUEUE_IN_VAL = '1' and in_EXECUTE_QUEUE_OUT_ACK = '0' then"); 263 // vhdl->set_body (5,"sig_NEXT_STATE <= reg_CURRENT_STATE ("+toString(_param->_size_queue-1)+" downto 0) & '0';"); 264 // vhdl->set_body (4,"elsif in_EXECUTE_QUEUE_IN_VAL = '0' and in_EXECUTE_QUEUE_OUT_ACK = '1' then"); 265 // vhdl->set_body (5,"sig_NEXT_STATE <= '0' & reg_CURRENT_STATE ("+toString(_param->_size_queue)+" downto 1);"); 266 // vhdl->set_body (4,"else"); 267 // vhdl->set_body (5,"sig_NEXT_STATE <= reg_CURRENT_STATE;"); 268 // vhdl->set_body (4,"end if;"); 269 // } 270 // vhdl->set_body (3,"when others => assert false report \"wrong state\" severity failure;"); 271 // vhdl->set_body (2,"end case;"); 272 // vhdl->set_body (1,"end if;"); 273 274 // vhdl->set_body (2,"case reg_CURRENT_STATE is"); 275 // for (uint32_t i = 0; i <_param->_size_queue + 1; i++) 276 // { 277 // vhdl->set_body (3,"when STATE_"+toString(i)+" =>"); 278 // if (i == 0) 279 // { 280 // vhdl->set_body (4,"sig_OUT_VAL <= '0';"); 281 // vhdl->set_body (4,"sig_IN_ACK <= '1';"); 282 // for (uint32_t j = 0; j <_param->_size_queue; j++) 283 // { 284 // if (i == j) 285 // { 286 // vhdl->set_body (4,"sig_SEL_"+toString(j)+" <= '0';"); 287 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= in_EXECUTE_QUEUE_IN_VAL;"); 288 // } 289 // else 290 // { 291 // if (j < (_param->_size_queue - 1)) 292 // vhdl->set_body (4,"sig_SEL_"+toString(j)+" <= '0';"); 293 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= '0';"); 294 // } 295 // } 296 // continue; 297 // } 298 // if (i == (_param->_size_queue)) 299 // { 300 // vhdl->set_body (4,"sig_OUT_VAL <= '1';"); 301 // vhdl->set_body (4,"sig_IN_ACK <= '0';"); 302 // for (uint32_t j = 0; j <_param->_size_queue; j++) 303 // { 304 // if (j == (i - 1)) 305 // { 306 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= '0';"); 307 // } 308 // else 309 // { 310 // vhdl->set_body (4,"sig_SEL_"+toString(j)+" <= in_EXECUTE_QUEUE_OUT_ACK;"); 311 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= in_EXECUTE_QUEUE_OUT_ACK;"); 312 // } 313 // } 314 // continue; 315 // } 316 // vhdl->set_body (4,"sig_OUT_VAL <= '1';"); 317 // vhdl->set_body (4,"sig_IN_ACK <= '1';"); 318 // for (uint32_t j = 0; j <_param->_size_queue; j++) 319 // { 320 // if (j < (i - 1)) 321 // { 322 // vhdl->set_body (4,"sig_SEL_"+toString(j)+" <= in_EXECUTE_QUEUE_OUT_ACK;"); 323 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= in_EXECUTE_QUEUE_OUT_ACK;"); 324 // } 325 // if (j == (i - 1)) 326 // { 327 // vhdl->set_body (4,"sig_SEL_"+toString(j)+" <= '0';"); 328 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= in_EXECUTE_QUEUE_OUT_ACK and in_EXECUTE_QUEUE_IN_VAL;"); 329 // } 330 // if (j == i) 331 // { 332 // if (j < (_param->_size_queue - 1)) 333 // vhdl->set_body (4,"sig_SEL_"+toString(j)+" <= '0';"); 334 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= in_EXECUTE_QUEUE_IN_VAL and not in_EXECUTE_QUEUE_OUT_ACK;"); 335 // } 336 // if (j > i) 337 // { 338 // if (j < (_param->_size_queue - 1)) 339 // vhdl->set_body (4,"sig_SEL_"+toString(j)+" <= '0';"); 340 // vhdl->set_body (4,"sig_WEN_"+toString(j)+" <= '0';"); 341 // } 342 // } 343 // } 344 // vhdl->set_body (3,"when others =>"); 345 // vhdl->set_body (2,"end case;"); 346 // vhdl->set_body (0,"end process;"); 142 vhdl->set_debug ("in_CLOCK = 'U'","GLOP1: Clock = 'U'"); 143 vhdl->set_debug ("in_CLOCK = 'X'","GLOP2: Clock = 'X'"); 144 vhdl->set_debug ("in_CLOCK = 'Z'","GLOP3: Clock = 'Z'"); 145 vhdl->set_debug ("in_CLOCK = 'W'","GLOP4: Clock = 'W'"); 146 vhdl->set_debug ("in_CLOCK = '1'","KANE : Clock = '1'"); 147 vhdl->set_debug ("in_CLOCK = '0'","SETH : Clock = '0'"); 347 148 348 149 log_printf(FUNC,Execute_queue,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Parameters.cpp
r111 r113 27 27 uint32_t size_general_data , 28 28 uint32_t size_special_data , 29 bool is_toplevel ) 29 bool is_toplevel ): 30 behavioural::Parameters("Execute_queue") 30 31 { 31 32 log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); … … 57 58 copy(); 58 59 } 59 60 _size_internal_queue =61 (_size_context_id +62 _size_front_end_id +63 _size_ooo_engine_id +64 _size_rob_ptr +65 // _size_operation +66 // _size_type +67 _size_special_data +68 _size_exception +69 1 +70 _size_general_data +71 _size_general_data72 );73 60 74 61 log_printf(FUNC,Execute_queue,FUNCTION,"End"); … … 114 101 { 115 102 log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); 103 104 _size_internal_queue = 105 (_size_context_id + 106 _size_front_end_id + 107 _size_ooo_engine_id + 108 _size_rob_ptr + 109 // _size_operation + 110 // _size_type + 111 _size_special_data + 112 _size_exception + 113 1 + 114 _size_general_data + 115 _size_general_data 116 ); 117 116 118 log_printf(FUNC,Execute_queue,FUNCTION,"End"); 117 119 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Write_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/SelfTest/include/top.h
r111 r113 4 4 * [ Description ] 5 5 * 6 * Test " RegisterFile"6 * Test "Write_unit" 7 7 */ 8 8 … … 11 11 #endif 12 12 13 #include <string> 14 #include <iostream> 15 #include <sys/time.h> 13 #define NB_ITERATION 1 14 #define CYCLE_MAX (2048*NB_ITERATION) 16 15 16 #include "Common/include/Test.h" 17 17 #include "Common/include/Time.h" 18 18 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/include/Write_unit.h" … … 28 28 using namespace morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit; 29 29 30 void test (string name, 31 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters * param); 30 SC_MODULE(top) 31 { 32 #ifdef SYSTEMC 33 private: sc_clock * in_CLOCK ; 34 private: sc_signal<Tcontrol_t> * in_NRESET; 35 36 private: sc_signal<Tcontrol_t > * in_WRITE_UNIT_IN_VAL ; 37 private: sc_signal<Tcontrol_t > * out_WRITE_UNIT_IN_ACK ; 38 private: sc_signal<Tcontext_t > * in_WRITE_UNIT_IN_CONTEXT_ID ; 39 private: sc_signal<Tcontext_t > * in_WRITE_UNIT_IN_FRONT_END_ID ; 40 private: sc_signal<Tcontext_t > * in_WRITE_UNIT_IN_OOO_ENGINE_ID; 41 private: sc_signal<Tpacket_t > * in_WRITE_UNIT_IN_PACKET_ID ; 42 //private: sc_signal<Toperation_t > * in_WRITE_UNIT_IN_OPERATION ; 43 //private: sc_signal<Ttype_t > * in_WRITE_UNIT_IN_TYPE ; 44 private: sc_signal<Tcontrol_t > * in_WRITE_UNIT_IN_WRITE_RD ; 45 private: sc_signal<Tgeneral_address_t> * in_WRITE_UNIT_IN_NUM_REG_RD ; 46 private: sc_signal<Tgeneral_data_t > * in_WRITE_UNIT_IN_DATA_RD ; 47 private: sc_signal<Tcontrol_t > * in_WRITE_UNIT_IN_WRITE_RE ; 48 private: sc_signal<Tspecial_address_t> * in_WRITE_UNIT_IN_NUM_REG_RE ; 49 private: sc_signal<Tspecial_data_t > * in_WRITE_UNIT_IN_DATA_RE ; 50 private: sc_signal<Texception_t > * in_WRITE_UNIT_IN_EXCEPTION ; 51 private: sc_signal<Tcontrol_t > * in_WRITE_UNIT_IN_NO_SEQUENCE ; 52 private: sc_signal<Taddress_t > * in_WRITE_UNIT_IN_ADDRESS ; 53 54 private: sc_signal<Tcontrol_t > * out_WRITE_UNIT_OUT_VAL ; 55 private: sc_signal<Tcontrol_t > * in_WRITE_UNIT_OUT_ACK ; 56 private: sc_signal<Tcontext_t > * out_WRITE_UNIT_OUT_CONTEXT_ID ; 57 private: sc_signal<Tcontext_t > * out_WRITE_UNIT_OUT_FRONT_END_ID ; 58 private: sc_signal<Tcontext_t > * out_WRITE_UNIT_OUT_OOO_ENGINE_ID; 59 private: sc_signal<Tpacket_t > * out_WRITE_UNIT_OUT_PACKET_ID ; 60 //private: sc_signal<Toperation_t > * out_WRITE_UNIT_OUT_OPERATION ; 61 //private: sc_signal<Ttype_t > * out_WRITE_UNIT_OUT_TYPE ; 62 private: sc_signal<Tspecial_data_t > * out_WRITE_UNIT_OUT_FLAGS ; 63 private: sc_signal<Texception_t > * out_WRITE_UNIT_OUT_EXCEPTION ; 64 private: sc_signal<Tcontrol_t > * out_WRITE_UNIT_OUT_NO_SEQUENCE ; 65 private: sc_signal<Taddress_t > * out_WRITE_UNIT_OUT_ADDRESS ; 66 private: sc_signal<Tgeneral_data_t > * out_WRITE_UNIT_OUT_DATA ; 67 68 private: sc_signal<Tcontrol_t > ** out_GPR_WRITE_VAL ; 69 private: sc_signal<Tcontrol_t > ** in_GPR_WRITE_ACK ; 70 private: sc_signal<Tcontext_t > ** out_GPR_WRITE_OOO_ENGINE_ID ; 71 private: sc_signal<Tgeneral_address_t> ** out_GPR_WRITE_NUM_REG ; 72 private: sc_signal<Tgeneral_data_t > ** out_GPR_WRITE_DATA ; 73 74 private: sc_signal<Tcontrol_t > ** out_SPR_WRITE_VAL ; 75 private: sc_signal<Tcontrol_t > ** in_SPR_WRITE_ACK ; 76 private: sc_signal<Tcontext_t > ** out_SPR_WRITE_OOO_ENGINE_ID ; 77 private: sc_signal<Tspecial_address_t> ** out_SPR_WRITE_NUM_REG ; 78 private: sc_signal<Tspecial_data_t > ** out_SPR_WRITE_DATA ; 79 80 private: sc_signal<Tcontext_t > ** out_BYPASS_WRITE_OOO_ENGINE_ID ; 81 private: sc_signal<Tcontrol_t > ** out_BYPASS_WRITE_GPR_VAL ; 82 private: sc_signal<Tgeneral_address_t> ** out_BYPASS_WRITE_GPR_NUM_REG ; // RD 83 private: sc_signal<Tgeneral_data_t > ** out_BYPASS_WRITE_GPR_DATA ; 84 private: sc_signal<Tcontrol_t > ** out_BYPASS_WRITE_SPR_VAL ; 85 private: sc_signal<Tspecial_address_t> ** out_BYPASS_WRITE_SPR_NUM_REG ; // RE 86 private: sc_signal<Tspecial_data_t > ** out_BYPASS_WRITE_SPR_DATA ; 87 #endif 88 89 private: std::string name; 90 private: Tusage_t _usage; 91 private: morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters * _param; 92 #ifdef STATISTICS 93 private: morpheo::behavioural::Parameters_Statistics * _param_stat; 94 #endif 95 private: Write_unit * component; 96 97 private: void usage 98 ( 99 #ifdef MTI_SYSTEMC 100 int argc, const char * const * argv 101 #else 102 int argc, char * argv[] 103 #endif 104 ); 105 private: void allocation (void); 106 private: void deallocation (void); 107 public : void test (void); 108 109 #ifdef MTI_SYSTEMC 110 SC_CTOR(top::top); 111 #else 112 public : top (sc_module_name module_name,int argc, char * argv[]); 113 #endif 114 public : ~top(void); 115 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/SelfTest/src/main.cpp
r88 r113 6 6 */ 7 7 8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/SelfTest/include/t est.h"8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 11 11 12 void usage (int argc, char * argv[]) 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 13 16 { 14 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 err (_("list_params is :\n")); 16 err (_(" * size_write_queue (uint32_t)\n")); 17 err (_(" * size_execute_queue (uint32_t)\n")); 18 err (_(" * nb_context (uint32_t)\n")); 19 err (_(" * nb_front_end (uint32_t)\n")); 20 err (_(" * nb_ooo_engine (uint32_t)\n")); 21 err (_(" * nb_packet (uint32_t)\n")); 22 err (_(" * size_general_data (uint32_t)\n")); 23 err (_(" * nb_general_register (uint32_t)\n")); 24 err (_(" * size_special_data (uint32_t)\n")); 25 err (_(" * nb_special_register (uint32_t)\n")); 26 err (_(" * nb_bypass_write (uint32_t)\n")); 27 28 exit (1); 29 } 30 31 #ifndef SYSTEMC 32 int main (int argc, char * argv[]) 33 #else 34 int sc_main (int argc, char * argv[]) 35 #endif 36 { 37 if (argc != 2+NB_PARAMS) 38 usage (argc, argv); 39 40 uint32_t x = 1; 41 42 const string name = argv[x++]; 43 const uint32_t size_write_queue = atoi(argv[x++]); 44 const uint32_t size_execute_queue = atoi(argv[x++]); 45 const uint32_t nb_context = atoi(argv[x++]); 46 const uint32_t nb_front_end = atoi(argv[x++]); 47 const uint32_t nb_ooo_engine = atoi(argv[x++]); 48 const uint32_t nb_packet = atoi(argv[x++]); 49 const uint32_t size_general_data = atoi(argv[x++]); 50 const uint32_t nb_general_register = atoi(argv[x++]); 51 const uint32_t size_special_data = atoi(argv[x++]); 52 const uint32_t nb_special_register = atoi(argv[x++]); 53 const uint32_t nb_bypass_write = atoi(argv[x++]); 17 int _return = EXIT_SUCCESS; 54 18 55 19 try 56 20 { 57 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters 58 (size_write_queue , 59 size_execute_queue , 60 nb_context , 61 nb_front_end , 62 nb_ooo_engine , 63 nb_packet , 64 size_general_data , 65 nb_general_register, 66 size_special_data , 67 nb_special_register, 68 nb_bypass_write , 69 true // is_toplevel 70 ); 71 72 msg(_("%s"),param->print(1).c_str()); 73 74 test (name,param); 21 top * my_top = new top ("my_top",argc,argv); 22 23 my_top->test(); 24 25 delete my_top; 75 26 } 76 27 catch (morpheo::ErrorMorpheo & error) 77 28 { 78 msg (_("<%s> : %s.\n"),name.c_str(),error.what ());79 exit (EXIT_FAILURE);29 msgError(_("%s\n"),error.what ()); 30 _return = EXIT_FAILURE; 80 31 } 81 catch (...) 32 33 try 82 34 { 83 err (_("<%s> : This test must generate a error.\n"),name.c_str()); 84 exit (EXIT_FAILURE); 35 if (_return == EXIT_SUCCESS) 36 TEST_OK("Write_unit : no error"); 37 else 38 TEST_KO("Write_unit : a lot of error"); 39 } 40 catch (morpheo::ErrorMorpheo & error) 41 { 42 // msgError(_("<%s> :\n%s"),name.c_str(), error.what ()); 43 _return = EXIT_FAILURE; 85 44 } 86 45 87 return (EXIT_SUCCESS);46 return _return; 88 47 } 89 48 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Write_queue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/SelfTest/include/top.h
r111 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 * Test " RegisterFile"6 * Test "Write_queue" 7 7 */ 8 8 … … 11 11 #endif 12 12 13 #include <string> 14 #include <iostream> 15 #include <sys/time.h> 13 #define NB_ITERATION 1 14 #define CYCLE_MAX (1024*NB_ITERATION) 16 15 16 #include "Common/include/Test.h" 17 17 #include "Common/include/Time.h" 18 18 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Write_queue.h" … … 29 29 using namespace morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue; 30 30 31 void test (string name, 32 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters * param); 31 SC_MODULE(top) 32 { 33 #ifdef SYSTEMC 34 private: sc_clock * in_CLOCK ; 35 private: sc_signal<Tcontrol_t> * in_NRESET; 36 37 private: sc_signal<Tcontrol_t > * in_WRITE_QUEUE_IN_VAL ; 38 private: sc_signal<Tcontrol_t > * out_WRITE_QUEUE_IN_ACK ; 39 private: sc_signal<Tcontext_t > * in_WRITE_QUEUE_IN_CONTEXT_ID ; 40 private: sc_signal<Tcontext_t > * in_WRITE_QUEUE_IN_FRONT_END_ID ; 41 private: sc_signal<Tcontext_t > * in_WRITE_QUEUE_IN_OOO_ENGINE_ID ; 42 private: sc_signal<Tpacket_t > * in_WRITE_QUEUE_IN_PACKET_ID ; 43 //private: sc_signal<Toperation_t > * in_WRITE_QUEUE_IN_OPERATION ; 44 //private: sc_signal<Ttype_t > * in_WRITE_QUEUE_IN_TYPE ; 45 private: sc_signal<Tcontrol_t > * in_WRITE_QUEUE_IN_WRITE_RD ; 46 private: sc_signal<Tgeneral_address_t> * in_WRITE_QUEUE_IN_NUM_REG_RD ; 47 private: sc_signal<Tgeneral_data_t > * in_WRITE_QUEUE_IN_DATA_RD ; 48 private: sc_signal<Tcontrol_t > * in_WRITE_QUEUE_IN_WRITE_RE ; 49 private: sc_signal<Tspecial_address_t> * in_WRITE_QUEUE_IN_NUM_REG_RE ; 50 private: sc_signal<Tspecial_data_t > * in_WRITE_QUEUE_IN_DATA_RE ; 51 private: sc_signal<Texception_t > * in_WRITE_QUEUE_IN_EXCEPTION ; 52 private: sc_signal<Tcontrol_t > * in_WRITE_QUEUE_IN_NO_SEQUENCE ; 53 private: sc_signal<Taddress_t > * in_WRITE_QUEUE_IN_ADDRESS ; 54 private: sc_signal<Tcontrol_t > * out_WRITE_QUEUE_OUT_VAL ; 55 private: sc_signal<Tcontrol_t > * in_WRITE_QUEUE_OUT_ACK ; 56 private: sc_signal<Tcontext_t > * out_WRITE_QUEUE_OUT_CONTEXT_ID ; 57 private: sc_signal<Tcontext_t > * out_WRITE_QUEUE_OUT_FRONT_END_ID ; 58 private: sc_signal<Tcontext_t > * out_WRITE_QUEUE_OUT_OOO_ENGINE_ID; 59 private: sc_signal<Tpacket_t > * out_WRITE_QUEUE_OUT_PACKET_ID ; 60 //private: sc_signal<Toperation_t > * out_WRITE_QUEUE_OUT_OPERATION ; 61 //private: sc_signal<Ttype_t > * out_WRITE_QUEUE_OUT_TYPE ; 62 private: sc_signal<Tspecial_data_t > * out_WRITE_QUEUE_OUT_FLAGS ; 63 private: sc_signal<Texception_t > * out_WRITE_QUEUE_OUT_EXCEPTION ; 64 private: sc_signal<Tcontrol_t > * out_WRITE_QUEUE_OUT_NO_SEQUENCE ; 65 private: sc_signal<Tgeneral_data_t > * out_WRITE_QUEUE_OUT_ADDRESS ; 66 private: sc_signal<Taddress_t > * out_WRITE_QUEUE_OUT_DATA ; 67 private: sc_signal<Tcontrol_t > ** out_GPR_WRITE_VAL ; 68 private: sc_signal<Tcontrol_t > ** in_GPR_WRITE_ACK ; 69 private: sc_signal<Tcontext_t > ** out_GPR_WRITE_OOO_ENGINE_ID ; 70 private: sc_signal<Tgeneral_address_t> ** out_GPR_WRITE_NUM_REG ; 71 private: sc_signal<Tgeneral_data_t > ** out_GPR_WRITE_DATA ; 72 private: sc_signal<Tcontrol_t > ** out_SPR_WRITE_VAL ; 73 private: sc_signal<Tcontrol_t > ** in_SPR_WRITE_ACK ; 74 private: sc_signal<Tcontext_t > ** out_SPR_WRITE_OOO_ENGINE_ID ; 75 private: sc_signal<Tspecial_address_t> ** out_SPR_WRITE_NUM_REG ; 76 private: sc_signal<Tspecial_data_t > ** out_SPR_WRITE_DATA ; 77 private: sc_signal<Tcontext_t > ** out_BYPASS_WRITE_OOO_ENGINE_ID ; 78 private: sc_signal<Tcontrol_t > ** out_BYPASS_WRITE_GPR_VAL ; 79 private: sc_signal<Tgeneral_address_t> ** out_BYPASS_WRITE_GPR_NUM_REG ; 80 private: sc_signal<Tgeneral_data_t > ** out_BYPASS_WRITE_GPR_DATA ; 81 private: sc_signal<Tcontrol_t > ** out_BYPASS_WRITE_SPR_VAL ; 82 private: sc_signal<Tspecial_address_t> ** out_BYPASS_WRITE_SPR_NUM_REG ; 83 private: sc_signal<Tspecial_data_t > ** out_BYPASS_WRITE_SPR_DATA ; 84 85 #endif 86 87 private: std::string name; 88 private: Tusage_t _usage; 89 private: morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters * _param; 90 #ifdef STATISTICS 91 private: morpheo::behavioural::Parameters_Statistics * _param_stat; 92 #endif 93 private: Write_queue * component; 94 95 private: void usage 96 ( 97 #ifdef MTI_SYSTEMC 98 int argc, const char * const * argv 99 #else 100 int argc, char * argv[] 101 #endif 102 ); 103 private: void allocation (void); 104 private: void deallocation (void); 105 public : void test (void); 106 107 #ifdef MTI_SYSTEMC 108 SC_CTOR(top::top); 109 #else 110 public : top (sc_module_name module_name,int argc, char * argv[]); 111 #endif 112 public : ~top(void); 113 }; 114 115 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/SelfTest/src/main.cpp
r88 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ 7 7 8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/SelfTest/include/t est.h"8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 10 11 12 void usage (int argc, char * argv[]) 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 13 16 { 14 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 err (_("list_params is :\n")); 16 err (_(" * size_queue (uint32_t)\n")); 17 err (_(" * nb_context (uint32_t)\n")); 18 err (_(" * nb_front_end (uint32_t)\n")); 19 err (_(" * nb_ooo_engine (uint32_t)\n")); 20 err (_(" * nb_packet (uint32_t)\n")); 21 err (_(" * size_general_data (uint32_t)\n")); 22 err (_(" * nb_general_register (uint32_t)\n")); 23 err (_(" * size_special_data (uint32_t)\n")); 24 err (_(" * nb_special_register (uint32_t)\n")); 25 err (_(" * nb_bypass_write (uint32_t)\n")); 26 27 exit (1); 28 } 29 30 #ifndef SYSTEMC 31 int main (int argc, char * argv[]) 32 #else 33 int sc_main (int argc, char * argv[]) 34 #endif 35 { 36 if (argc != 2+NB_PARAMS) 37 usage (argc, argv); 38 39 uint32_t x = 1; 40 41 const string name = argv[x++]; 42 const uint32_t size_queue = atoi(argv[x++]); 43 const uint32_t nb_context = atoi(argv[x++]); 44 const uint32_t nb_front_end = atoi(argv[x++]); 45 const uint32_t nb_ooo_engine = atoi(argv[x++]); 46 const uint32_t nb_packet = atoi(argv[x++]); 47 const uint32_t size_general_data = atoi(argv[x++]); 48 const uint32_t nb_general_register = atoi(argv[x++]); 49 const uint32_t size_special_data = atoi(argv[x++]); 50 const uint32_t nb_special_register = atoi(argv[x++]); 51 const uint32_t nb_bypass_write = atoi(argv[x++]); 17 int _return = EXIT_SUCCESS; 52 18 53 19 try 54 20 { 55 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters 56 (size_queue , 57 nb_context , 58 nb_front_end , 59 nb_ooo_engine , 60 nb_packet , 61 size_general_data , 62 nb_general_register, 63 size_special_data , 64 nb_special_register, 65 nb_bypass_write , 66 true // is_toplevel 67 ); 68 69 msg(_("%s"),param->print(1).c_str()); 70 71 test (name,param); 21 top * my_top = new top ("my_top",argc,argv); 22 23 my_top->test(); 24 25 delete my_top; 72 26 } 73 27 catch (morpheo::ErrorMorpheo & error) 74 28 { 75 msg (_("<%s> : %s.\n"),name.c_str(),error.what ());76 exit (EXIT_FAILURE);29 msg(_("%s"),error.what ()); 30 _return = EXIT_FAILURE; 77 31 } 78 catch (...) 32 33 try 79 34 { 80 err (_("<%s> : This test must generate a error.\n"),name.c_str()); 81 exit (EXIT_FAILURE); 35 if (_return == EXIT_SUCCESS) 36 TEST_OK("Write_queue : no error"); 37 else 38 TEST_KO("Write_queue : a lot of error"); 39 } 40 catch (morpheo::ErrorMorpheo & error) 41 { 42 // msgError(_("<%s> :\n%s"),name.c_str(), error.what ()); 43 _return = EXIT_FAILURE; 82 44 } 83 45 84 return (EXIT_SUCCESS);46 return _return; 85 47 } 86 48 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Write_queue.h
r97 r113 30 30 #include "Behavioural/include/Usage.h" 31 31 32 #include "Behavioural/Generic/Queue/include/Queue.h" 33 32 34 namespace morpheo { 33 35 namespace behavioural { … … 48 50 protected : const std::string _name; 49 51 protected : const Parameters * _param; 50 p rivate : constTusage_t _usage;52 public : Tusage_t _usage; 51 53 52 54 #ifdef STATISTICS … … 126 128 127 129 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 130 private : morpheo::behavioural::generic::queue::Parameters * _param_queue; 131 private : morpheo::behavioural::generic::queue::Queue * _component_queue; 128 132 129 133 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Parameters.cpp
r103 r113 30 30 uint32_t nb_special_register, 31 31 uint32_t nb_bypass_write , 32 bool is_toplevel) 32 bool is_toplevel): 33 behavioural::Parameters ("Write_queue") 33 34 { 34 35 log_printf(FUNC,Write_queue,FUNCTION,"Begin"); … … 67 68 copy(); 68 69 } 69 70 _size_internal_queue =71 ( _size_context_id +72 _size_front_end_id +73 _size_ooo_engine_id +74 _size_rob_ptr +75 1 +76 _size_general_register +77 _size_general_data +78 1 +79 _size_special_register +80 _size_special_data +81 _size_exception +82 1 +83 _size_instruction_address84 );85 70 86 71 log_printf(FUNC,Write_queue,FUNCTION,"End"); … … 134 119 { 135 120 log_printf(FUNC,Write_queue,FUNCTION,"Begin"); 121 122 _size_internal_queue = 123 ( _size_context_id + 124 _size_front_end_id + 125 _size_ooo_engine_id + 126 _size_rob_ptr + 127 1 + 128 _size_general_register + 129 _size_general_data + 130 1 + 131 _size_special_register + 132 _size_special_data + 133 _size_exception + 134 1 + 135 _size_instruction_address 136 ); 137 136 138 log_printf(FUNC,Write_queue,FUNCTION,"End"); 137 139 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Parameters_msg_error.cpp
r81 r113 26 26 log_printf(FUNC,Write_queue,FUNCTION,"Begin"); 27 27 28 Parameters_test test ( "Write_queue");28 Parameters_test test (_type); 29 29 30 30 if (_nb_bypass_write > _size_queue) 31 test.error("The write_queue can't have more bypass_write than entry in the queue. ");31 test.error("The write_queue can't have more bypass_write than entry in the queue.\n"); 32 32 33 33 log_printf(FUNC,Write_queue,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue.cpp
r88 r113 37 37 ,_usage (usage) 38 38 { 39 log_ printf(FUNC,Write_queue,FUNCTION,"Begin");39 log_begin(Write_queue,FUNCTION); 40 40 41 #if DEBUG_Write_queue == true42 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());41 // #if DEBUG_Write_queue == true 42 // log_printf(INFO,Write_queue,FUNCTION,_("<%s> Parameters"),_name.c_str()); 43 43 44 std::cout << *param << std::endl;45 #endif44 // std::cout << *param << std::endl; 45 // #endif 46 46 47 log_printf(INFO,Write_queue,FUNCTION, "Allocation");47 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Allocation"),_name.c_str()); 48 48 allocation (); 49 49 … … 51 51 if (usage_is_set(_usage,USE_STATISTICS)) 52 52 { 53 log_printf(INFO,Write_queue,FUNCTION, "Allocation of statistics");53 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str()); 54 54 55 55 statistics_declaration(param_statistics); … … 61 61 { 62 62 // generate the vhdl 63 log_printf(INFO,Write_queue,FUNCTION, "Generate the vhdl");63 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str()); 64 64 65 65 vhdl(); … … 70 70 if (usage_is_set(_usage,USE_SYSTEMC)) 71 71 { 72 log_printf(INFO,Write_queue,FUNCTION, "Method - transition");72 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str()); 73 73 74 74 SC_METHOD (transition); … … 80 80 # endif 81 81 82 log_printf(INFO,Write_queue,FUNCTION, "Method - genMoore");82 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str()); 83 83 84 84 SC_METHOD (genMoore); … … 92 92 #endif 93 93 } 94 log_ printf(FUNC,Write_queue,FUNCTION,"End");94 log_end(Write_queue,FUNCTION); 95 95 }; 96 96 … … 99 99 Write_queue::~Write_queue (void) 100 100 { 101 log_ printf(FUNC,Write_queue,FUNCTION,"Begin");101 log_begin(Write_queue,FUNCTION); 102 102 103 103 #ifdef STATISTICS 104 104 if (usage_is_set(_usage,USE_STATISTICS)) 105 105 { 106 log_printf(INFO,Write_queue,FUNCTION, "Generate Statistics file");106 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str()); 107 107 108 108 delete _stat; … … 110 110 #endif 111 111 112 log_printf(INFO,Write_queue,FUNCTION, "Deallocation");112 log_printf(INFO,Write_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str()); 113 113 deallocation (); 114 114 115 log_ printf(FUNC,Write_queue,FUNCTION,"End");115 log_end(Write_queue,FUNCTION); 116 116 }; 117 117 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue_allocation.cpp
r112 r113 28 28 29 29 Entity * entity = _component->set_entity (_name 30 , "Write_queue"30 ,_param->_type 31 31 #ifdef POSITION 32 32 ,COMBINATORY … … 136 136 } 137 137 138 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~138 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 139 139 140 140 _queue = new std::list<write_queue_entry_t *>; 141 142 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 143 _param_queue = new morpheo::behavioural::generic::queue::Parameters 144 (_param->_size_queue, 145 _param->_size_internal_queue, 146 _param->_nb_bypass_write, 147 false, 148 false 149 ); 150 151 std::string queue_name = _name + "_queue"; 152 _component_queue = new morpheo::behavioural::generic::queue::Queue 153 (queue_name.c_str() 154 #ifdef STATISTICS 155 ,NULL 156 #endif 157 ,_param_queue 158 ,USE_VHDL); 159 160 _component->set_component(_component_queue->_component 161 #ifdef POSITION 162 , 50, 50, 50, 50 163 #endif 164 , INSTANCE_LIBRARY 165 ); 141 166 142 167 #ifdef POSITION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue_deallocation.cpp
r112 r113 92 92 93 93 delete _component; 94 delete _component_queue; 95 delete _param_queue; 94 96 95 97 log_printf(FUNC,Write_queue,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue_statistics_declaration.cpp
r81 r113 26 26 27 27 _stat = new Stat (static_cast<std::string>(_name), 28 "Write_queue",28 _param->_type, 29 29 param_statistics); 30 30 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue_vhdl.cpp
r105 r113 9 9 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Write_queue.h" 10 10 #include "Behavioural/include/Vhdl.h" 11 #include "Behavioural/Generic/Queue/include/Queue.h"12 11 13 12 namespace morpheo { … … 26 25 { 27 26 log_printf(FUNC,Write_queue,FUNCTION,"Begin"); 28 29 morpheo::behavioural::generic::queue::Parameters * param_queue;30 morpheo::behavioural::generic::queue::Queue * queue;31 32 param_queue = new morpheo::behavioural::generic::queue::Parameters33 (_param->_size_queue,34 _param->_size_internal_queue,35 _param->_nb_bypass_write,36 false,37 false38 );39 40 std::cout << "size internal queue :" << _param->_size_internal_queue << "." << std::endl;41 42 std::string queue_name = _name + "_queue";43 queue = new morpheo::behavioural::generic::queue::Queue44 (queue_name.c_str()45 #ifdef STATISTICS46 ,NULL47 #endif48 ,param_queue49 ,USE_VHDL);50 51 _component->set_component(queue->_component52 #ifdef POSITION53 , 50, 50, 50, 5054 #endif55 , INSTANCE_LIBRARY56 );57 58 59 27 60 28 Vhdl * vhdl = new Vhdl (_name); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue_vhdl_declaration.cpp
r103 r113 54 54 uint32_t min = 0; 55 55 uint32_t max, size; 56 uint32_t min_ooo, max_ooo ;56 uint32_t min_ooo, max_ooo = 0; 57 57 uint32_t pos_write_rd, min_gpr_num_reg, max_gpr_num_reg, min_gpr_data, max_gpr_data; 58 58 uint32_t pos_write_re, min_spr_num_reg, max_spr_num_reg, min_spr_data, max_spr_data; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/include/Write_unit.h
r97 r113 48 48 protected : const std::string _name; 49 49 protected : const Parameters * _param; 50 p rivate : constTusage_t _usage;50 public : Tusage_t _usage; 51 51 52 52 #ifdef STATISTICS -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/src/Parameters.cpp
r97 r113 30 30 uint32_t nb_special_register, 31 31 uint32_t nb_bypass_write , 32 bool is_toplevel ) 32 bool is_toplevel ): 33 behavioural::Parameters("Write_unit") 33 34 { 34 35 log_printf(FUNC,Write_unit,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/src/Write_unit.cpp
r88 r113 36 36 ,_usage (usage) 37 37 { 38 log_ printf(FUNC,Write_unit,FUNCTION,"Begin");38 log_begin(Write_unit,FUNCTION); 39 39 40 #if DEBUG_Write_unit == true41 log_printf(INFO,Write_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());40 // #if DEBUG_Write_unit == true 41 // log_printf(INFO,Write_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); 42 42 43 std::cout << *param << std::endl;44 #endif43 // std::cout << *param << std::endl; 44 // #endif 45 45 46 log_printf(INFO,Write_unit,FUNCTION, "Allocation");46 log_printf(INFO,Write_unit,FUNCTION,_("<%s> Allocation"),_name.c_str()); 47 47 48 48 allocation ( … … 55 55 if (usage_is_set(_usage,USE_STATISTICS)) 56 56 { 57 log_printf(INFO,Write_unit,FUNCTION, "Allocation of statistics");57 log_printf(INFO,Write_unit,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str()); 58 58 59 59 statistics_declaration(param_statistics); … … 65 65 { 66 66 // generate the vhdl 67 log_printf(INFO,Write_unit,FUNCTION, "Generate the vhdl");67 log_printf(INFO,Write_unit,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str()); 68 68 69 69 vhdl(); … … 74 74 if (usage_is_set(_usage,USE_SYSTEMC)) 75 75 { 76 log_printf(INFO,Write_unit,FUNCTION, "Method - transition");76 log_printf(INFO,Write_unit,FUNCTION,_("<%s> Method - transition"),_name.c_str()); 77 77 78 78 SC_METHOD (transition); … … 86 86 #endif 87 87 } 88 log_ printf(FUNC,Write_unit,FUNCTION,"End");88 log_end(Write_unit,FUNCTION); 89 89 }; 90 90 … … 93 93 Write_unit::~Write_unit (void) 94 94 { 95 log_ printf(FUNC,Write_unit,FUNCTION,"Begin");95 log_begin(Write_unit,FUNCTION); 96 96 97 97 #ifdef STATISTICS 98 98 if (usage_is_set(_usage,USE_STATISTICS)) 99 99 { 100 log_printf(INFO,Write_unit,FUNCTION, "Generate Statistics file");100 log_printf(INFO,Write_unit,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str()); 101 101 102 102 delete _stat; … … 104 104 #endif 105 105 106 log_printf(INFO,Write_unit,FUNCTION, "Deallocation");106 log_printf(INFO,Write_unit,FUNCTION,_("<%s> Deallocation"),_name.c_str()); 107 107 deallocation (); 108 108 109 log_ printf(FUNC,Write_unit,FUNCTION,"End");109 log_end(Write_unit,FUNCTION); 110 110 }; 111 111 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/src/Write_unit_allocation.cpp
r112 r113 34 34 35 35 Entity * entity = _component->set_entity (_name 36 , "Write_unit"36 ,_param->_type 37 37 #ifdef POSITION 38 38 ,COMBINATORY -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/src/Write_unit_statistics_declaration.cpp
r81 r113 25 25 26 26 _stat = new Stat (static_cast<std::string>(_name), 27 "Write_unit",27 _param->_type, 28 28 param_statistics); 29 29 30 _stat->add_stat(component_write_queue->_stat); 31 if (_param->_have_component_execute_queue) 30 if (usage_is_set(component_write_queue->_usage,USE_STATISTICS)) 31 _stat->add_stat(component_write_queue->_stat); 32 33 if (_param->_have_component_execute_queue and (usage_is_set(component_execute_queue->_usage,USE_STATISTICS))) 32 34 _stat->add_stat(component_execute_queue->_stat); 33 35 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Execution_unit_to_Write_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Execute_unit_to_Write_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Read_unit_to_Execution_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Register_unit 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Register_unit_Glue 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/Makefile.defs
r83 r113 7 7 # 8 8 9 ENTITY = Context_State 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Instruction 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Decod 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp
r112 r113 51 51 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 52 52 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 53 54 sc_signal<Tcontrol_t > *** in_IFETCH_VAL ;//[nb_context][nb_inst_fetch] 55 sc_signal<Tcontrol_t > *** out_IFETCH_ACK ;//[nb_context][nb_inst_fetch] 56 sc_signal<Tinstruction_t > *** in_IFETCH_INSTRUCTION ;//[nb_context][nb_inst_fetch] 57 sc_signal<Tcontext_t > ** in_IFETCH_CONTEXT_ID ;//[nb_context] 58 sc_signal<Tgeneral_address_t > ** in_IFETCH_ADDRESS ;//[nb_context] 59 //sc_signal<Tgeneral_address_t > ** in_IFETCH_ADDRESS_NEXT ;//[nb_context] 60 sc_signal<Tinst_ifetch_ptr_t > ** in_IFETCH_INST_IFETCH_PTR ;//[nb_context] 61 sc_signal<Tbranch_state_t > ** in_IFETCH_BRANCH_STATE ;//[nb_context] 62 sc_signal<Tprediction_ptr_t > ** in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ;//[nb_context] 63 sc_signal<Texception_t > ** in_IFETCH_EXCEPTION ;//[nb_context] 64 sc_signal<Tcontrol_t > ** out_DECOD_VAL ;//[nb_inst_decod] 65 sc_signal<Tcontrol_t > ** in_DECOD_ACK ;//[nb_inst_decod] 66 sc_signal<Tcontext_t > ** out_DECOD_CONTEXT_ID ;//[nb_inst_decod] 67 sc_signal<Tdepth_t > ** out_DECOD_DEPTH ;//[nb_inst_decod] 68 sc_signal<Ttype_t > ** out_DECOD_TYPE ;//[nb_inst_decod] 69 sc_signal<Toperation_t > ** out_DECOD_OPERATION ;//[nb_inst_decod] 70 sc_signal<Tcontrol_t > ** out_DECOD_NO_EXECUTE ;//[nb_inst_decod] 71 sc_signal<Tcontrol_t > ** out_DECOD_IS_DELAY_SLOT ;//[nb_inst_decod] 72 sc_signal<Tgeneral_data_t > ** out_DECOD_ADDRESS ;//[nb_inst_decod] 73 sc_signal<Tgeneral_data_t > ** out_DECOD_ADDRESS_NEXT ;//[nb_inst_decod] 74 sc_signal<Tcontrol_t > ** out_DECOD_HAS_IMMEDIAT ;//[nb_inst_decod] 75 sc_signal<Tgeneral_data_t > ** out_DECOD_IMMEDIAT ;//[nb_inst_decod] 76 sc_signal<Tcontrol_t > ** out_DECOD_READ_RA ;//[nb_inst_decod] 77 sc_signal<Tgeneral_address_t > ** out_DECOD_NUM_REG_RA ;//[nb_inst_decod] 78 sc_signal<Tcontrol_t > ** out_DECOD_READ_RB ;//[nb_inst_decod] 79 sc_signal<Tgeneral_address_t > ** out_DECOD_NUM_REG_RB ;//[nb_inst_decod] 80 sc_signal<Tcontrol_t > ** out_DECOD_READ_RC ;//[nb_inst_decod] 81 sc_signal<Tspecial_address_t > ** out_DECOD_NUM_REG_RC ;//[nb_inst_decod] 82 sc_signal<Tcontrol_t > ** out_DECOD_WRITE_RD ;//[nb_inst_decod] 83 sc_signal<Tgeneral_address_t > ** out_DECOD_NUM_REG_RD ;//[nb_inst_decod] 84 sc_signal<Tcontrol_t > ** out_DECOD_WRITE_RE ;//[nb_inst_decod] 85 sc_signal<Tspecial_address_t > ** out_DECOD_NUM_REG_RE ;//[nb_inst_decod] 86 sc_signal<Texception_t > ** out_DECOD_EXCEPTION_USE ;//[nb_inst_decod] 87 sc_signal<Texception_t > ** out_DECOD_EXCEPTION ;//[nb_inst_decod] 88 sc_signal<Tcontrol_t > ** out_PREDICT_VAL ;//[nb_inst_decod] 89 sc_signal<Tcontrol_t > ** in_PREDICT_ACK ;//[nb_inst_decod] 90 sc_signal<Tcontext_t > ** out_PREDICT_CONTEXT_ID ;//[nb_inst_decod] 91 sc_signal<Tcontrol_t > ** out_PREDICT_MATCH_INST_IFETCH_PTR ;//[nb_inst_decod] 92 sc_signal<Tbranch_state_t > ** out_PREDICT_BRANCH_STATE ;//[nb_inst_decod] 93 sc_signal<Tprediction_ptr_t > ** out_PREDICT_BRANCH_UPDATE_PREDICTION_ID;//[nb_inst_decod] 94 sc_signal<Tbranch_condition_t> ** out_PREDICT_BRANCH_CONDITION ;//[nb_inst_decod] 95 //sc_signal<Tcontrol_t > ** out_PREDICT_BRANCH_STACK_WRITE ;//[nb_inst_decod] 96 sc_signal<Tcontrol_t > ** out_PREDICT_BRANCH_DIRECTION ;//[nb_inst_decod] 97 sc_signal<Tgeneral_data_t > ** out_PREDICT_ADDRESS_SRC ;//[nb_inst_decod] 98 sc_signal<Tgeneral_data_t > ** out_PREDICT_ADDRESS_DEST ;//[nb_inst_decod] 99 sc_signal<Tcontrol_t > ** in_PREDICT_CAN_CONTINUE ;//[nb_inst_decod] 100 sc_signal<Tcontrol_t > ** in_CONTEXT_DECOD_ENABLE ;//[nb_context] 101 sc_signal<Tcontrol_t > ** in_CONTEXT_DEPTH_VAL ;//[nb_context] 102 sc_signal<Tdepth_t > ** in_CONTEXT_DEPTH ;//[nb_context] 103 sc_signal<Tcontrol_t > * out_CONTEXT_EVENT_VAL ; 104 sc_signal<Tcontrol_t > * in_CONTEXT_EVENT_ACK ; 105 sc_signal<Tcontext_t > * out_CONTEXT_EVENT_CONTEXT_ID ; 106 sc_signal<Tdepth_t > * out_CONTEXT_EVENT_DEPTH ; 107 sc_signal<Tevent_type_t > * out_CONTEXT_EVENT_TYPE ; 108 sc_signal<Tcontrol_t > * out_CONTEXT_EVENT_IS_DELAY_SLOT ; 109 sc_signal<Tgeneral_data_t > * out_CONTEXT_EVENT_ADDRESS ; 110 sc_signal<Tgeneral_data_t > * out_CONTEXT_EVENT_ADDRESS_EPCR ; 53 111 54 112 ALLOC2_SC_SIGNAL( in_IFETCH_VAL ," in_IFETCH_VAL ",Tcontrol_t ,_param->_nb_context,_param->_nb_inst_fetch[it1]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/Makefile.defs
r82 r113 7 7 # 8 8 9 ENTITY = Decod_queue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/test.cpp
r111 r113 51 51 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 52 52 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 53 54 sc_signal<Tcontrol_t > ** in_DECOD_IN_VAL ;//[nb_inst_decod] 55 sc_signal<Tcontrol_t > ** out_DECOD_IN_ACK ;//[nb_inst_decod] 56 sc_signal<Tcontext_t > ** in_DECOD_IN_CONTEXT_ID ;//[nb_inst_decod] 57 sc_signal<Tdepth_t > ** in_DECOD_IN_DEPTH ;//[nb_inst_decod] 58 sc_signal<Ttype_t > ** in_DECOD_IN_TYPE ;//[nb_inst_decod] 59 sc_signal<Toperation_t > ** in_DECOD_IN_OPERATION ;//[nb_inst_decod] 60 sc_signal<Tcontrol_t > ** in_DECOD_IN_NO_EXECUTE ;//[nb_inst_decod] 61 sc_signal<Tcontrol_t > ** in_DECOD_IN_IS_DELAY_SLOT ;//[nb_inst_decod] 62 sc_signal<Tgeneral_data_t > ** in_DECOD_IN_ADDRESS ;//[nb_inst_decod] 63 sc_signal<Tgeneral_data_t > ** in_DECOD_IN_ADDRESS_NEXT ;//[nb_inst_decod] 64 sc_signal<Tcontrol_t > ** in_DECOD_IN_HAS_IMMEDIAT ;//[nb_inst_decod] 65 sc_signal<Tgeneral_data_t > ** in_DECOD_IN_IMMEDIAT ;//[nb_inst_decod] 66 sc_signal<Tcontrol_t > ** in_DECOD_IN_READ_RA ;//[nb_inst_decod] 67 sc_signal<Tgeneral_address_t > ** in_DECOD_IN_NUM_REG_RA ;//[nb_inst_decod] 68 sc_signal<Tcontrol_t > ** in_DECOD_IN_READ_RB ;//[nb_inst_decod] 69 sc_signal<Tgeneral_address_t > ** in_DECOD_IN_NUM_REG_RB ;//[nb_inst_decod] 70 sc_signal<Tcontrol_t > ** in_DECOD_IN_READ_RC ;//[nb_inst_decod] 71 sc_signal<Tspecial_address_t > ** in_DECOD_IN_NUM_REG_RC ;//[nb_inst_decod] 72 sc_signal<Tcontrol_t > ** in_DECOD_IN_WRITE_RD ;//[nb_inst_decod] 73 sc_signal<Tgeneral_address_t > ** in_DECOD_IN_NUM_REG_RD ;//[nb_inst_decod] 74 sc_signal<Tcontrol_t > ** in_DECOD_IN_WRITE_RE ;//[nb_inst_decod] 75 sc_signal<Tspecial_address_t > ** in_DECOD_IN_NUM_REG_RE ;//[nb_inst_decod] 76 sc_signal<Texception_t > ** in_DECOD_IN_EXCEPTION_USE ;//[nb_inst_decod] 77 sc_signal<Texception_t > ** in_DECOD_IN_EXCEPTION ;//[nb_inst_decod] 78 sc_signal<Tcontrol_t > ** out_DECOD_OUT_VAL ;//[nb_inst_decod] 79 sc_signal<Tcontrol_t > ** in_DECOD_OUT_ACK ;//[nb_inst_decod] 80 sc_signal<Tcontext_t > ** out_DECOD_OUT_CONTEXT_ID ;//[nb_inst_decod] 81 sc_signal<Tdepth_t > ** out_DECOD_OUT_DEPTH ;//[nb_inst_decod] 82 sc_signal<Ttype_t > ** out_DECOD_OUT_TYPE ;//[nb_inst_decod] 83 sc_signal<Toperation_t > ** out_DECOD_OUT_OPERATION ;//[nb_inst_decod] 84 sc_signal<Tcontrol_t > ** out_DECOD_OUT_NO_EXECUTE ;//[nb_inst_decod] 85 sc_signal<Tcontrol_t > ** out_DECOD_OUT_IS_DELAY_SLOT ;//[nb_inst_decod] 86 sc_signal<Tgeneral_data_t > ** out_DECOD_OUT_ADDRESS ;//[nb_inst_decod] 87 sc_signal<Tgeneral_data_t > ** out_DECOD_OUT_ADDRESS_NEXT ;//[nb_inst_decod] 88 sc_signal<Tcontrol_t > ** out_DECOD_OUT_HAS_IMMEDIAT ;//[nb_inst_decod] 89 sc_signal<Tgeneral_data_t > ** out_DECOD_OUT_IMMEDIAT ;//[nb_inst_decod] 90 sc_signal<Tcontrol_t > ** out_DECOD_OUT_READ_RA ;//[nb_inst_decod] 91 sc_signal<Tgeneral_address_t > ** out_DECOD_OUT_NUM_REG_RA ;//[nb_inst_decod] 92 sc_signal<Tcontrol_t > ** out_DECOD_OUT_READ_RB ;//[nb_inst_decod] 93 sc_signal<Tgeneral_address_t > ** out_DECOD_OUT_NUM_REG_RB ;//[nb_inst_decod] 94 sc_signal<Tcontrol_t > ** out_DECOD_OUT_READ_RC ;//[nb_inst_decod] 95 sc_signal<Tspecial_address_t > ** out_DECOD_OUT_NUM_REG_RC ;//[nb_inst_decod] 96 sc_signal<Tcontrol_t > ** out_DECOD_OUT_WRITE_RD ;//[nb_inst_decod] 97 sc_signal<Tgeneral_address_t > ** out_DECOD_OUT_NUM_REG_RD ;//[nb_inst_decod] 98 sc_signal<Tcontrol_t > ** out_DECOD_OUT_WRITE_RE ;//[nb_inst_decod] 99 sc_signal<Tspecial_address_t > ** out_DECOD_OUT_NUM_REG_RE ;//[nb_inst_decod] 100 sc_signal<Texception_t > ** out_DECOD_OUT_EXCEPTION_USE ;//[nb_inst_decod] 101 sc_signal<Texception_t > ** out_DECOD_OUT_EXCEPTION ;//[nb_inst_decod] 102 sc_signal<Tdepth_t > ** in_DEPTH_MIN ;//[nb_context] 103 sc_signal<Tdepth_t > ** in_DEPTH_MAX ;//[nb_context] 104 sc_signal<Tcontrol_t > ** in_DEPTH_FULL ;//[nb_context] 105 sc_signal<Tcounter_t > ** out_NB_INST_ALL ;//[nb_context] 53 106 54 107 ALLOC1_SC_SIGNAL( in_DECOD_IN_VAL ," in_DECOD_IN_VAL ",Tcontrol_t ,_param->_nb_inst_decod); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Makefile.defs
r83 r113 7 7 # 8 8 9 ENTITY = Decod_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Front_end_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Address_management 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/SelfTest/src/test.cpp
r112 r113 50 50 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 51 51 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 52 53 sc_signal<Tcontrol_t > * out_ADDRESS_VAL ; 54 sc_signal<Tcontrol_t > * in_ADDRESS_ACK ; //icache_req_ack and ifetch_queue_ack 55 sc_signal<Tgeneral_address_t> * out_ADDRESS_INSTRUCTION_ADDRESS ; 56 sc_signal<Tcontrol_t > ** out_ADDRESS_INSTRUCTION_ENABLE ; //[nb_instruction] 57 sc_signal<Tinst_ifetch_ptr_t> * out_ADDRESS_INST_IFETCH_PTR ; 58 sc_signal<Tbranch_state_t > * out_ADDRESS_BRANCH_STATE ; 59 sc_signal<Tprediction_ptr_t > * out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID ; 60 sc_signal<Tcontrol_t > * out_PREDICT_VAL ; 61 sc_signal<Tcontrol_t > * in_PREDICT_ACK ; 62 sc_signal<Tgeneral_address_t> * out_PREDICT_PC_PREVIOUS ; 63 sc_signal<Tgeneral_address_t> * out_PREDICT_PC_CURRENT ; 64 sc_signal<Tcontrol_t > * out_PREDICT_PC_CURRENT_IS_DS_TAKE ; 65 sc_signal<Tgeneral_address_t> * in_PREDICT_PC_NEXT ; 66 sc_signal<Tcontrol_t > * in_PREDICT_PC_NEXT_IS_DS_TAKE ; 67 sc_signal<Tcontrol_t > ** in_PREDICT_INSTRUCTION_ENABLE ; //[nb_instruction] 68 //sc_signal<Tcontrol_t > * in_PREDICT_BRANCH_IS_CURRENT ; 69 sc_signal<Tbranch_state_t > * in_PREDICT_BRANCH_STATE ; 70 sc_signal<Tprediction_ptr_t > * in_PREDICT_BRANCH_UPDATE_PREDICTION_ID ; 71 sc_signal<Tinst_ifetch_ptr_t> * in_PREDICT_INST_IFETCH_PTR ; 72 sc_signal<Tcontrol_t > * in_EVENT_VAL ; 73 sc_signal<Tcontrol_t > * out_EVENT_ACK ; 74 sc_signal<Tgeneral_address_t> * in_EVENT_ADDRESS ; 75 sc_signal<Tgeneral_address_t> * in_EVENT_ADDRESS_NEXT ; 76 sc_signal<Tcontrol_t > * in_EVENT_ADDRESS_NEXT_VAL ; 77 sc_signal<Tcontrol_t > * in_EVENT_IS_DS_TAKE ; 52 78 53 79 ALLOC0_SC_SIGNAL (out_ADDRESS_VAL ,"out_ADDRESS_VAL ",Tcontrol_t ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Ifetch_queue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/src/main.cpp
r88 r113 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/include/test.h" 9 9 #include "Behavioural/include/Selftest.h" 10 10 #define NB_PARAMS 4 11 11 … … 33 33 uint32_t x = 1; 34 34 35 string name = argv[x++]; 36 37 uint32_t _size_queue = fromString<uint32_t>(argv[x++]); 38 uint32_t _nb_instruction = fromString<uint32_t>(argv[x++]); 39 uint32_t _size_branch_update_prediction = fromString<uint32_t>(argv[x++]); 40 uint32_t _size_general_data = fromString<uint32_t>(argv[x++]); 35 string name; 36 uint32_t _size_queue ; 37 uint32_t _nb_instruction ; 38 uint32_t _size_branch_update_prediction; 39 uint32_t _size_general_data ; 40 41 SELFTEST0( name ,string ,argv,x); 42 SELFTEST0(_size_queue ,uint32_t,argv,x); 43 SELFTEST0(_nb_instruction ,uint32_t,argv,x); 44 SELFTEST0(_size_branch_update_prediction,uint32_t,argv,x); 45 SELFTEST0(_size_general_data ,uint32_t,argv,x); 41 46 42 47 int _return = EXIT_SUCCESS; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/src/test.cpp
r112 r113 67 67 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 68 68 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 69 70 sc_signal<Tcontrol_t > * in_ADDRESS_VAL ; 71 sc_signal<Tcontrol_t > * out_ADDRESS_ACK ; 72 sc_signal<Tifetch_queue_ptr_t > * out_ADDRESS_IFETCH_QUEUE_ID ; 73 sc_signal<Tcontrol_t > ** in_ADDRESS_INSTRUCTION_ENABLE ;//[nb_instruction] 74 sc_signal<Tgeneral_address_t > * in_ADDRESS_INSTRUCTION_ADDRESS ; 75 sc_signal<Tinst_ifetch_ptr_t > * in_ADDRESS_INST_IFETCH_PTR ; 76 sc_signal<Tbranch_state_t > * in_ADDRESS_BRANCH_STATE ; 77 sc_signal<Tprediction_ptr_t > * in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID ; 78 sc_signal<Tcontrol_t > ** out_DECOD_VAL ;//[nb_instruction] 79 sc_signal<Tcontrol_t > ** in_DECOD_ACK ;//[nb_instruction] 80 sc_signal<Tinstruction_t > ** out_DECOD_INSTRUCTION ;//[nb_instruction] 81 sc_signal<Tgeneral_address_t > * out_DECOD_ADDRESS ; 82 sc_signal<Tinst_ifetch_ptr_t > * out_DECOD_INST_IFETCH_PTR ; 83 sc_signal<Tbranch_state_t > * out_DECOD_BRANCH_STATE ; 84 sc_signal<Tprediction_ptr_t > * out_DECOD_BRANCH_UPDATE_PREDICTION_ID ; 85 sc_signal<Texception_t > * out_DECOD_EXCEPTION ; 86 sc_signal<Tcontrol_t > * in_ICACHE_RSP_VAL ; 87 sc_signal<Tcontrol_t > * out_ICACHE_RSP_ACK ; 88 sc_signal<Tpacket_t > * in_ICACHE_RSP_PACKET_ID ; 89 sc_signal<Ticache_instruction_t > ** in_ICACHE_RSP_INSTRUCTION ;//[nb_instruction] 90 sc_signal<Ticache_error_t > * in_ICACHE_RSP_ERROR ; 91 sc_signal<Tcontrol_t > * in_EVENT_RESET_VAL ;// val if : miss_speculation, exception, synchronization 92 sc_signal<Tcontrol_t > * out_EVENT_RESET_ACK ; 69 93 70 94 ALLOC0_SC_SIGNAL( in_ADDRESS_VAL ," in_ADDRESS_VAL ",Tcontrol_t ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Parameters_msg_error.cpp
r109 r113 18 18 namespace ifetch_queue { 19 19 20 21 20 #undef FUNCTION 22 21 #define FUNCTION "Ifetch_queue::msg_error" … … 28 27 29 28 if (not is_multiple (_nb_instruction_in_queue,_nb_instruction)) 30 test.error( "Size of ifetch queue must be a multiple of nb_instruction.\n");29 test.error(_("Size of ifetch queue must be a multiple of nb_instruction.\n")); 31 30 32 31 if (_size_queue == 1) 33 test.warning( "To best perfomance, size_queue must be > 1.\n");32 test.warning(_("To best perfomance, size_queue must be > 1.\n")); 34 33 35 34 log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Ifetch_unit_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Ifetch_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Front_end 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Branch_Target_Buffer_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Branch_Target_Buffer_Register 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/include/Branch_Target_Buffer_Register.h
r82 r113 137 137 morpheo::behavioural::Tusage_t usage 138 138 ); 139 139 140 public : ~Branch_Target_Buffer_Register (void); 140 141 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register.cpp
r88 r113 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/include/Branch_Target_Buffer_Register.h" 9 9 10 namespace morpheo 10 namespace morpheo { 11 11 namespace behavioural { 12 12 namespace core { … … 16 16 namespace branch_target_buffer { 17 17 namespace branch_target_buffer_register { 18 19 18 20 19 #undef FUNCTION … … 33 32 morpheo::behavioural::Tusage_t usage 34 33 ): 35 _name 36 ,_param(param)37 ,_usage(usage)34 _name (name) 35 ,_param (param) 36 ,_usage (usage) 38 37 { 39 38 log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"Begin"); … … 160 159 } 161 160 162 # ifdef SYSTEMCASS_SPECIFIC163 // List dependency information164 for (uint32_t i=0; i<_param->_nb_inst_decod; i++)165 {166 (*(out_DECOD_HIT [i])) (*(in_DECOD_VAL [i]));167 (*(out_DECOD_HIT [i])) (*(in_DECOD_ADDRESS_SRC [i]));168 if (_param->_have_port_context_id)169 (*(out_DECOD_HIT [i])) (*(in_DECOD_CONTEXT_ID [i]));170 171 (*(out_DECOD_HIT_INDEX [i])) (*(in_DECOD_VAL [i]));172 (*(out_DECOD_HIT_INDEX [i])) (*(in_DECOD_ADDRESS_SRC [i]));173 if (_param->_have_port_context_id)174 (*(out_DECOD_HIT_INDEX [i])) (*(in_DECOD_CONTEXT_ID [i]));175 }176 } 177 #endif 161 // # ifdef SYSTEMCASS_SPECIFIC 162 // // List dependency information 163 // for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 164 // { 165 // (*(out_DECOD_HIT [i])) (*(in_DECOD_VAL [i])); 166 // (*(out_DECOD_HIT [i])) (*(in_DECOD_ADDRESS_SRC [i])); 167 // if (_param->_have_port_context_id) 168 // (*(out_DECOD_HIT [i])) (*(in_DECOD_CONTEXT_ID [i])); 169 170 // (*(out_DECOD_HIT_INDEX [i])) (*(in_DECOD_VAL [i])); 171 // (*(out_DECOD_HIT_INDEX [i])) (*(in_DECOD_ADDRESS_SRC [i])); 172 // if (_param->_have_port_context_id) 173 // (*(out_DECOD_HIT_INDEX [i])) (*(in_DECOD_CONTEXT_ID [i])); 174 // } 175 // #endif 176 } 178 177 179 178 if (_param->_have_port_victim) … … 192 191 } 193 192 194 # ifdef SYSTEMCASS_SPECIFIC195 // List dependency information196 for (uint32_t i=0; i<_param->_nb_inst_update; i++)197 {198 (*(out_UPDATE_HIT [i])) (*(in_UPDATE_VAL [i]));199 (*(out_UPDATE_HIT [i])) (*(in_UPDATE_ADDRESS_SRC [i]));200 if (_param->_have_port_context_id)201 (*(out_UPDATE_HIT [i])) (*(in_UPDATE_CONTEXT_ID [i]));202 203 (*(out_UPDATE_HIT_INDEX [i])) (*(in_UPDATE_VAL [i]));204 (*(out_UPDATE_HIT_INDEX [i])) (*(in_UPDATE_ADDRESS_SRC [i]));205 if (_param->_have_port_context_id)206 (*(out_UPDATE_HIT_INDEX [i])) (*(in_UPDATE_CONTEXT_ID [i]));207 }208 } 209 # endif 193 // # ifdef SYSTEMCASS_SPECIFIC 194 // // List dependency information 195 // for (uint32_t i=0; i<_param->_nb_inst_update; i++) 196 // { 197 // (*(out_UPDATE_HIT [i])) (*(in_UPDATE_VAL [i])); 198 // (*(out_UPDATE_HIT [i])) (*(in_UPDATE_ADDRESS_SRC [i])); 199 // if (_param->_have_port_context_id) 200 // (*(out_UPDATE_HIT [i])) (*(in_UPDATE_CONTEXT_ID [i])); 201 202 // (*(out_UPDATE_HIT_INDEX [i])) (*(in_UPDATE_VAL [i])); 203 // (*(out_UPDATE_HIT_INDEX [i])) (*(in_UPDATE_ADDRESS_SRC [i])); 204 // if (_param->_have_port_context_id) 205 // (*(out_UPDATE_HIT_INDEX [i])) (*(in_UPDATE_CONTEXT_ID [i])); 206 // } 207 // # endif 208 } 210 209 #endif 211 210 … … 229 228 log_printf(INFO,Branch_Target_Buffer_Register,FUNCTION,"Deallocation"); 230 229 deallocation (); 231 232 230 log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"End"); 233 231 }; … … 239 237 }; // end namespace multi_front_end 240 238 }; // end namespace core 241 242 239 }; // end namespace behavioural 243 }; // end namespace morpheo 240 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Branch_Target_Buffer 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Direction_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Direction 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Makefile.defs
r110 r113 7 7 # 8 8 9 ENTITY = Meta_Predictor 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/Makefile.defs
r110 r113 7 7 # 8 8 9 ENTITY = Meta_Predictor_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.defs
r110 r113 7 7 # 8 8 9 ENTITY = Two_Level_Branch_Predictor 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Prediction_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Prediction_unit_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Return_Address_Stack 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Update_Prediction_Table 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp
r112 r113 1276 1276 // TEST(Tcontrol_t ,out_UPDATE_RAS_FLUSH [port]->read(),0); 1277 1277 TEST(Tcontrol_t ,out_UPDATE_RAS_PUSH [port]->read(),push_ras (it_ufpt->condition)); 1278 LABEL("KANE : out_UPDATE_RAS_ADDRESS [port]->read() : %.8x",out_UPDATE_RAS_ADDRESS [port]->read());1279 LABEL("KANE : it_ufpt->ras_address : %.8x",it_ufpt->ras_address);1280 1281 1278 TEST(Taddress_t ,out_UPDATE_RAS_ADDRESS [port]->read(),it_ufpt->ras_address); 1282 1279 TEST(Tptr_t ,out_UPDATE_RAS_INDEX [port]->read(),it_ufpt->ras_index); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp
r112 r113 117 117 << std::dec 118 118 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take << " - " 119 << "[" << s c_simulation_time() << "] " << " "119 << "[" << simulation_cycle() << "] " << " " 120 120 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction << " " 121 121 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " " -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Commit_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp
r112 r113 175 175 entry->address_next = PORT_READ(in_INSERT_ADDRESS_NEXT [x][y]); 176 176 #ifdef DEBUG 177 entry->cycle_rob_in = s c_simulation_time();178 entry->cycle_commit = s c_simulation_time();177 entry->cycle_rob_in = simulation_cycle(); 178 entry->cycle_commit = simulation_cycle(); 179 179 #endif 180 180 … … 352 352 353 353 #ifdef DEBUG 354 entry->cycle_commit = s c_simulation_time();354 entry->cycle_commit = simulation_cycle(); 355 355 #endif 356 356 } … … 426 426 // log file 427 427 instruction_log_file [num_thread] 428 << "[" << s c_simulation_time() << "] "428 << "[" << simulation_cycle() << "] " 429 429 << "{" << ((retire_ok)?" OK ":"!KO!") << "} " 430 430 << std::hex -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Issue_queue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = OOO_Engine 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = OOO_Engine_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Reexecute_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Load_Store_pointer_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Rename_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Dependency_checking_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Dependency_checking_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Free_List_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/SelfTest/src/test.cpp
r109 r113 49 49 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 50 50 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 51 52 sc_signal<Tcontrol_t > ** in_POP_VAL ; 53 sc_signal<Tcontrol_t > ** out_POP_ACK ; 54 sc_signal<Tcontrol_t > ** in_POP_GPR_VAL ; // write_rd 55 sc_signal<Tgeneral_address_t> ** out_POP_GPR_NUM_REG; // num_reg_rd 56 sc_signal<Tcontrol_t > ** in_POP_SPR_VAL ; // write_re 57 sc_signal<Tspecial_address_t> ** out_POP_SPR_NUM_REG; // num_reg_re 58 sc_signal<Tcontrol_t > ** in_PUSH_GPR_VAL ; // gpr_free (cf stat_list) 59 sc_signal<Tcontrol_t > ** out_PUSH_GPR_ACK ; 60 sc_signal<Tgeneral_address_t> ** in_PUSH_GPR_NUM_REG; 61 sc_signal<Tcontrol_t > ** in_PUSH_SPR_VAL ; // spr_free (cf stat_list) 62 sc_signal<Tcontrol_t > ** out_PUSH_SPR_ACK ; 63 sc_signal<Tspecial_address_t> ** in_PUSH_SPR_NUM_REG; 51 64 52 65 ALLOC1_SC_SIGNAL( in_POP_VAL ," in_POP_VAL ",Tcontrol_t ,_param->_nb_pop ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Register_translation_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Register_Address_Translation_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_translation_unit_Glue/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Register_translation_unit_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Stat_List_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/SelfTest/src/test.cpp
r112 r113 60 60 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 61 61 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 62 63 sc_signal<Tcontrol_t > ** in_INSERT_VAL ;//[nb_inst_insert] 64 sc_signal<Tcontrol_t > ** out_INSERT_ACK ;//[nb_inst_insert] 65 sc_signal<Tcontrol_t > ** in_INSERT_READ_RA ;//[nb_inst_insert] 66 sc_signal<Tgeneral_address_t> ** in_INSERT_NUM_REG_RA_PHY ;//[nb_inst_insert] 67 sc_signal<Tcontrol_t > ** in_INSERT_READ_RB ;//[nb_inst_insert] 68 sc_signal<Tgeneral_address_t> ** in_INSERT_NUM_REG_RB_PHY ;//[nb_inst_insert] 69 sc_signal<Tcontrol_t > ** in_INSERT_READ_RC ;//[nb_inst_insert] 70 sc_signal<Tspecial_address_t> ** in_INSERT_NUM_REG_RC_PHY ;//[nb_inst_insert] 71 sc_signal<Tcontrol_t > ** in_INSERT_WRITE_RD ;//[nb_inst_insert] 72 sc_signal<Tgeneral_address_t> ** in_INSERT_NUM_REG_RD_PHY_NEW;//[nb_inst_insert] 73 sc_signal<Tcontrol_t > ** in_INSERT_WRITE_RE ;//[nb_inst_insert] 74 sc_signal<Tspecial_address_t> ** in_INSERT_NUM_REG_RE_PHY_NEW;//[nb_inst_insert] 75 sc_signal<Tcontrol_t > ** in_RETIRE_VAL ;//[nb_inst_retire] 76 sc_signal<Tcontrol_t > ** out_RETIRE_ACK ;//[nb_inst_retire] 77 sc_signal<Tcontrol_t > ** in_RETIRE_RESTORE ;//[nb_inst_retire] 78 sc_signal<Tcontrol_t > ** in_RETIRE_READ_RA ;//[nb_inst_retire] 79 sc_signal<Tgeneral_address_t> ** in_RETIRE_NUM_REG_RA_PHY ;//[nb_inst_retire] 80 sc_signal<Tcontrol_t > ** in_RETIRE_READ_RB ;//[nb_inst_retire] 81 sc_signal<Tgeneral_address_t> ** in_RETIRE_NUM_REG_RB_PHY ;//[nb_inst_retire] 82 sc_signal<Tcontrol_t > ** in_RETIRE_READ_RC ;//[nb_inst_retire] 83 sc_signal<Tspecial_address_t> ** in_RETIRE_NUM_REG_RC_PHY ;//[nb_inst_retire] 84 sc_signal<Tcontrol_t > ** in_RETIRE_WRITE_RD ;//[nb_inst_retire] 85 sc_signal<Tcontrol_t > ** in_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] 86 sc_signal<Tgeneral_address_t> ** in_RETIRE_NUM_REG_RD_PHY_OLD;//[nb_inst_retire] 87 sc_signal<Tgeneral_address_t> ** in_RETIRE_NUM_REG_RD_PHY_NEW;//[nb_inst_retire] 88 sc_signal<Tcontrol_t > ** in_RETIRE_WRITE_RE ;//[nb_inst_retire] 89 sc_signal<Tcontrol_t > ** in_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] 90 sc_signal<Tspecial_address_t> ** in_RETIRE_NUM_REG_RE_PHY_OLD;//[nb_inst_retire] 91 sc_signal<Tspecial_address_t> ** in_RETIRE_NUM_REG_RE_PHY_NEW;//[nb_inst_retire] 92 sc_signal<Tcontrol_t > ** out_PUSH_GPR_VAL ;//[nb_reg_free] 93 sc_signal<Tcontrol_t > ** in_PUSH_GPR_ACK ;//[nb_reg_free] 94 sc_signal<Tgeneral_address_t> ** out_PUSH_GPR_NUM_REG ;//[nb_reg_free] 95 sc_signal<Tcontrol_t > ** out_PUSH_SPR_VAL ;//[nb_reg_free] 96 sc_signal<Tcontrol_t > ** in_PUSH_SPR_ACK ;//[nb_reg_free] 97 sc_signal<Tspecial_address_t> ** out_PUSH_SPR_NUM_REG ;//[nb_reg_free] 62 98 63 99 ALLOC1_SC_SIGNAL( in_INSERT_VAL ," in_INSERT_VAL ",Tcontrol_t ,_param->_nb_inst_insert); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Rename_select 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Rename_unit_Glue 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Special_Register_unit 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Custom/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Custom 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/Makefile.defs
r112 r113 7 7 # 8 8 9 ENTITY = Comparator 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/SelfTest/include/test.h
r112 r113 11 11 #endif 12 12 13 #define NB_ITERATION 1 13 #define NB_ITERATION 1024 14 14 #define CYCLE_MAX (1024*NB_ITERATION) 15 15 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/SelfTest/src/main.cpp
r112 r113 19 19 err (_(" * type (Tcomparator_scheme_t)\n")); 20 20 21 22 21 exit (1); 23 22 } … … 34 33 uint32_t x = 1; 35 34 35 string name = argv[x++]; 36 36 uint32_t _size_data; 37 37 bool _is_signed; … … 41 41 SELFTEST0(_is_signed,bool ,argv,x); 42 42 SELFTEST0(_type ,Tcomparator_scheme_t,argv,x); 43 44 string name = argv[x++];45 43 46 44 int _return = EXIT_SUCCESS; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/SelfTest/src/test.cpp
r112 r113 9 9 #include "Behavioural/Generic/Comparator/SelfTest/include/test.h" 10 10 #include "Behavioural/include/Allocation.h" 11 #include "Common/include/BitManipulation.h" 11 12 12 13 void test (string name, … … 50 51 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 51 52 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 53 54 sc_signal<Tdata_t > * in_COMPARE_DATA_0; 55 sc_signal<Tdata_t > * in_COMPARE_DATA_1; 56 sc_signal<Tcontrol_t> * out_COMPARE_TEST ; 57 58 ALLOC0_SC_SIGNAL( in_COMPARE_DATA_0," in_COMPARE_DATA_0",Tdata_t ); 59 ALLOC0_SC_SIGNAL( in_COMPARE_DATA_1," in_COMPARE_DATA_1",Tdata_t ); 60 ALLOC0_SC_SIGNAL(out_COMPARE_TEST ,"out_COMPARE_TEST ",Tcontrol_t); 52 61 53 62 /******************************************************** … … 60 69 (*(_Comparator->in_NRESET)) (*(in_NRESET)); 61 70 62 71 INSTANCE0_SC_SIGNAL(_Comparator, in_COMPARE_DATA_0); 72 INSTANCE0_SC_SIGNAL(_Comparator, in_COMPARE_DATA_1); 73 INSTANCE0_SC_SIGNAL(_Comparator,out_COMPARE_TEST ); 74 63 75 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); 64 76 … … 90 102 LABEL("Iteration %d",iteration); 91 103 104 uint64_t data0 = range<uint64_t>(rand(),_param->_size_data); 105 uint64_t data1 = range<uint64_t>(rand(),_param->_size_data); 106 107 in_COMPARE_DATA_0->write(static_cast<Tdata_t>(data0)); 108 in_COMPARE_DATA_1->write(static_cast<Tdata_t>(data1)); 109 110 SC_START(0); 111 112 Tcontrol_t test = false; 113 switch (_param->_size_data) 114 { 115 case 8 : 116 { 117 if (_param->_is_signed) 118 switch (_param->_type) 119 { 120 case COMPARATOR_EQUAL : test = static_cast< int8_t>(data0) == static_cast< int8_t>(data1); break; 121 case COMPARATOR_NOT_EQUAL : test = static_cast< int8_t>(data0) != static_cast< int8_t>(data1); break; 122 case COMPARATOR_GREATER : test = static_cast< int8_t>(data0) > static_cast< int8_t>(data1); break; 123 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast< int8_t>(data0) >= static_cast< int8_t>(data1); break; 124 case COMPARATOR_LESS : test = static_cast< int8_t>(data0) < static_cast< int8_t>(data1); break; 125 case COMPARATOR_LESS_OR_EQUAL : test = static_cast< int8_t>(data0) <= static_cast< int8_t>(data1); break; 126 } 127 else 128 switch (_param->_type) 129 { 130 case COMPARATOR_EQUAL : test = static_cast<uint8_t>(data0) == static_cast<uint8_t>(data1); break; 131 case COMPARATOR_NOT_EQUAL : test = static_cast<uint8_t>(data0) != static_cast<uint8_t>(data1); break; 132 case COMPARATOR_GREATER : test = static_cast<uint8_t>(data0) > static_cast<uint8_t>(data1); break; 133 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast<uint8_t>(data0) >= static_cast<uint8_t>(data1); break; 134 case COMPARATOR_LESS : test = static_cast<uint8_t>(data0) < static_cast<uint8_t>(data1); break; 135 case COMPARATOR_LESS_OR_EQUAL : test = static_cast<uint8_t>(data0) <= static_cast<uint8_t>(data1); break; 136 } 137 break; 138 } 139 case 16 : 140 { 141 if (_param->_is_signed) 142 switch (_param->_type) 143 { 144 case COMPARATOR_EQUAL : test = static_cast< int16_t>(data0) == static_cast< int16_t>(data1); break; 145 case COMPARATOR_NOT_EQUAL : test = static_cast< int16_t>(data0) != static_cast< int16_t>(data1); break; 146 case COMPARATOR_GREATER : test = static_cast< int16_t>(data0) > static_cast< int16_t>(data1); break; 147 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast< int16_t>(data0) >= static_cast< int16_t>(data1); break; 148 case COMPARATOR_LESS : test = static_cast< int16_t>(data0) < static_cast< int16_t>(data1); break; 149 case COMPARATOR_LESS_OR_EQUAL : test = static_cast< int16_t>(data0) <= static_cast< int16_t>(data1); break; 150 } 151 else 152 switch (_param->_type) 153 { 154 case COMPARATOR_EQUAL : test = static_cast<uint16_t>(data0) == static_cast<uint16_t>(data1); break; 155 case COMPARATOR_NOT_EQUAL : test = static_cast<uint16_t>(data0) != static_cast<uint16_t>(data1); break; 156 case COMPARATOR_GREATER : test = static_cast<uint16_t>(data0) > static_cast<uint16_t>(data1); break; 157 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast<uint16_t>(data0) >= static_cast<uint16_t>(data1); break; 158 case COMPARATOR_LESS : test = static_cast<uint16_t>(data0) < static_cast<uint16_t>(data1); break; 159 case COMPARATOR_LESS_OR_EQUAL : test = static_cast<uint16_t>(data0) <= static_cast<uint16_t>(data1); break; 160 } 161 break; 162 } 163 case 32 : 164 { 165 if (_param->_is_signed) 166 switch (_param->_type) 167 { 168 case COMPARATOR_EQUAL : test = static_cast< int32_t>(data0) == static_cast< int32_t>(data1); break; 169 case COMPARATOR_NOT_EQUAL : test = static_cast< int32_t>(data0) != static_cast< int32_t>(data1); break; 170 case COMPARATOR_GREATER : test = static_cast< int32_t>(data0) > static_cast< int32_t>(data1); break; 171 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast< int32_t>(data0) >= static_cast< int32_t>(data1); break; 172 case COMPARATOR_LESS : test = static_cast< int32_t>(data0) < static_cast< int32_t>(data1); break; 173 case COMPARATOR_LESS_OR_EQUAL : test = static_cast< int32_t>(data0) <= static_cast< int32_t>(data1); break; 174 } 175 else 176 switch (_param->_type) 177 { 178 case COMPARATOR_EQUAL : test = static_cast<uint32_t>(data0) == static_cast<uint32_t>(data1); break; 179 case COMPARATOR_NOT_EQUAL : test = static_cast<uint32_t>(data0) != static_cast<uint32_t>(data1); break; 180 case COMPARATOR_GREATER : test = static_cast<uint32_t>(data0) > static_cast<uint32_t>(data1); break; 181 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast<uint32_t>(data0) >= static_cast<uint32_t>(data1); break; 182 case COMPARATOR_LESS : test = static_cast<uint32_t>(data0) < static_cast<uint32_t>(data1); break; 183 case COMPARATOR_LESS_OR_EQUAL : test = static_cast<uint32_t>(data0) <= static_cast<uint32_t>(data1); break; 184 } 185 break; 186 } 187 case 64 : 188 { 189 if (_param->_is_signed) 190 switch (_param->_type) 191 { 192 case COMPARATOR_EQUAL : test = static_cast< int64_t>(data0) == static_cast< int64_t>(data1); break; 193 case COMPARATOR_NOT_EQUAL : test = static_cast< int64_t>(data0) != static_cast< int64_t>(data1); break; 194 case COMPARATOR_GREATER : test = static_cast< int64_t>(data0) > static_cast< int64_t>(data1); break; 195 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast< int64_t>(data0) >= static_cast< int64_t>(data1); break; 196 case COMPARATOR_LESS : test = static_cast< int64_t>(data0) < static_cast< int64_t>(data1); break; 197 case COMPARATOR_LESS_OR_EQUAL : test = static_cast< int64_t>(data0) <= static_cast< int64_t>(data1); break; 198 } 199 else 200 switch (_param->_type) 201 { 202 case COMPARATOR_EQUAL : test = static_cast<uint64_t>(data0) == static_cast<uint64_t>(data1); break; 203 case COMPARATOR_NOT_EQUAL : test = static_cast<uint64_t>(data0) != static_cast<uint64_t>(data1); break; 204 case COMPARATOR_GREATER : test = static_cast<uint64_t>(data0) > static_cast<uint64_t>(data1); break; 205 case COMPARATOR_GREATER_OR_EQUAL : test = static_cast<uint64_t>(data0) >= static_cast<uint64_t>(data1); break; 206 case COMPARATOR_LESS : test = static_cast<uint64_t>(data0) < static_cast<uint64_t>(data1); break; 207 case COMPARATOR_LESS_OR_EQUAL : test = static_cast<uint64_t>(data0) <= static_cast<uint64_t>(data1); break; 208 } 209 break; 210 } 211 default : 212 { 213 TEST_KO("Invalid size for the test."); 214 } 215 } 216 217 TEST(Tcontrol_t,out_COMPARE_TEST->read(),test); 218 92 219 SC_START(1); 93 220 } … … 104 231 delete in_CLOCK; 105 232 delete in_NRESET; 233 DELETE0_SC_SIGNAL( in_COMPARE_DATA_0); 234 DELETE0_SC_SIGNAL( in_COMPARE_DATA_1); 235 DELETE0_SC_SIGNAL(out_COMPARE_TEST ); 106 236 } 107 237 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/include/Comparator.h
r112 r113 64 64 public : SC_IN (Tdata_t ) * in_COMPARE_DATA_0; 65 65 public : SC_IN (Tdata_t ) * in_COMPARE_DATA_1; 66 public : SC_OUT(Tcontrol_t) * in_COMPARE_TEST ; 67 66 public : SC_OUT(Tcontrol_t) * out_COMPARE_TEST ; 68 67 69 68 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 105 104 #ifdef SYSTEMC 106 105 public : void transition (void); 107 //public : void genMoore(void);106 public : void genMealy (void); 108 107 #endif 109 108 … … 112 111 private : void vhdl_declaration (Vhdl * & vhdl); 113 112 private : void vhdl_body (Vhdl * & vhdl); 113 114 private : void vhdl_xilinx_declaration (Vhdl * & vhdl); 115 private : void vhdl_xilinx_body (Vhdl * & vhdl); 114 116 #endif 115 117 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/include/Parameters.h
r112 r113 26 26 public : Tcomparator_scheme_t _type; 27 27 28 public : int64_t _extends; 29 public : int64_t _mask_sign; 30 28 31 //-----[ methods ]----------------------------------------------------------- 29 32 public : Parameters (uint32_t size_data, -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/src/Comparator.cpp
r112 r113 77 77 # endif 78 78 79 // log_printf(INFO,Comparator,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());79 log_printf(INFO,Comparator,FUNCTION,_("<%s> : Method - genMealy"),_name.c_str()); 80 80 81 // SC_METHOD (genMoore); 82 // dont_initialize (); 83 // sensitive << (*(in_CLOCK)).neg(); // need internal register 81 SC_METHOD (genMealy); 82 dont_initialize (); 83 // sensitive << (*(in_CLOCK)).neg(); // don't need internal register 84 sensitive << (*(in_COMPARE_DATA_0)) 85 << (*(in_COMPARE_DATA_1)); 84 86 85 //# ifdef SYSTEMCASS_SPECIFIC86 //// List dependency information87 //# endif87 # ifdef SYSTEMCASS_SPECIFIC 88 // List dependency information 89 # endif 88 90 89 91 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/src/Comparator_allocation.cpp
r112 r113 53 53 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); 54 54 } 55 56 // ~~~~~[ Interface : "compare" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 { 58 ALLOC0_INTERFACE_BEGIN("compare",IN,SOUTH,_("Compare interface")); 59 60 ALLOC0_SIGNAL_IN ( in_COMPARE_DATA_0,"DATA_0",Tdata_t ,_param->_size_data); 61 ALLOC0_SIGNAL_IN ( in_COMPARE_DATA_1,"DATA_1",Tdata_t ,_param->_size_data); 62 ALLOC0_SIGNAL_OUT(out_COMPARE_TEST ,"TEST" ,Tcontrol_t,1); 63 64 ALLOC0_INTERFACE_END(); 65 } 66 55 67 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 68 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/src/Comparator_deallocation.cpp
r112 r113 25 25 delete in_CLOCK ; 26 26 delete in_NRESET; 27 28 DELETE0_SIGNAL( in_COMPARE_DATA_0,_param->_size_data); 29 DELETE0_SIGNAL( in_COMPARE_DATA_1,_param->_size_data); 30 DELETE0_SIGNAL(out_COMPARE_TEST ,1); 27 31 } 28 32 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/src/Comparator_vhdl.cpp
r112 r113 27 27 _component->vhdl_instance(vhdl); 28 28 29 // default architecture 29 30 vhdl_declaration (vhdl); 30 31 vhdl_body (vhdl); 32 33 // Xilinx architecture 34 vhdl->set_architecture("xilinx"); 35 vhdl_xilinx_declaration (vhdl); 36 vhdl_xilinx_body (vhdl); 31 37 32 38 vhdl->generate_file(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/src/Parameters.cpp
r112 r113 7 7 8 8 #include "Behavioural/Generic/Comparator/include/Parameters.h" 9 #include "Common/include/BitManipulation.h" 9 10 10 11 namespace morpheo { … … 12 13 namespace generic { 13 14 namespace comparator { 14 15 15 16 16 #undef FUNCTION … … 28 28 29 29 test(); 30 31 _extends = gen_mask_not<int64_t>(_size_data); 32 _mask_sign = (1<<(_size_data-1)); 30 33 31 34 if (is_toplevel) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/src/Parameters_msg_error.cpp
r112 r113 24 24 Parameters_test test ("Comparator"); 25 25 26 if (_size_data > 64) 27 test.error(_("Max size is 64 bits.\n")); 28 26 29 log_end(Comparator,FUNCTION); 27 30 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Counter 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/include/top.h
r112 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 * Test " RegisterFile"6 * Test "Counter" 7 7 */ 8 8 … … 11 11 #endif 12 12 13 # include <string>14 # include <iostream>13 #define NB_ITERATION 1024 14 #define CYCLE_MAX (1024*NB_ITERATION) 15 15 16 #include "Common/include/Test.h" 16 17 #include "Common/include/Time.h" 17 18 #include "Behavioural/Generic/Counter/include/Counter.h" … … 21 22 using namespace morpheo::behavioural; 22 23 using namespace morpheo::behavioural::generic; 23 24 24 using namespace morpheo::behavioural::generic::counter; 25 25 26 void test (string name, 27 morpheo::behavioural::generic::counter::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 private: sc_signal<Tdata_t> ** in_COUNTER_DATA ;// [param->_nb_port] 32 private: sc_signal<Tcontrol_t> ** in_COUNTER_ADDSUB;// [param->_nb_port] 33 private: sc_signal<Tdata_t> ** out_COUNTER_DATA ;// [param->_nb_port] 34 #endif 35 36 private: std::string name ; 37 private: morpheo::behavioural::generic::counter::Parameters * param; 38 #ifdef STATISTICS 39 private: morpheo::behavioural::Parameters_Statistics * param_stat; 40 #endif 41 private: Counter * component; 42 43 private: void usage (string exec); 44 private: void allocation (void); 45 private: void deallocation (void); 46 public : void test (void); 47 48 #ifdef MTI_SYSTEMC 49 SC_CTOR(top::top); 50 #else 51 public : top (sc_module_name module_name,int argc, char * argv[]); 52 #endif 53 public : ~top(void); 54 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/src/main.cpp
r81 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ 7 7 8 #include "Behavioural/Generic/Counter/SelfTest/include/t est.h"8 #include "Behavioural/Generic/Counter/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 2 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 (string exec) 13 { 14 cerr << "<Usage> " << exec << " name_instance list_params" << endl 15 << "list_params is :" << endl 16 << " - size_data (unsigned int)" << endl 17 << " - nb_port (unsigned int)" << endl; 19 try 20 { 21 top * my_top = new top ("my_top",argc,argv); 18 22 19 exit (1); 23 my_top->test(); 24 25 delete my_top; 26 } 27 catch (morpheo::ErrorMorpheo & error) 28 { 29 msg (_("%s\n"),error.what ()); 30 _return = EXIT_FAILURE; 31 } 32 33 try 34 { 35 if (_return == EXIT_SUCCESS) 36 TEST_OK("Counter : no error"); 37 else 38 TEST_KO("Counter : a lot of error"); 39 } 40 catch (morpheo::ErrorMorpheo & error) 41 { 42 // msg (_("<%s> :\n%s"),name.c_str(), error.what ()); 43 _return = EXIT_FAILURE; 44 } 45 46 return _return; 20 47 } 21 22 #ifndef SYSTEMC23 int main (int argc, char * argv[])24 #else25 int sc_main (int argc, char * argv[])26 48 #endif 27 {28 if (argc != 2+NB_PARAMS)29 usage (argv[0]);30 31 cout << "<test0> : Classic usage" << endl;32 cout << "<test0> : Typical parameters" << endl;33 const string name = argv[1];34 const uint32_t size_data = atoi(argv[2]);35 const uint32_t nb_port = atoi(argv[3]);36 37 morpheo::behavioural::generic::counter::Parameters param (size_data,38 nb_port );39 40 test (name,param);41 42 return (EXIT_SUCCESS);43 }44 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/src/top_test.cpp
r112 r113 7 7 */ 8 8 9 #define NB_ITERATION 1024 10 #define CYCLE_MAX 1024*NB_ITERATION 9 #include "Behavioural/Generic/Counter/SelfTest/include/top.h" 11 10 12 #include "Behavioural/Generic/Counter/SelfTest/include/test.h" 13 #include "Common/include/Test.h" 14 15 void test (string name, 16 morpheo::behavioural::generic::counter::Parameters param) 11 void top::test (void) 17 12 { 18 cout << "<" << name << "> : Simulation SystemC" << endl;19 20 try21 {22 cout << param.print(1);23 param.test();24 }25 catch (morpheo::ErrorMorpheo & error)26 {27 cout << "<" << name << "> : " << error.what ();28 return;29 }30 catch (...)31 {32 cerr << "<" << name << "> : This test must generate a error" << endl;33 exit (EXIT_FAILURE);34 }35 #ifdef STATISTICS36 morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics (5,50);37 #endif38 39 Tusage_t _usage = USE_ALL;40 41 // _usage = usage_unset(_usage,USE_SYSTEMC );42 // _usage = usage_unset(_usage,USE_VHDL );43 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH );44 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);45 // _usage = usage_unset(_usage,USE_POSITION );46 // _usage = usage_unset(_usage,USE_STATISTICS );47 // _usage = usage_unset(_usage,USE_INFORMATION );48 49 Counter * _Counter = new Counter (name.c_str(),50 #ifdef STATISTICS51 param_stat,52 #endif53 param,54 _usage);55 56 13 #ifdef SYSTEMC 57 /*********************************************************************58 * Déclarations des signaux59 *********************************************************************/60 sc_clock CLOCK ("clock", 1.0, 0.5);61 sc_signal<Tcontrol_t> RESET;62 sc_signal<Tdata_t> DATA_IN [param._nb_port];63 sc_signal<Tcontrol_t> ADDSUB [param._nb_port];64 sc_signal<Tdata_t> DATA_OUT [param._nb_port];65 66 /********************************************************67 * Instanciation68 ********************************************************/69 70 cout << "<" << name << "> Instanciation of _Counter" << endl;71 72 (*(_Counter->in_CLOCK)) (CLOCK);73 (*(_Counter->in_NRESET)) (RESET);74 75 for (uint32_t i=0; i<param._nb_port; i++)76 {77 (*(_Counter-> in_COUNTER_DATA [i])) (DATA_IN [i]);78 (*(_Counter-> in_COUNTER_ADDSUB[i])) (ADDSUB [i]);79 (*(_Counter->out_COUNTER_DATA [i])) (DATA_OUT [i]);80 }81 82 14 Time * _time = new Time(); 83 15 … … 92 24 //srand(TIME(NULL)); 93 25 94 Tdata_t data_in [param ._nb_port];95 Tdata_t data_out [param ._nb_port];96 Tcontrol_t addsub [param ._nb_port];26 Tdata_t data_in [param->_nb_port]; 27 Tdata_t data_out [param->_nb_port]; 28 Tcontrol_t addsub [param->_nb_port]; 97 29 98 sc_start(0);30 SC_CYCLE(0); 99 31 100 RESET.write(1);32 in_NRESET->write(1); 101 33 102 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;34 LABEL("Initialisation"); 103 35 104 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;36 LABEL("Loop of Test"); 105 37 106 38 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 107 39 { 108 cout << "{" << static_cast<uint32_t>(sc_simulation_time()) << "} Itération " << iteration << endl; 109 for (uint32_t i=0; i<param._nb_port; i++) 40 LABEL("Iteration %d",iteration); 41 42 for (uint32_t i=0; i<param->_nb_port; i++) 110 43 { 111 Tdata_t data = rand()%param ._data_max;44 Tdata_t data = rand()%param->_data_max; 112 45 data_in [i] = data; 113 46 addsub [i] = (rand()%2)==1; 114 47 115 DATA_IN [i].write(data );116 ADDSUB [i].write(addsub [i]);48 LABEL("in_COUNTER_DATA [%d] = %d",i,data ); 49 LABEL("in_COUNTER_ADDSUB [%d] = %d" ,i,addsub [i]); 117 50 118 data_out [i] = (addsub[i]==1)?((data<param._data_max)?data+1:data):((data>0)?data-1:data); 51 in_COUNTER_DATA [i]->write(data ); 52 in_COUNTER_ADDSUB [i]->write(addsub [i]); 53 54 data_out [i] = (addsub[i]==1)?((data<param->_data_max)?data+1:data):((data>0)?data-1:data); 119 55 } 120 56 121 sc_start(0);122 123 for (uint32_t i=0; i<param ._nb_port; i++)57 SC_CYCLE(0); 58 59 for (uint32_t i=0; i<param->_nb_port; i++) 124 60 { 125 cout << hex 126 << " [" << i << "] " 127 << data_in [i]; 61 string op = (addsub[i] == 1)?"++":"--"; 62 LABEL("0x%d %s = 0x%d",i,op.c_str(),out_COUNTER_DATA [i]->read()); 128 63 129 if (addsub[i] == 1) 130 cout << " ++"; 131 else 132 cout << " --"; 133 134 cout << " = " 135 << DATA_OUT [i].read(); 136 137 TEST(Tdata_t,DATA_OUT [i].read(),data_out [i]); 138 139 cout << std::dec << endl; 64 TEST(Tdata_t,out_COUNTER_DATA [i]->read(),data_out [i]); 140 65 } 141 66 142 sc_start(1);67 SC_CYCLE(1); 143 68 } 144 69 145 sc_start(1);70 SC_CYCLE(1); 146 71 147 72 /******************************************************** … … 149 74 ********************************************************/ 150 75 76 sc_stop(); 77 151 78 delete _time; 152 79 153 80 cout << "<" << name << "> ............ Stop Simulation" << endl; 154 155 81 #endif 156 157 delete _Counter;158 #ifdef STATISTICS159 delete param_stat;160 #endif161 162 82 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h
r88 r113 40 40 // -----[ fields ]---------------------------------------------------- 41 41 // Parameters 42 protected : const std::string _name;43 protected : const Parameters _param;44 private : const Tusage_t _usage;42 protected : const std::string _name; 43 protected : const Parameters * _param; 44 private : const Tusage_t _usage; 45 45 46 46 #ifdef STATISTICS … … 79 79 morpheo::behavioural::Parameters_Statistics * param_statistics, 80 80 #endif 81 Parameters param,82 Tusage_t usage);81 Parameters * param, 82 Tusage_t usage); 83 83 84 84 // public : Counter (Parameters param ); 85 85 public : ~Counter (void); 86 86 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.cpp
r88 r113 13 13 namespace counter { 14 14 15 15 #undef FUNCTION 16 #define FUNCTION "Counter::Counter" 16 17 Counter::Counter 17 18 ( … … 24 25 morpheo::behavioural::Parameters_Statistics * param_statistics, 25 26 #endif 26 morpheo::behavioural::generic::counter::Parameters param,27 morpheo::behavioural::generic::counter::Parameters * param, 27 28 Tusage_t usage): 28 29 _name (name), … … 30 31 _usage (usage) 31 32 { 32 log_ printf(FUNC,Counter,"Counter","Begin");33 log_begin(Counter,FUNCTION); 33 34 34 #if DEBUG_Counter == true35 log_printf(INFO,Counter,FUNCTION,_("<%s> Parameters"),_name.c_str());35 // #if DEBUG_Counter == true 36 // log_printf(INFO,Counter,FUNCTION,_("<%s> Parameters"),_name.c_str()); 36 37 37 std::cout <<param << std::endl;38 #endif38 // std::cout << *param << std::endl; 39 // #endif 39 40 40 41 log_printf(INFO,Core,FUNCTION,_("<%s> Allocation"),_name.c_str()); … … 76 77 SC_METHOD (genMealy); 77 78 dont_initialize (); 78 for (uint32_t i=0; i<_param ._nb_port; i++)79 for (uint32_t i=0; i<_param->_nb_port; i++) 79 80 sensitive << *(in_COUNTER_DATA [i]) 80 81 << *(in_COUNTER_ADDSUB [i]); … … 82 83 #ifdef SYSTEMCASS_SPECIFIC 83 84 // List dependency information 84 for (uint32_t i=0; i<_param ._nb_port; i++)85 for (uint32_t i=0; i<_param->_nb_port; i++) 85 86 { 86 87 (*(out_COUNTER_DATA [i])) (*(in_COUNTER_DATA [i])); … … 91 92 92 93 #endif 93 log_ printf(FUNC,Counter,"Counter","End");94 log_end(Counter,FUNCTION); 94 95 }; 95 96 97 #undef FUNCTION 98 #define FUNCTION "Counter::~Counter" 96 99 Counter::~Counter (void) 97 100 { 98 log_ printf(FUNC,Counter,"~Counter","Begin");101 log_begin(Counter,FUNCTION); 99 102 100 103 #ifdef STATISTICS … … 108 111 deallocation (); 109 112 110 log_ printf(FUNC,Counter,"~Counter","End");113 log_end(Counter,FUNCTION); 111 114 }; 112 115 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_allocation.cpp
r112 r113 21 21 22 22 Entity * entity = _component->set_entity (_name 23 , "Counter"23 ,_param->_type 24 24 #ifdef POSITION 25 25 ,COMBINATORY … … 45 45 // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 46 { 47 ALLOC1_INTERFACE_BEGIN("counter", IN, SOUTH, _("Counter interface"), _param ._nb_port);47 ALLOC1_INTERFACE_BEGIN("counter", IN, SOUTH, _("Counter interface"), _param->_nb_port); 48 48 49 ALLOC1_SIGNAL_IN ( in_COUNTER_DATA ,"data" ,Tdata_t ,_param ._size_data);49 ALLOC1_SIGNAL_IN ( in_COUNTER_DATA ,"data" ,Tdata_t ,_param->_size_data); 50 50 ALLOC1_SIGNAL_IN ( in_COUNTER_ADDSUB,"addsub",Tcontrol_t,1 ); 51 ALLOC1_SIGNAL_OUT(out_COUNTER_DATA ,"data" ,Tdata_t ,_param ._size_data);51 ALLOC1_SIGNAL_OUT(out_COUNTER_DATA ,"data" ,Tdata_t ,_param->_size_data); 52 52 53 ALLOC1_INTERFACE_END(_param ._nb_port);53 ALLOC1_INTERFACE_END(_param->_nb_port); 54 54 } 55 55 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_deallocation.cpp
r112 r113 24 24 delete in_NRESET; 25 25 26 DELETE1_SIGNAL( in_COUNTER_DATA , _param ._nb_port,_param._size_data);27 DELETE1_SIGNAL( in_COUNTER_ADDSUB, _param ._nb_port,1 );28 DELETE1_SIGNAL(out_COUNTER_DATA , _param ._nb_port,_param._size_data);26 DELETE1_SIGNAL( in_COUNTER_DATA , _param->_nb_port,_param->_size_data); 27 DELETE1_SIGNAL( in_COUNTER_ADDSUB, _param->_nb_port,1 ); 28 DELETE1_SIGNAL(out_COUNTER_DATA , _param->_nb_port,_param->_size_data); 29 29 } 30 30 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_genMealy.cpp
r81 r113 18 18 log_printf(FUNC,Counter,"genMealy","Begin"); 19 19 20 for (uint32_t i=0; i<_param ._nb_port; i++)20 for (uint32_t i=0; i<_param->_nb_port; i++) 21 21 { 22 22 Tcontrol_t addsub = PORT_READ(in_COUNTER_ADDSUB [i]); … … 28 28 if (addsub == 1) 29 29 { 30 if (data_out < _param ._data_max)30 if (data_out < _param->_data_max) 31 31 data_out++; 32 32 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_declaration.cpp
r81 r113 21 21 22 22 _stat = new Stat (static_cast<std::string>(_name), 23 "Counter",23 _param->_type, 24 24 param_statistics); 25 25 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_vhdl_body.cpp
r81 r113 19 19 vhdl->set_body (""); 20 20 21 for (uint32_t i=0; i<_param ._nb_port; i++)21 for (uint32_t i=0; i<_param->_nb_port; i++) 22 22 { 23 23 std::string counter_inc, counter_dec; 24 24 25 if (_param ._size_data > 1)25 if (_param->_size_data > 1) 26 26 { 27 27 counter_inc = "in_COUNTER_"+toString(i)+"_DATA+1"; … … 35 35 36 36 vhdl->set_body ("out_COUNTER_"+toString(i)+"_DATA <="); 37 if (_param ._size_data > 1)37 if (_param->_size_data > 1) 38 38 { 39 39 vhdl->set_body ("\tin_COUNTER_"+toString(i)+"_DATA+1 when in_COUNTER_"+toString(i)+"_ADDSUB = '1' and in_COUNTER_"+toString(i)+"_DATA < cst_max else"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_vhdl_declaration.cpp
r81 r113 19 19 log_printf(FUNC,Counter,"vhdl_declaration","Begin"); 20 20 21 if (_param ._size_data > 1)21 if (_param->_size_data > 1) 22 22 { 23 vhdl->set_constant ("cst_min",_param ._size_data,std_logic_others(_param._size_data,0));24 vhdl->set_constant ("cst_max",_param ._size_data,std_logic_others(_param._size_data,1));23 vhdl->set_constant ("cst_min",_param->_size_data,std_logic_others(_param->_size_data,0)); 24 vhdl->set_constant ("cst_max",_param->_size_data,std_logic_others(_param->_size_data,1)); 25 25 } 26 26 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters.cpp
r88 r113 16 16 Parameters::Parameters (uint32_t size_data, 17 17 uint32_t nb_port ): 18 behavioural::Parameters("Counter"), 18 19 _size_data(size_data), 19 20 _nb_port (nb_port ), -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Divider/Makefile.defs
r112 r113 7 7 # 8 8 9 ENTITY = Divider 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Multiplier/Makefile.defs
r112 r113 7 7 # 8 8 9 ENTITY = Multiplier 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Priority/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = Priority 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Queue 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/main.cpp
r101 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ 7 7 8 #include "Behavioural/Generic/Queue/SelfTest/include/t est.h"8 #include "Behavioural/Generic/Queue/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 5 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 cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl15 << "list_params is :" << endl16 << " - size_queue (uint32_t)" << endl17 << " - size_data (uint32_t)" << endl18 << " - nb_port_slot (uint32_t)" << endl19 << " - have_port_write (bool )" << endl20 << " - have_port_read (bool )" << endl21 << "" << endl;22 23 for (int i=0; i<argc; i++)24 cerr << argv[i] << " ";25 cerr << endl;26 27 exit (1);28 }29 30 #ifndef SYSTEMC31 int main (int argc, char * argv[])32 #else33 int sc_main (int argc, char * argv[])34 #endif35 {36 if (argc != 2+NB_PARAMS)37 usage (argc, argv);38 39 uint32_t x = 1;40 41 const string name = argv[x++];42 const uint32_t size_queue = fromString<uint32_t>(argv[x++]);43 const uint32_t size_data = fromString<uint32_t>(argv[x++]);44 const uint32_t nb_port_slot = fromString<uint32_t>(argv[x++]);45 const bool have_port_write = fromString<bool>(argv[x++]);46 const bool have_port_read = fromString<bool>(argv[x++]);47 19 try 48 20 { 49 morpheo::behavioural::generic::queue::Parameters * param = new morpheo::behavioural::generic::queue::Parameters 50 (size_queue, 51 size_data , 52 nb_port_slot, 53 have_port_write, 54 have_port_read 55 ); 56 57 cout << param->print(1); 58 59 test (name,param); 21 top * my_top = new top ("my_top",argc,argv); 22 23 my_top->test(); 24 25 delete my_top; 60 26 } 61 27 catch (morpheo::ErrorMorpheo & error) 62 28 { 63 cout << "<" << name << "> : " << error.what ();64 exit (EXIT_FAILURE);29 msgError(_("%s\n"),error.what ()); 30 _return = EXIT_FAILURE; 65 31 } 66 catch (...) 32 33 try 67 34 { 68 cerr << "<" << name << "> : This test must generate a error" << endl; 69 exit (EXIT_FAILURE); 35 if (_return == EXIT_SUCCESS) 36 TEST_OK("Queue : no error"); 37 else 38 TEST_KO("Queue : a lot of error"); 39 } 40 catch (morpheo::ErrorMorpheo & error) 41 { 42 // msgError(_("<%s> :\n%s"),name.c_str(), error.what ()); 43 _return = EXIT_FAILURE; 70 44 } 71 45 72 return (EXIT_SUCCESS);46 return _return; 73 47 } 74 48 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/top_test.cpp
r111 r113 7 7 */ 8 8 9 # define NB_ITERATION 110 # define CYCLE_MAX (2048*NB_ITERATION)9 #include "Behavioural/Generic/Queue/SelfTest/include/top.h" 10 #include "Behavioural/include/Allocation.h" 11 11 12 #include "Behavioural/Generic/Queue/SelfTest/include/test.h" 13 #include "Behavioural/include/Allocation.h" 14 #include "Common/include/Test.h" 15 16 void test (string name, 17 morpheo::behavioural::generic::queue::Parameters * _param) 12 void top::test (void) 18 13 { 19 cout << "<" << name << "> : Simulation SystemC" << endl;20 21 #ifdef STATISTICS22 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50);23 #endif24 25 Tusage_t _usage = USE_ALL;26 27 // _usage = usage_unset(_usage,USE_SYSTEMC );28 // _usage = usage_unset(_usage,USE_VHDL );29 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH );30 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);31 // _usage = usage_unset(_usage,USE_POSITION );32 // _usage = usage_unset(_usage,USE_STATISTICS );33 // _usage = usage_unset(_usage,USE_INFORMATION );34 35 Queue * _Queue = new Queue36 (name.c_str(),37 #ifdef STATISTICS38 _parameters_statistics,39 #endif40 _param,41 _usage);42 43 14 #ifdef SYSTEMC 44 /********************************************************************* 45 * Déclarations des signaux 46 *********************************************************************/ 47 string rename; 48 49 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 50 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 51 52 ALLOC0_SC_SIGNAL( in_INSERT_VAL , "in_INSERT_VAL" ,Tcontrol_t); 53 ALLOC0_SC_SIGNAL(out_INSERT_ACK ,"out_INSERT_ACK" ,Tcontrol_t); 54 ALLOC0_SC_SIGNAL( in_INSERT_DATA, "in_INSERT_DATA",Tdata_t ); 55 ALLOC0_SC_SIGNAL(out_RETIRE_VAL ,"out_RETIRE_VAL" ,Tcontrol_t); 56 ALLOC0_SC_SIGNAL( in_RETIRE_ACK , "in_RETIRE_ACK" ,Tcontrol_t); 57 ALLOC0_SC_SIGNAL(out_RETIRE_DATA,"out_RETIRE_DATA",Tdata_t ); 58 ALLOC1_SC_SIGNAL(out_SLOT_VAL ,"out_SLOT_VAL" ,Tcontrol_t,_param->_nb_port_slot); 59 ALLOC1_SC_SIGNAL(out_SLOT_DATA ,"out_SLOT_DATA" ,Tdata_t ,_param->_nb_port_slot); 60 ALLOC0_SC_SIGNAL(out_PTR_WRITE ,"out_PTR_WRITE" ,Tptr_t ); 61 ALLOC0_SC_SIGNAL(out_PTR_READ ,"out_PTR_READ" ,Tptr_t ); 62 63 /******************************************************** 64 * Instanciation 65 ********************************************************/ 66 67 cout << "<" << name << "> Instanciation of _Queue" << endl; 68 69 (*(_Queue->in_CLOCK)) (*(in_CLOCK)); 70 (*(_Queue->in_NRESET)) (*(in_NRESET)); 71 72 INSTANCE0_SC_SIGNAL(_Queue, in_INSERT_VAL ); 73 INSTANCE0_SC_SIGNAL(_Queue,out_INSERT_ACK ); 74 INSTANCE0_SC_SIGNAL(_Queue, in_INSERT_DATA); 75 INSTANCE0_SC_SIGNAL(_Queue,out_RETIRE_VAL ); 76 INSTANCE0_SC_SIGNAL(_Queue, in_RETIRE_ACK ); 77 INSTANCE0_SC_SIGNAL(_Queue,out_RETIRE_DATA); 78 INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_VAL ,_param->_nb_port_slot); 79 INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_DATA ,_param->_nb_port_slot); 80 if (_param->_have_port_ptr_write) 81 INSTANCE0_SC_SIGNAL(_Queue,out_PTR_WRITE ); 82 if (_param->_have_port_ptr_read ) 83 INSTANCE0_SC_SIGNAL(_Queue,out_PTR_READ ); 84 85 cout << "<" << name << "> Start Simulation ............" << endl; 86 Time * _time = new Time(); 87 88 /******************************************************** 89 * Simulation - Begin 90 ********************************************************/ 91 92 // Initialisation 93 const int32_t percent_insert_transaction = 75; 94 const int32_t percent_retire_transaction = 75; 95 const uint32_t nb_request = 3*_param->_size_queue; 96 97 const uint32_t seed = 0; 98 //const uint32_t seed = static_cast<uint32_t>(time(NULL)); 99 100 srand(seed); 101 102 SC_START(0); 103 LABEL("Initialisation"); 104 105 in_INSERT_VAL -> write(0); 106 in_RETIRE_ACK -> write(0); 107 108 LABEL("Reset"); 109 in_NRESET->write(0); 110 SC_START(5); 111 in_NRESET->write(1); 112 113 LABEL("Loop of Test"); 114 115 uint32_t data_in = 0; 116 uint32_t data_out = 0; 117 uint32_t nb_elt = 0; 118 119 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 15 if (usage_is_set(_usage,USE_SYSTEMC)) 120 16 { 121 LABEL("Iteration %d",iteration); 122 123 while (data_out <= nb_request) 124 { 125 in_INSERT_VAL -> write((rand()%100)<percent_insert_transaction); 126 in_INSERT_DATA -> write(data_in); 127 in_RETIRE_ACK -> write((rand()%100)<percent_retire_transaction); 128 129 SC_START(0); // genMoore 130 131 for (uint32_t i=0; i<_param->_nb_port_slot; ++i) 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 const int32_t percent_insert_transaction = 75; 27 const int32_t percent_retire_transaction = 75; 28 const uint32_t nb_request = 3*_param->_size_queue; 29 30 const uint32_t seed = 0; 31 //const uint32_t seed = static_cast<uint32_t>(time(NULL)); 32 33 srand(seed); 34 35 SC_CYCLE(0); 36 LABEL("Initialisation"); 37 38 in_INSERT_VAL -> write(0); 39 in_RETIRE_ACK -> write(0); 40 41 LABEL("Reset"); 42 in_NRESET->write(0); 43 SC_CYCLE(5); 44 in_NRESET->write(1); 45 46 LABEL("Loop of Test"); 47 48 uint32_t data_in = 0; 49 uint32_t data_out = 0; 50 uint32_t nb_elt = 0; 51 52 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 53 { 54 LABEL("Iteration %d",iteration); 55 56 while (data_out <= nb_request) 132 57 { 133 TEST(Tcontrol_t, out_SLOT_VAL [i]->read(), (i<nb_elt)); 134 if (i<nb_elt) 135 TEST(Tdata_t , out_SLOT_DATA[i]->read(), data_out+i); 136 58 in_INSERT_VAL -> write((rand()%100)<percent_insert_transaction); 59 in_INSERT_DATA -> write(data_in); 60 in_RETIRE_ACK -> write((rand()%100)<percent_retire_transaction); 61 62 SC_CYCLE(0); // genMoore 63 64 for (uint32_t i=0; i<_param->_nb_port_slot; ++i) 65 { 66 TEST(Tcontrol_t, out_SLOT_VAL [i]->read(), (i<nb_elt)); 67 if (i<nb_elt) 68 TEST(Tdata_t , out_SLOT_DATA[i]->read(), data_out+i); 69 70 } 71 72 if ( in_INSERT_VAL->read() and out_INSERT_ACK->read()) 73 { 74 LABEL ("Transaction with interface : INSERT"); 75 data_in ++; 76 nb_elt ++; 77 } 78 if (out_RETIRE_VAL->read() and in_RETIRE_ACK->read()) 79 { 80 LABEL ("Transaction with interface : RETIRE"); 81 TEST(Tdata_t, out_RETIRE_DATA->read(), data_out); 82 data_out++; 83 nb_elt --; 84 } 85 86 SC_CYCLE(1); 137 87 } 138 139 if ( in_INSERT_VAL->read() and out_INSERT_ACK->read()) 140 { 141 LABEL ("Transaction with interface : INSERT"); 142 data_in ++; 143 nb_elt ++; 144 } 145 if (out_RETIRE_VAL->read() and in_RETIRE_ACK->read()) 146 { 147 LABEL ("Transaction with interface : RETIRE"); 148 TEST(Tdata_t, out_RETIRE_DATA->read(), data_out); 149 data_out++; 150 nb_elt --; 151 } 152 153 SC_START(1); 154 } 88 } 89 90 /******************************************************** 91 * Simulation - End 92 ********************************************************/ 93 94 TEST_OK (""); 95 96 sc_stop(); 97 delete _time; 98 99 msgInformation(_("<%s> : ............ Stop Simulation\n"),name.c_str()); 155 100 } 156 157 /********************************************************158 * Simulation - End159 ********************************************************/160 161 TEST_OK ("End of Simulation");162 delete _time;163 cout << "<" << name << "> ............ Stop Simulation" << endl;164 165 delete in_CLOCK;166 delete in_NRESET;167 168 DELETE0_SC_SIGNAL( in_INSERT_VAL );169 DELETE0_SC_SIGNAL(out_INSERT_ACK );170 DELETE0_SC_SIGNAL( in_INSERT_DATA);171 DELETE0_SC_SIGNAL(out_RETIRE_VAL );172 DELETE0_SC_SIGNAL( in_RETIRE_ACK );173 DELETE0_SC_SIGNAL(out_RETIRE_DATA);174 DELETE1_SC_SIGNAL(out_SLOT_VAL ,_param->_nb_port_slot);175 DELETE1_SC_SIGNAL(out_SLOT_DATA ,_param->_nb_port_slot);176 DELETE0_SC_SIGNAL(out_PTR_WRITE );177 DELETE0_SC_SIGNAL(out_PTR_READ );178 #endif179 180 delete _Queue;181 #ifdef STATISTICS182 delete _parameters_statistics;183 101 #endif 184 102 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters.cpp
r101 r113 21 21 bool have_port_ptr_write, 22 22 bool have_port_ptr_read ): 23 behavioural::Parameters("Queue"), 23 24 _size_queue (size_queue), 24 25 _size_data (size_data ), -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue.cpp
r88 r113 33 33 ,_usage (usage) 34 34 { 35 log_printf(FUNC,Queue,FUNCTION,"Begin"); 35 log_begin(Queue,FUNCTION); 36 37 // #if DEBUG_Core == true 38 // log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str()); 36 39 37 #if DEBUG_Core == true 38 log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str()); 40 // std::cout << *param << std::endl; 41 // #endif 39 42 40 std::cout << *param << std::endl; 41 #endif 42 43 log_printf(INFO,Queue,FUNCTION,"Allocation"); 43 log_printf(INFO,Queue,FUNCTION,_("<%s> Allocation"),_name.c_str()); 44 44 allocation (); 45 45 … … 47 47 if (usage_is_set(_usage,USE_STATISTICS)) 48 48 { 49 log_printf(INFO,Queue,FUNCTION, "Allocation of statistics");49 log_printf(INFO,Queue,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str()); 50 50 51 51 statistics_declaration(param_statistics); … … 57 57 { 58 58 // generate the vhdl 59 log_printf(INFO,Queue,FUNCTION, "Generate the vhdl");59 log_printf(INFO,Queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str()); 60 60 61 61 vhdl(); … … 66 66 if (usage_is_set(_usage,USE_SYSTEMC)) 67 67 { 68 log_printf(INFO,Queue,FUNCTION, "Method - transition");68 log_printf(INFO,Queue,FUNCTION,_("<%s> Method - transition"),_name.c_str()); 69 69 70 70 SC_METHOD (transition); … … 76 76 # endif 77 77 78 log_printf(INFO,Queue,FUNCTION, "Method - genMoore");78 log_printf(INFO,Queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str()); 79 79 80 80 SC_METHOD (genMoore); … … 88 88 #endif 89 89 } 90 log_ printf(FUNC,Queue,FUNCTION,"End");90 log_end(Queue,FUNCTION); 91 91 }; 92 92 … … 95 95 Queue::~Queue (void) 96 96 { 97 log_ printf(FUNC,Queue,FUNCTION,"Begin");97 log_begin(Queue,FUNCTION); 98 98 99 99 #ifdef STATISTICS 100 100 if (usage_is_set(_usage,USE_STATISTICS)) 101 101 { 102 log_printf(INFO,Queue,FUNCTION, "Generate Statistics file");102 log_printf(INFO,Queue,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str()); 103 103 104 104 delete _stat; … … 106 106 #endif 107 107 108 log_printf(INFO,Queue,FUNCTION, "Deallocation");108 log_printf(INFO,Queue,FUNCTION,_("<%s> Deallocation"),_name.c_str()); 109 109 deallocation (); 110 110 111 log_ printf(FUNC,Queue,FUNCTION,"End");111 log_end(Queue,FUNCTION); 112 112 }; 113 113 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_allocation.cpp
r112 r113 9 9 #include "Behavioural/include/Allocation.h" 10 10 11 namespace morpheo 11 namespace morpheo { 12 12 namespace behavioural { 13 13 namespace generic { 14 14 namespace queue { 15 16 17 15 18 16 #undef FUNCTION … … 25 23 26 24 Entity * entity = _component->set_entity (_name 27 , "Queue"25 ,_param->_type 28 26 #ifdef POSITION 29 27 ,COMBINATORY … … 111 109 }; // end namespace queue 112 110 }; // end namespace generic 113 114 111 }; // end namespace behavioural 115 112 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_deallocation.cpp
r101 r113 21 21 log_printf(FUNC,Queue,FUNCTION,"Begin"); 22 22 23 if (usage_is_set(_usage,USE_SYSTEMC))23 // if (usage_is_set(_usage,USE_SYSTEMC)) 24 24 { 25 delete in_CLOCK;26 delete in_NRESET;25 DELETE0_SIGNAL( in_CLOCK ,1); 26 DELETE0_SIGNAL( in_NRESET,1); 27 27 28 28 DELETE0_SIGNAL( in_INSERT_VAL ,1); … … 41 41 if (_param->_have_port_ptr_read ) 42 42 DELETE0_SIGNAL(out_PTR_READ ,_param->_size_ptr); 43 } 43 44 44 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 if (usage_is_set(_usage,USE_SYSTEMC)) 46 { 47 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 48 delete _queue_control; 46 49 delete _queue_data; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_statistics_declaration.cpp
r81 r113 21 21 22 22 _stat = new Stat (static_cast<std::string>(_name), 23 "Queue",23 _param->_type, 24 24 param_statistics); 25 25 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/Makefile
r81 r113 8 8 9 9 #-----[ Directory ]---------------------------------------- 10 DIR_MORPHEO = ../../.. 10 DIR_COMPONENT = ./ 11 include $(DIR_COMPONENT)/Makefile.defs 11 12 12 13 #-----[ Library ]------------------------------------------ 13 14 LIBRARY = $(DIR_LIB)/libQueue_Control.a 14 15 16 15 17 #-----[ include ]------------------------------------------ 16 18 17 all : $(LIBRARY_NEED)19 all : 18 20 @$(MAKE) all_component 19 21 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/Makefile.deps
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile … … 8 8 # DIR_MORPHEO must be defined 9 9 10 Queue_Control 10 Queue_Control = yes 11 11 12 #-----[ Library ]------------------------------------------ 13 Queue_Control_LIBRARY = -lQueue_Control 12 ifndef Behavioural 13 include $(DIR_MORPHEO)/Behavioural/Makefile.deps 14 endif 14 15 15 Queue_Control_DIR_LIBRARY = -L$(DIR_MORPHEO)/Behavioural/Generic/Queue_Control/lib 16 #-----[ Library ]------------------------------------------ 17 Queue_Control_LIBRARY = -lQueue_Control \ 18 $(Behavioural_LIBRARY) 16 19 17 #-----[ Rules ]-------------------------------------------- 20 Queue_Control_DIR_LIBRARY = -L$(DIR_MORPHEO)/Behavioural/Generic/Queue_Control/lib \ 21 $(Behavioural_DIR_LIBRARY) 22 23 #-----[ Rules ]-------------------------------------------- 24 25 #.NOTPARALLEL : Queue_Control_library Queue_Control_library_clean 18 26 19 27 Queue_Control_library : 20 28 @\ 21 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/Queue_Control --makefile=Makefile ; 22 29 $(MAKE) Behavioural_library;\ 30 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/Queue_Control --makefile=Makefile; 31 23 32 Queue_Control_library_clean : 24 33 @\ 34 $(MAKE) Behavioural_library_clean;\ 25 35 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/Queue_Control --makefile=Makefile clean; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = RegisterFile 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = RegisterFile_Monolithic 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp
r94 r113 159 159 while (nb_ack < _param->_nb_word) 160 160 { 161 cout << "cycle : " << static_cast<uint32_t> (s c_simulation_time()) << endl;161 cout << "cycle : " << static_cast<uint32_t> (simulation_cycle()) << endl; 162 162 163 163 for (uint32_t num_port=0; num_port < _param->_nb_port_write; num_port ++) … … 232 232 while (nb_ack < _param->_nb_word) 233 233 { 234 cout << "cycle : " << static_cast<uint32_t> (s c_simulation_time()) << endl;234 cout << "cycle : " << static_cast<uint32_t> (simulation_cycle()) << endl; 235 235 236 236 for (uint32_t num_port=0; num_port < _param->_nb_port_read; num_port ++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = RegisterFile_Multi_Banked 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest/src/test.cpp
r88 r113 136 136 while (nb_ack < nb_request) 137 137 { 138 cout << "cycle : " << static_cast<uint32_t> (s c_simulation_time()) << endl;138 cout << "cycle : " << static_cast<uint32_t> (simulation_cycle()) << endl; 139 139 140 140 for (uint32_t num_port=0; num_port < _param->_nb_port_write; num_port ++) … … 183 183 while (nb_ack < nb_request) 184 184 { 185 cout << "cycle : " << static_cast<uint32_t> (s c_simulation_time()) << endl;185 cout << "cycle : " << static_cast<uint32_t> (simulation_cycle()) << endl; 186 186 187 187 for (uint32_t num_port=0; num_port < _param->_nb_port_read; num_port ++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/SelfTest/src/test.cpp
r88 r113 136 136 while (nb_ack < nb_request) 137 137 { 138 cout << "cycle : " << static_cast<uint32_t> (s c_simulation_time()) << endl;138 cout << "cycle : " << static_cast<uint32_t> (simulation_cycle()) << endl; 139 139 140 140 for (uint32_t num_port=0; num_port < _param->_nb_port_write; num_port ++) … … 184 184 while (nb_ack < nb_request) 185 185 { 186 cout << "cycle : " << static_cast<uint32_t> (s c_simulation_time()) << endl;186 cout << "cycle : " << static_cast<uint32_t> (simulation_cycle()) << endl; 187 187 188 188 for (uint32_t num_port=0; num_port < _param->_nb_port_read; num_port ++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Select_Priority_Fixed 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/test.cpp
r97 r113 108 108 109 109 sc_start(0); 110 //cout << "{"+toString(static_cast<uint32_t>(s c_simulation_time()))+"} Initialisation" << endl;110 //cout << "{"+toString(static_cast<uint32_t>(simulation_cycle()))+"} Initialisation" << endl; 111 111 112 cout << "{"+toString(static_cast<uint32_t>(s c_simulation_time()))+"} Loop of Test" << endl;112 cout << "{"+toString(static_cast<uint32_t>(simulation_cycle()))+"} Loop of Test" << endl; 113 113 114 114 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Shifter 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/src/test.cpp
r112 r113 147 147 if (param._have_shift_logic_left) 148 148 { 149 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} Test Shift Left Logic" << endl;149 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} Test Shift Left Logic" << endl; 150 150 direction = _left ; 151 151 type = _shift; … … 156 156 else 157 157 { 158 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} No Test Shift Left Logic" << endl;158 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} No Test Shift Left Logic" << endl; 159 159 continue; 160 160 } … … 162 162 if (param._have_shift_logic_right) 163 163 { 164 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} Test Shift Right Logic" << endl;164 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} Test Shift Right Logic" << endl; 165 165 direction = _right; 166 166 type = _shift; … … 171 171 else 172 172 { 173 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} No Test Shift Right Logic" << endl;173 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} No Test Shift Right Logic" << endl; 174 174 continue; 175 175 } … … 177 177 if (param._have_shift_arithmetic_left) 178 178 { 179 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} Test Shift Left Arithmetic" << endl;179 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} Test Shift Left Arithmetic" << endl; 180 180 direction = _left ; 181 181 type = _shift ; … … 186 186 else 187 187 { 188 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} No Test Shift Left Arithmetic" << endl;188 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} No Test Shift Left Arithmetic" << endl; 189 189 continue; 190 190 } … … 192 192 if (param._have_shift_arithmetic_right) 193 193 { 194 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} Test Shift Right Arithmetic" << endl;194 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} Test Shift Right Arithmetic" << endl; 195 195 direction = _right; 196 196 type = _shift; … … 201 201 else 202 202 { 203 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} No Test Shift Right Arithmetic" << endl;203 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} No Test Shift Right Arithmetic" << endl; 204 204 continue; 205 205 } … … 207 207 if ( param._have_rotate_left) 208 208 { 209 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} Test Rotate Left" << endl;209 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} Test Rotate Left" << endl; 210 210 direction = _left ; 211 211 type = _rotate; … … 216 216 else 217 217 { 218 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} No Test Rotate Left" << endl;218 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} No Test Rotate Left" << endl; 219 219 continue; 220 220 } … … 222 222 if (param._have_rotate_right) 223 223 { 224 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} Test Rotate Right" << endl;224 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} Test Rotate Right" << endl; 225 225 direction = _right; 226 226 type = _rotate; … … 231 231 else 232 232 { 233 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "} No Test Rotate Right" << endl;233 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "} No Test Rotate Right" << endl; 234 234 continue; 235 235 } … … 283 283 sc_start(0); 284 284 285 cout << "{" << static_cast<uint32_t>(s c_simulation_time()) << "}" << endl;285 cout << "{" << static_cast<uint32_t>(simulation_cycle()) << "}" << endl; 286 286 287 287 for (uint32_t i=0; i<param._nb_port; i++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Sort/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Sort 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Makefile.defs
r81 r113 7 7 # 8 8 9 ENTITY = Victim 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../.. -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 # Makefile 7 7 # 8 8 9 #-----[ Directory ]---------------------------------------- 9 ENTITY = Victim_Pseudo_LRU 10 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ../../../.. 11 13 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/src/test.cpp
r95 r113 119 119 for (uint32_t k=0; k<param._nb_entity; k++) 120 120 { 121 cout << "time : " << static_cast<uint32_t>(s c_simulation_time()) << endl;121 cout << "time : " << static_cast<uint32_t>(simulation_cycle()) << endl; 122 122 for (uint32_t i=0; i<param._nb_access; i++) 123 123 { … … 165 165 { 166 166 167 cout << "time : " << static_cast<uint32_t>(s c_simulation_time()) << endl;167 cout << "time : " << static_cast<uint32_t>(simulation_cycle()) << endl; 168 168 for (uint32_t i=0; i<param._nb_access; i++) 169 169 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common
r103 r113 22 22 endif 23 23 24 ##-----[ Entity ]------------------------------------------- 25 #ENTITY = $$($(BASENAME) $$PWD) 26 24 27 #-----[ Directory ]---------------------------------------- 25 28 #DIR_TMP = . … … 27 30 DIR_INC = include 28 31 DIR_SRC = src 29 DIR_OBJ = obj 32 DIR_OBJ = $(DIR_TMP)/obj 33 DIR_LIB = $(DIR_TMP)/lib 30 34 DIR_SCRIPT = $(MORPHEO_SCRIPT) 31 35 … … 35 39 -I$(DIR_MORPHEO) 36 40 37 LIBDIR = $(DIR_LIBRARY)\41 LIBDIR = -L$(DIR_LIB) \ 38 42 $(SYSTEMC_LIBDIR_$(SIMULATOR)) 39 43 # $(OR1K_LIBDIR) 40 41 LIBS = $(LIBRARY) -lm $(SYSTEMC_LIBNAME_$(SIMULATOR))42 43 # $(OR1K_LIBNAME) -lbfd44 44 45 45 FLAGS_COMMON = $(SYSTEMC_CFLAGS_$(SIMULATOR)) \ … … 50 50 51 51 #-----[ Variable ]----------------------------------------- 52 ENTITY = $$($(BASENAME) $$PWD)53 54 OBJECTS_COMMON = $( patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.cpp))52 #OBJECTS_COMMON = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.cpp)) 53 SOURCES = $(wildcard $(DIR_SRC)/*.cpp) 54 OBJECTS_COMMON = $(addprefix $(DIR_OBJ)/$(ENTITY)_, $(addsuffix .o, $(basename $(notdir $(SOURCES))))) 55 55 56 56 HEADERS = $(wildcard $(DIR_INC)/*.h) 57 57 58 58 #-----[ Rules ]-------------------------------------------- 59 .PRECIOUS : $(DIR_OBJ)/ %.o59 .PRECIOUS : $(DIR_OBJ)/$(ENTITY)_%.o 60 60 61 61 test_env : 62 62 @$(ECHO) "-------------------| $(ENTITY)" 63 63 64 test : 65 @echo $(DIR_LIBRARY); 64 66 65 $(DIR_OBJ)/ %.o: $(DIR_SRC)/%.cpp $(HEADERS)67 $(DIR_OBJ)/$(ENTITY)_%.o : $(DIR_SRC)/%.cpp $(HEADERS) 66 68 @\ 67 69 $(ECHO) "Compilation : $*";\ 68 $( CXX) $(CFLAGS) -c -o $@ $<;70 $(SYSTEMC_CXX_$(SIMULATOR)) $(CFLAGS) -c -o $@ $<; 69 71 70 72 $(DIR_OBJ) : … … 76 78 @\ 77 79 $(ECHO) "Delete temporary files in directory $(PWD)";\ 78 $(RM) $(DIR_OBJ) \ 79 $(DIR_BIN) \ 80 *~ \ 81 $(DIR_SRC)/*~ \ 80 $(RM) $(OBJECTS_COMMON) \ 81 *~ \ 82 $(DIR_SRC)/*~ \ 82 83 $(DIR_INC)/*~; 83 84 84 85 common_clean_all : common_clean 86 @\ 87 $(RM) $(DIR_OBJ) 85 88 86 89 common_help : -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Component
r88 r113 2 2 DIR_DOC = doc 3 3 DIR_TEST = SelfTest 4 DIR_LIB = lib5 4 6 5 #-----[ Variable ]----------------------------------------- … … 11 10 #.NOTPARALLEL : clean help 12 11 13 all_component : test_env $(DIR_OBJ) $(DIR_LIB) $(OBJECTS) $(HEADERS) 14 @$(MAKE) $(LIBRARY) 12 all_component : test_env $(DIR_OBJ) $(DIR_LIB) 13 @\ 14 $(MAKE) $(LIBRARY); 15 15 16 $(DIR_LIB)/%.a : $(OBJECTS) $(HEADERS) 16 # if simulator is modelsim, libComponent.a is a directory, else is normal library generated by g++ 17 18 $(DIR_LIB)/%.a : $(SOURCES) $(HEADERS) 17 19 @\ 18 $(ECHO) "Archive : $*";\ 19 $(AR) -r $@ $(OBJECTS);\ 20 $(RANLIB) $@; 20 case "${SIMULATOR}" in \ 21 "modelsim") \ 22 $(MODELTECH_VLIB) $@; \ 23 $(MODELTECH_SCCOM) $(CFLAGS) $(SOURCES) -work $@; \ 24 ;; \ 25 *) \ 26 $(MAKE) $(OBJECTS); \ 27 $(ECHO) "Archive : $*"; \ 28 $(AR) -r $@ $(OBJECTS); \ 29 $(RANLIB) $@; \ 30 ;; \ 31 esac; 21 32 22 33 $(DIR_LIB) : … … 29 40 30 41 component_clean : 31 @$(RM) $(DIR_LIB) 32 42 @$(RM) $(LIBRARY) 33 43 # if $(TEST) -d $(DIR_DOC); then $(MAKE) --directory=$(DIR_DOC) --makefile=Makefile clean; fi; 34 44 35 45 component_clean_all : component_clean 36 46 @$(RM) $(DIR_LIB) 37 47 # if $(TEST) -d $(DIR_DOC); then $(MAKE) --directory=$(DIR_DOC) --makefile=Makefile clean_all; fi; 38 48 … … 46 56 $(ECHO) " * help : print this text";\ 47 57 $(ECHO) ""; 48 49 58 50 59 help : … … 58 67 $(MAKE) component_clean; 59 68 60 clean_all 69 clean_all : 61 70 @\ 62 71 $(MAKE) common_clean_all ;\ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
r94 r113 9 9 #-----[ Directory ]---------------------------------------- 10 10 DIR_BIN = $(DIR_TMP)/bin 11 DIR_LIB = ../lib12 11 DIR_CFG_GEN = $(DIR_TMP)/configuration_generated 13 12 DIR_CFG_USER = configuration … … 19 18 20 19 OBJECTS = $(OBJECTS_COMMON) 20 21 LIBS = -lm $(SYSTEMC_LIBNAME_$(SIMULATOR)) 22 # $(OR1K_LIBNAME) -lbfd 23 24 MODELTECH_LIBRARY = $(addprefix -lib ,$(addsuffix .a, $(subst -l,$(DIR_LIB)/lib,$(LIBRARY)))) 25 #MODELTECH_LIBRARY = $(LIBRARY) 21 26 22 27 EXEC_PREFIX = … … 152 157 x=$$i; \ 153 158 for j in $${ENUM_PARAM[*]}; do \ 154 declare -a RANGE_LOCAL=($${RANGE[$$j]}); 159 declare -a RANGE_LOCAL=($${RANGE[$$j]}); \ 155 160 DATA[$$j]="$${RANGE_LOCAL[$$((($$x % $${SIZE[$$j]})))]} "; \ 156 161 x=$$(($$x/$${SIZE[$$j]})); \ … … 195 200 fi; 196 201 197 $(DIR_BIN)/%.x : $( OBJECTS) $(HEADERS) $(DIR_LIB)202 $(DIR_BIN)/%.x : $(SOURCES) $(HEADERS) $(DIR_OBJ) $(DIR_BIN) 198 203 @\ 199 204 $(ECHO) "Linkage : $*";\ 200 $(CXX) $(LFLAGS) -o $@ $(OBJECTS) $(LIBS); 201 202 $(DIR_LIB) : 203 @\ 204 $(ECHO) "Create directory : $@";\ 205 $(MKDIR) $@; 206 207 $(DIR_BIN) : 208 @\ 209 $(ECHO) "Create directory : $@";\ 210 $(MKDIR) $@; 211 212 $(DIR_LOG) : 213 @\ 214 $(ECHO) "Create directory : $@";\ 215 $(MKDIR) $@; 216 217 $(DIR_CFG_GEN) : 205 case "${SIMULATOR}" in \ 206 "modelsim") \ 207 $(MAKE) vhdl_package; \ 208 $(MAKE) vhdl_entity; \ 209 $(MODELTECH_SCCOM) -work $(DIR_WORK) $(CFLAGS) $(SOURCES); \ 210 $(MODELTECH_SCCOM) -work $(DIR_WORK) $(MODELTECH_LIBRARY) $(LFLAGS) $(LIBS) -link;\ 211 $(ECHO) "#!$(SHELL)" > $@; \ 212 $(ECHO) "cd $${PWD};" >> $@; \ 213 $(ECHO) 'declare args;' >> $@; \ 214 $(ECHO) 'for i in $${*}; do' >> $@; \ 215 $(ECHO) ' args=$${args}" -sc_arg $${i}";' >> $@; \ 216 $(ECHO) 'done;' >> $@; \ 217 $(ECHO) "$(MODELTECH_VSIM) -novopt "'$${args}'" $(MODELTECH_LIBRARY) $(DIR_WORK).top;" >> $@; \ 218 $(ECHO) "cd -;" >> $@; \ 219 $(CHMOD) +x $@; \ 220 ;; \ 221 *) \ 222 $(MAKE) $(OBJECTS); \ 223 $(SYSTEMC_CXX_$(SIMULATOR)) $(LFLAGS) -o $@ $(OBJECTS) $(LIBRARY) $(LIBS);\ 224 ;; \ 225 esac; 226 227 $(DIR_BIN) $(DIR_LOG) $(DIR_CFG_GEN) : 218 228 @\ 219 229 $(ECHO) "Create directory : $@";\ … … 223 233 @$(RM) $(DIR_LOG) \ 224 234 $(DIR_CFG_USER)/*~ \ 235 $(DIR_BIN)/$(EXEC).x \ 225 236 *.vhdl \ 226 237 *.pos \ … … 234 245 235 246 selftest_clean_all : library_clean 236 247 @\ 248 $(RM) $(DIR_BIN) 237 249 238 250 selftest_help : -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis
r112 r113 10 10 11 11 DIR_VHDL = . 12 DIR_WORK = work 12 WORK_NAME = work 13 DIR_WORK = $(MORPHEO_TMP)/$(WORK_NAME) 13 14 14 15 FPGA_CFG_FILE_LOCAL = mkf.info … … 21 22 FPGA_LOG_FILES = $(patsubst $(DIR_CFG_GEN)/%.cfg,$(DIR_LOG)/%.fpga.log,$(wildcard $(DIR_CFG_GEN)/*.cfg)) \ 22 23 $(patsubst $(DIR_CFG_USER)/%.cfg,$(DIR_LOG)/%.fpga.log,$(wildcard $(DIR_CFG_USER)/*.cfg)) 24 25 23 26 #-----[ Rules ]-------------------------------------------- 24 27 .PRECIOUS : $(DIR_LOG)/%.vhdl.log $(DIR_LOG)/%.sim.log 25 28 26 vhdl : execute $(DIR_WORK) 29 vhdl : $(EXEC_LOG) 30 @\ 31 $(MAKE) vhdl_package; \ 32 $(MAKE) vhdl_entity; \ 33 $(MAKE) vhdl_testbench 34 35 vhdl_package : $(DIR_WORK) 27 36 @\ 28 37 declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*_Pack.vhdl)); \ 29 38 declare -a log_files=($${vhdl_files[*]/%.vhdl/.vhdl.log}); \ 30 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; \ 39 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) -k $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; 40 41 vhdl_testbench : $(DIR_WORK) 42 @\ 43 declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*_Testbench.vhdl)); \ 44 declare -a log_files=($${vhdl_files[*]/%.vhdl/.vhdl.log}); \ 45 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) -k $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; 46 47 vhdl_entity : $(DIR_WORK) 48 @\ 31 49 declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*.vhdl|$(GREP_NOT) "(_Pack\.|_Testbench\.)")); \ 32 50 declare -a log_files=($${vhdl_files[*]/%.vhdl/.vhdl.log}); \ 33 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; \ 34 declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*_Testbench.vhdl)); \ 35 declare -a log_files=($${vhdl_files[*]/%.vhdl/.vhdl.log}); \ 36 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; 51 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) -k $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; \ 37 52 53 #list : 54 # @\ 55 # declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*.vhdl|$(GREP_NOT) "(_Pack\.|_Testbench\.)")); \ 56 # for file1 in $${vhdl_files[*]}; do \ 57 # declare x=$$(basename $${file1} .vhdl); \ 58 # declare -i count_x=$($(ECHO) $${x} | ${WC} -m); \ 59 # for file2 in $${vhdl_files[*]}; do \ 60 # if $(TEST) "$${file1}" != "$${file2}"; then\ 61 # declare y=$$(basename $${file2} .vhdl); \ 62 # declare -i count_y=$($(ECHO) $${y} | ${WC} -m); \ 63 # if $(TEST) $${count_x} -gt $${count_y}; then \ 64 # break; \ 65 # fi; \ 66 # $(ECHO) $${x}; \ 67 # fi; \ 68 # done; \ 69 # done; 38 70 39 71 sim : vhdl … … 41 73 declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*_Testbench.vhdl)); \ 42 74 declare -a log_files=($${vhdl_files[*]/%.vhdl/.sim.log}); \ 43 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi;75 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) -k $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; 44 76 45 77 fpga : sim … … 56 88 done; \ 57 89 ($(XILINX_ENV); cd $(FPGA_CFG_FILE_GLOBAL_DIR); ./$(FPGA_CFG_FILE_GLOBAL)); \ 58 $(MAKE) $(FPGA_LOG_FILES);90 $(MAKE) -k $(FPGA_LOG_FILES); 59 91 60 92 $(DIR_LOG)/%.fpga.log : … … 65 97 $(DIR_WORK) : 66 98 @\ 67 $(ECHO) "Create work-space : $@"; \ 68 $(MODELTECH_VLIB) $@; \ 69 $(MODELTECH_VMAP) $(XILINX_CORELIB); 99 $(ECHO) "Create work-space : $@"; \ 100 $(MODELTECH_VLIB) $@; \ 101 $(MODELTECH_VMAP) $(XILINX_LIBNAME) $(XILINX_LIBDIR); \ 102 if $(TEST) $${?} -ne 0; then \ 103 $(ECHO) "Xilinx corelib must be compiled to simulation tools"; \ 104 $(ECHO) "Run manualy \"$(XILINX_COMPXLIB)\" with $(XILINX_CORELIB) directory"; \ 105 fi; 70 106 71 107 $(DIR_LOG)/%.sim.log : $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log … … 82 118 @\ 83 119 $(ECHO) "VHDL's Compilation : $*"; \ 84 $(MODELTECH_VCOM) $< &> $@;120 $(MODELTECH_VCOM) -work $(DIR_WORK) $< &> $@; 85 121 86 122 synthesis_clean : 87 123 @\ 88 124 if $(TEST) -f Makefile.mkf; then $(MAKE) -f Makefile.mkf clean; fi; \ 89 $(RM) $(DIR_WORK) transcript Makefile.mkf * .wlf;125 $(RM) $(DIR_WORK) transcript Makefile.mkf *wlf* modelsim.ini; 90 126 91 127 synthesis_clean_all : synthesis_clean -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.defs
r81 r113 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 7 #-----[ Directory ]---------------------------------------- 7 ENTITY = Behavioural 8 9 #-----[ Directory ]---------------------------------------- 8 10 DIR_COMPONENT_MORPHEO = .. 9 11 DIR_MORPHEO = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component.sh
r81 r113 16 16 { 17 17 echo ""; 18 echo "usage : $0 <directory> <name> ";18 echo "usage : $0 <directory> <name> <type>"; 19 19 echo " - <directory> : localisation of component"; 20 20 echo " - <name> : name of component"; -
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); -
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); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
r112 r113 101 101 #define PRINT_SIZE_NUL(component,interface,signal) log_printf(TRACE,Allocation,FUNCTION,_("<%s> %s.%s.%s : size is nul."),_name.c_str(),component->get_name().c_str(),interface->get_name().c_str(),signal); 102 102 #define TEST_SIGNAL(name,address) PRINT_SIGNAL_ADDRESS(name,address); TEST_PTR(address) 103 #define INSTANCE_FOREIGN_PRINT(name) log_printf(TRACE,Allocation,FUNCTION,"<%s> : %s (%s, %d)",_name.c_str(),name,__FILE__,__LINE__); 103 104 104 105 // ---------------------------------------------------------------------- … … 106 107 // ---------------------------------------------------------------------- 107 108 108 109 #define __ALLOC0_SIGNAL(sig, name, type) \ 109 #define __ALLOC0_SIGNAL(sig, name, type) \ 110 110 { \ 111 111 sig = new type (name); \ … … 113 113 114 114 #ifdef POSITION 115 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) 115 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) \ 116 116 INTERFACE_PRINT(name); \ 117 117 morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name, direction, localisation, str); 118 118 #else 119 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) 119 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) \ 120 120 INTERFACE_PRINT(name); \ 121 121 morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name); … … 124 124 #define ALLOC0_INTERFACE_END() 125 125 126 #define ALLOC0_VAL_ACK_IN( sig, name, type) 126 #define ALLOC0_VAL_ACK_IN( sig, name, type) \ 127 127 { \ 128 128 sig = interface->set_signal_valack_in (name, type); \ 129 129 } 130 #define ALLOC0_VAL_ACK_OUT( sig, name, type) 130 #define ALLOC0_VAL_ACK_OUT( sig, name, type) \ 131 131 { \ 132 132 sig = interface->set_signal_valack_out(name, type); \ 133 133 } 134 #define ALLOC0_VALACK_IN( sig, type) 134 #define ALLOC0_VALACK_IN( sig, type) \ 135 135 { \ 136 136 sig = interface->set_signal_valack_in (type); \ … … 160 160 } 161 161 162 #define DELETE0_SIGNAL( sig, size) 162 #define DELETE0_SIGNAL( sig, size) \ 163 163 if (size > 0) \ 164 164 { \ … … 166 166 } 167 167 168 #define ALLOC0_SC_SIGNAL( sig, name, type) \ 169 sc_signal<type> * sig = new sc_signal<type> (name); \ 168 #define ALLOC0_FOREIGN_SIGNAL_IN( sig, interface, name, type, size) \ 169 if (size > 0) \ 170 { \ 171 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 172 sig = new SC_IN (type) (str.c_str()); \ 173 } 174 175 #define ALLOC0_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size) \ 176 if (size > 0) \ 177 { \ 178 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 179 sig = new SC_OUT (type) (str.c_str()); \ 180 } 181 182 #define DELETE0_FOREIGN_SIGNAL( sig, size) \ 183 { \ 184 DELETE0_SIGNAL(sig,size); \ 185 } 186 187 #define INSTANCE0_FOREIGN_SIGNAL(component, sig, type, name, size) \ 188 if (size > 0) \ 189 { \ 190 INSTANCE_FOREIGN_PRINT(name); \ 191 _component->set_sc_signal<type>(_name,name,static_cast<void*>(component->sig)); \ 192 } 193 194 #define ALLOC0_SC_SIGNAL( sig, name, type) \ 195 sig = new sc_signal<type> (name); \ 170 196 PRINT_SIGNAL_ADDRESS(name,sig); 171 197 172 #define INSTANCE0_SC_SIGNAL(component, sig) 198 #define INSTANCE0_SC_SIGNAL(component, sig) \ 173 199 { \ 174 200 TEST_SIGNAL(component->sig->name(),component->sig); \ … … 177 203 } 178 204 179 #define _INSTANCE0_SC_SIGNAL(component, sig1,sig2) 205 #define _INSTANCE0_SC_SIGNAL(component, sig1,sig2) \ 180 206 { \ 181 207 TEST_SIGNAL(component->sig1->name(),component->sig1); \ … … 185 211 186 212 #define DELETE0_SC_SIGNAL( sig) \ 187 { \ 188 delete sig; \ 213 { \ 214 PRINT_SIGNAL_ADDRESS("",sig); \ 215 delete sig; \ 189 216 } 190 217 … … 326 353 } 327 354 355 #define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1) \ 356 { \ 357 sig = new SC_IN (type) * [x1]; \ 358 for (uint32_t it1=0; it1<x1; it1++) \ 359 if (size > 0) \ 360 { \ 361 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 362 sig [it1] = new SC_IN (type) (str.c_str()); \ 363 } \ 364 } 365 366 #define ALLOC1_FOREIGN_SIGNAL_OUT(sig, interface, name, type, size,x1) \ 367 { \ 368 sig = new SC_OUT (type) * [x1]; \ 369 for (uint32_t it1=0; it1<x1; it1++) \ 370 if (size > 0) \ 371 { \ 372 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 373 sig [it1] = new SC_OUT (type) (str.c_str()); \ 374 } \ 375 } 376 377 #define DELETE1_FOREIGN_SIGNAL( sig, size,x1) \ 378 { \ 379 DELETE1_SIGNAL(sig,x1,size); \ 380 } 381 328 382 #define ALLOC1_SC_SIGNAL( sig, name, type, x1) \ 329 s c_signal<type> ** sig = new sc_signal<type> * [x1];\383 sig = new sc_signal<type> * [x1]; \ 330 384 { \ 331 385 std::string separator="_"; \ … … 359 413 for (uint32_t it1=0; it1<x1; it1++) \ 360 414 { \ 415 PRINT_SIGNAL_ADDRESS("",sig[it1]); \ 361 416 delete sig[it1]; \ 362 417 } \ … … 530 585 } 531 586 587 588 #define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \ 589 { \ 590 sig = new SC_IN (type) ** [x1]; \ 591 for (uint32_t it1=0; it1<x1; it1++) \ 592 { \ 593 sig [it1] = new SC_IN (type) * [x2]; \ 594 for (uint32_t it2=0; it2<x2; it2++) \ 595 if (size > 0) \ 596 { \ 597 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 598 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 599 } \ 600 } \ 601 } 602 603 #define ALLOC2_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2) \ 604 { \ 605 sig = new SC_OUT (type) ** [x1]; \ 606 for (uint32_t it1=0; it1<x1; it1++) \ 607 { \ 608 sig [it1] = new SC_OUT (type) * [x2]; \ 609 for (uint32_t it2=0; it2<x2; it2++) \ 610 if (size > 0) \ 611 { \ 612 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 613 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 614 } \ 615 } \ 616 } 617 618 #define DELETE2_FOREIGN_SIGNAL( sig, size,x1,x2) \ 619 { \ 620 DELETE2_SIGNAL(sig,x1,x2,size); \ 621 } 622 532 623 #define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2) \ 533 s c_signal<type> *** sig = new sc_signal<type> ** [x1];\624 sig = new sc_signal<type> ** [x1]; \ 534 625 { \ 535 626 std::string separator="_"; \ … … 571 662 for (uint32_t it2=0; it2<x2; it2++) \ 572 663 { \ 664 PRINT_SIGNAL_ADDRESS("",sig[it1][it2]); \ 573 665 delete sig[it1][it2]; \ 574 666 } \ … … 758 850 } 759 851 852 #define ALLOC3_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2,x3) \ 853 { \ 854 sig = new SC_IN (type) *** [x1]; \ 855 for (uint32_t it1=0; it1<x1; it1++) \ 856 { \ 857 sig [it1] = new SC_IN (type) ** [x2]; \ 858 for (uint32_t it2=0; it2<x2; it2++) \ 859 { \ 860 sig [it1][it2] = new SC_IN (type) * [x3]; \ 861 for (uint32_t it3=0; it3<x3; it3++) \ 862 if (size > 0) \ 863 { \ 864 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \ 865 sig [it1][it2][it3] = new SC_IN (type) (str.c_str()); \ 866 } \ 867 } \ 868 } \ 869 } 870 871 #define ALLOC3_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2,x3) \ 872 { \ 873 sig = new SC_OUT (type) *** [x1]; \ 874 for (uint32_t it1=0; it1<x1; it1++) \ 875 { \ 876 sig [it1] = new SC_OUT (type) ** [x2]; \ 877 for (uint32_t it2=0; it2<x2; it2++) \ 878 { \ 879 sig [it1][it2] = new SC_OUT (type) * [x3]; \ 880 for (uint32_t it3=0; it3<x3; it3++) \ 881 if (size > 0) \ 882 { \ 883 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \ 884 sig [it1][it2][it3] = new SC_OUT(type) (str.c_str()); \ 885 } \ 886 } \ 887 } \ 888 } 889 890 #define DELETE3_FOREIGN_SIGNAL( sig, size,x1,x2,x3) \ 891 { \ 892 DELETE3_SIGNAL(sig,x1,x2,x3,size); \ 893 } 894 760 895 #define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3) \ 761 s c_signal<type> **** sig = new sc_signal<type> *** [x1];\896 sig = new sc_signal<type> *** [x1]; \ 762 897 { \ 763 898 std::string separator="_"; \ … … 807 942 for (uint32_t it3=0; it3<x3; it3++) \ 808 943 { \ 944 PRINT_SIGNAL_ADDRESS("",sig[it1][it2][it3]); \ 809 945 delete sig[it1][it2][it3]; \ 810 946 } \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h
r82 r113 72 72 public : Entity * _entity ; 73 73 public : Tinstance_t _instance ; 74 public : std::string _architecture; 74 75 } Tcomponent_t; 75 76 … … 102 103 #endif 103 104 ,Tinstance_t instance=INSTANCE_ALL 105 ,std::string architecture="" 104 106 ); 105 107 … … 116 118 117 119 private : Signal * signal_internal (Entity * entity_productor, 118 Signal * signal_productor); 120 Signal * signal_productor, 121 Entity * entity_consumer, 122 Signal * signal_consumer); 119 123 120 124 public : void port_map (std::string component_src , … … 125 129 public : bool test_map (bool recursive=true); 126 130 private : bool test_map (uint32_t depth, bool recursive); 131 132 public : void * get_sc_signal (std::string component, 133 std::string port ); 134 // public : void set_sc_signal (std::string component, 135 // std::string port , 136 // void * sc_signal); 127 137 128 138 // public : bool test_equi (bool recursive=true); … … 141 151 public : friend std::ostream& operator<< (std::ostream& output_stream, 142 152 morpheo::behavioural::Component & x); 153 154 155 #undef FUNCTION 156 #define FUNCTION "Component::set_sc_signal" 157 public : template <typename T> 158 void set_sc_signal (std::string component, 159 std::string port , 160 void * sc_signal) 161 { 162 log_begin(Behavioural,FUNCTION); 163 164 std::string name_entity = _entity->get_name(); 165 166 Entity * entity = find_entity(component); 167 168 if (entity == NULL) 169 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" is unknow.\n")); 170 171 Signal * signal = entity->find_signal (port); 172 173 if (signal == NULL) 174 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" have not the signal \""+port+"\".\n")); 175 176 signal->alloc<T>(sc_signal); 177 178 log_end(Behavioural,FUNCTION); 179 }; 143 180 }; 144 181 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h
r82 r113 58 58 public : std::string get_name (void); 59 59 public : std::string get_type (void); 60 public : Tusage_t get_usage (void); 60 61 61 62 #ifdef POSITION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r88 r113 91 91 92 92 #ifdef SYSTEMC 93 94 #undef FUNCTION 95 #define FUNCTION "Interface::set_signal_clk" 93 96 public : sc_in_clk * set_signal_clk (std::string name , 94 97 uint32_t size , 95 98 presence_port_t presence_port=CLOCK_VHDL_YES) 96 99 { 97 log_ printf(FUNC,Behavioural,"set_signal_clk","Begin");100 log_begin(Behavioural,FUNCTION); 98 101 99 102 if ((presence_port != CLOCK_VHDL_YES) and … … 101 104 throw ErrorMorpheo ("Signal \""+name+"\" is a clock, bad presence_port."); 102 105 106 LowerCase(name); 107 103 108 Signal * sig = set_signal (name, IN , size, presence_port); 104 109 sc_in_clk * port; 105 110 106 if (_usage & USE_SYSTEMC )111 if (_usage & USE_SYSTEMC_INTERFACE) 107 112 { 108 113 port = new sc_in_clk (sig->_name.c_str()); … … 114 119 } 115 120 116 log_printf(FUNC,Behavioural,"set_signal_clk","End"); 117 118 return port; 119 }; 120 121 log_end(Behavioural,FUNCTION); 122 123 return port; 124 }; 125 126 #undef FUNCTION 127 #define FUNCTION "Interface::set_signal_in" 121 128 public : template <typename T> 122 129 sc_in <T> * set_signal_in (std::string name , … … 124 131 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES) 125 132 { 126 log_ printf(FUNC,Behavioural,"set_signal_in","Begin");133 log_begin(Behavioural,FUNCTION); 127 134 128 135 if ((presence_port == CLOCK_VHDL_YES) or … … 130 137 throw ErrorMorpheo ("Signal \""+name+"\" is not a clock, bad presence_port."); 131 138 139 LowerCase(name); 140 132 141 Signal * sig = set_signal (name, IN , size, presence_port); 133 142 sc_in <T> * port; 134 143 135 if (_usage & USE_SYSTEMC )144 if (_usage & USE_SYSTEMC_INTERFACE) 136 145 { 137 146 port = new sc_in <T> (sig->_name.c_str()); … … 143 152 } 144 153 145 log_printf(FUNC,Behavioural,"set_signal_in","End"); 146 147 return port; 148 }; 149 154 log_end(Behavioural,FUNCTION); 155 156 return port; 157 }; 158 159 #undef FUNCTION 160 #define FUNCTION "Interface::set_signal_out" 150 161 public : template <typename T> 151 162 sc_out <T> * set_signal_out (std::string name , … … 153 164 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES) 154 165 { 155 log_printf(FUNC,Behavioural,"set_signal_out","Begin"); 166 log_begin(Behavioural,FUNCTION); 167 168 LowerCase(name); 156 169 157 170 if ((presence_port == CLOCK_VHDL_YES) or … … 162 175 sc_out <T> * port; 163 176 164 if (_usage & USE_SYSTEMC )177 if (_usage & USE_SYSTEMC_INTERFACE) 165 178 { 166 179 port = new sc_out <T> (sig->_name.c_str()); … … 172 185 } 173 186 174 log_printf(FUNC,Behavioural,"set_signal_out","End"); 175 176 return port; 177 }; 178 187 log_end(Behavioural,FUNCTION); 188 189 return port; 190 }; 191 192 #undef FUNCTION 193 #define FUNCTION "Interface::set_signal_internal" 179 194 public : template <typename T> 180 195 sc_signal <T> * set_signal_internal (std::string name, 181 196 uint32_t size) 182 197 { 183 log_printf(FUNC,Behavioural,"set_signal_internal","Begin"); 198 log_begin(Behavioural,FUNCTION); 199 200 LowerCase(name); 184 201 185 202 Signal * sig = set_signal (name, INTERNAL , size, PORT_VHDL_NO_TESTBENCH_NO); 186 203 sc_signal <T> * port; 187 204 188 if (_usage & USE_SYSTEMC )205 if (_usage & USE_SYSTEMC_INTERFACE) 189 206 { 190 207 port = new sc_signal <T> (sig->_name.c_str()); … … 196 213 } 197 214 198 log_ printf(FUNC,Behavioural,"set_signal_internal","End");215 log_end(Behavioural,FUNCTION); 199 216 200 217 return port; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Model.h
r112 r113 40 40 public : model_type_t get_type (std::string component); 41 41 public : debug_verbosity_t get_debug (std::string component); 42 public : void print (void); 42 43 }; 43 44 44 45 }; // end namespace behavioural 46 47 template<> inline std::string toString<morpheo::behavioural::model_type_t>(const morpheo::behavioural::model_type_t& x) 48 { 49 switch (x) 50 { 51 case morpheo::behavioural::MODEL_SYSTEMC : return "systemc" ; break; 52 case morpheo::behavioural::MODEL_VHDL : return "vhdl" ; break; 53 default : return ""; break; 54 } 55 }; 45 56 46 57 template<> inline morpheo::behavioural::model_type_t fromString<morpheo::behavioural::model_type_t>(const std::string& x) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
r88 r113 33 33 class Parameters 34 34 { 35 public : const std::string _type; 36 35 37 // -----[ fields ]---------------------------------------------------- 36 38 public : static const uint32_t _size_instruction = 32; … … 127 129 // -----[ methods ]--------------------------------------------------- 128 130 public : Parameters (void); 131 public : Parameters (std::string type); 129 132 public : virtual ~Parameters (); 130 133 … … 132 135 public : virtual std::string print (uint32_t depth) = 0; 133 136 public : virtual Parameters_test msg_error (void) = 0; 137 public : virtual std::string id (void) const {return "";} 134 138 135 139 // methods to copy depends parameters -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r88 r113 5 5 * $Id$ 6 6 * 7 * [ 7 * [ Description ] 8 8 * 9 9 */ … … 90 90 public : type_info_t get_type_info (void); 91 91 92 public : void * get_sc_signal (void); 93 92 94 public : bool presence_vhdl (void); 93 95 public : bool presence_testbench (void); … … 174 176 else 175 177 _type_info = UNKNOW; 176 178 177 179 log_printf(TRACE,Behavioural,FUNCTION, "Allocation of %s (%s, 0x%.8x)", _name.c_str(),toString(_type_info).c_str(), static_cast<uint32_t>(reinterpret_cast<uint64_t>(_sc_signal_map))); 178 180 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Usage.h
r88 r113 2 2 #define morpheo_behavioural_Usage_h 3 3 4 #include "Common/include/Environment.h" 4 5 #include <stdint.h> 5 6 … … 7 8 namespace behavioural { 8 9 9 typedef uint 8_t Tusage_t;10 typedef uint16_t Tusage_t; 10 11 11 # define USE_SYSTEMC 0x01 12 # define USE_VHDL 0x02 13 # define USE_VHDL_TESTBENCH 0x04 14 # define USE_VHDL_TESTBENCH_ASSERT 0x08 15 # define USE_POSITION 0x10 16 # define USE_STATISTICS 0x20 17 # define USE_INFORMATION 0x40 18 # define USE_HEADER 0x80 19 //#define USE_ 0x80 12 # define USE_SYSTEMC 0x003 13 # define USE_SYSTEMC_INTERFACE 0x001 14 # define USE_SYSTEMC_BODY 0x002 15 # define USE_VHDL 0x004 16 # define USE_VHDL_TESTBENCH 0x008 17 # define USE_VHDL_TESTBENCH_ASSERT 0x010 18 # define USE_POSITION 0x020 19 # define USE_STATISTICS 0x040 20 //#define USE_INFORMATION 0x080 21 # define USE_HEADER 0x100 22 # define USE_COSIMULATION 0x200 23 //#define USE_ 0x400 20 24 21 25 # define USE_NONE 0x00 22 //#define USE_ALL 0xff23 26 # define USE_ALL usage_all() 24 27 25 28 #ifdef MODELSIM_COSIMULATION 29 Tusage_t usage_cosimulation(Tusage_t usage); 30 #endif 26 31 Tusage_t usage_set (Tusage_t usage, Tusage_t flag); 27 32 Tusage_t usage_unset (Tusage_t usage, Tusage_t flag); 28 33 bool usage_is_set (Tusage_t usage, Tusage_t flag); 29 voidusage_environment (Tusage_t usage);34 Tusage_t usage_environment (Tusage_t usage); 30 35 Tusage_t usage_all (void); 31 36 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
r112 r113 10 10 #define MORPHEO_MAJOR_VERSION "0" 11 11 #define MORPHEO_MINOR_VERSION "2" 12 #define MORPHEO_REVISION "11 2"12 #define MORPHEO_REVISION "113" 13 13 #define MORPHEO_CODENAME "Castor" 14 14 15 #define MORPHEO_DATE_DAY "1 8"16 #define MORPHEO_DATE_MONTH "0 3"15 #define MORPHEO_DATE_DAY "14" 16 #define MORPHEO_DATE_MONTH "04" 17 17 #define MORPHEO_DATE_YEAR "2009" 18 18 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h
r98 r113 7 7 * $Id$ 8 8 * 9 * [ 9 * [ Description ] 10 10 * 11 11 */ … … 14 14 #include <iostream> 15 15 #include <list> 16 #include <map> 16 17 #include "Common/include/Environment.h" 17 18 #include "Behavioural/include/Direction.h" … … 23 24 namespace behavioural { 24 25 26 #define VHDL_EXTENSION ".vhdl" 27 28 typedef enum 29 { 30 VHDL_SEVERITY_NOTE , 31 VHDL_SEVERITY_WARNING, 32 VHDL_SEVERITY_ERROR , 33 VHDL_SEVERITY_FAILURE 34 } vhdl_severity_t; 35 25 36 std::string std_logic (uint32_t size); 26 37 std::string std_logic_conv (uint32_t size, std::string value); … … 37 48 class Vhdl 38 49 { 39 // -----[ fields ]---------------------------------------------------- 40 private : const std::string _name ; 41 42 private : std::list<std::string> _list_library_work ; 43 private : std::list<std::string> _list_signal ; 44 private : std::list<std::string> _list_type ; 45 private : std::list<std::string> _list_alias ; 46 private : std::list<std::string> _list_port ; 47 private : std::list<std::string> _list_body ; 48 49 // -----[ methods ]--------------------------------------------------- 50 public : Vhdl (std::string name); 50 typedef struct 51 { 52 std::list<std::string> _list_signal; 53 std::list<std::string> _list_type ; 54 std::list<std::string> _list_alias ; 55 std::list<std::string> _list_body ; 56 std::list<std::string> _list_debug ; 57 } vhdl_architecture_t; 58 59 // -----[ fields ]---------------------------------------------------- 60 private : const std::string _name; 61 private : const std::string _id; 62 63 private : std::list<std::string> _list_library; 64 // Entity 65 // private : std::string _port_clock; 66 private : std::list<std::string> _list_port; 67 // Architecture 68 public : const std::string _name_architecture_default; 69 private : std::string _name_architecture; 70 private : std::map<std::string,vhdl_architecture_t> _architecture; 71 72 // -----[ methods ]--------------------------------------------------- 73 public : Vhdl (std::string name, 74 std::string id=""); 51 75 public : ~Vhdl (); 52 76 … … 64 88 private : std::string get_model (uint32_t depth , 65 89 std::string filename , 66 std::string entity_name , 67 std::string architecture_name ); 90 std::string entity_name ); 68 91 private : std::string get_header (uint32_t depth , 69 92 std::string filename ); 70 93 private : std::string get_entity (uint32_t depth , 71 94 std::string name ); 95 private : void test_architecture (void); 96 private : std::string test_architecture (std::string name ); 97 public : std::string set_architecture (std::string name ); 72 98 private : std::string get_architecture (uint32_t depth , 73 std::string name ,74 99 std::string entity_name ); 100 private : std::string get_configuration (uint32_t depth , 101 std::string entity_name , 102 std::string configuration_name ); 75 103 private : std::string get_component (uint32_t depth , 76 104 std::string name ); … … 83 111 direction_t direction , 84 112 uint32_t size ); 113 // public : void set_port_clock (std::string name ); 85 114 private : std::string get_signal (uint32_t depth ); 86 115 public : void set_signal (std::string name , … … 136 165 public : void set_body_component (std::string name_instance , 137 166 std::string name_component , 167 std::string name_architecture , 168 std::string name_package , 138 169 std::list<std::string> list_port_map); 139 170 public : void set_body_component_port_map (std::list<std::string> & list_port_map, … … 147 178 std::string text ); 148 179 149 private : std::string get_library_ieee (uint32_t depth ); 150 private : std::string get_library_work (uint32_t depth ); 180 public : void set_debug (std::string condition , 181 std::string text , 182 vhdl_severity_t severity = VHDL_SEVERITY_NOTE); 183 private : std::string get_debug (uint32_t depth ); 184 185 private : std::string get_library (uint32_t depth ); 186 private : std::string get_library_default (uint32_t depth ); 187 private : void set_library_default (void ); 188 public : void set_library (std::string library_name , 189 std::string package_name , 190 std::string declarative_unit="all"); 151 191 public : void set_library_work (std::string package_name ); 152 192 … … 154 194 }; 155 195 196 std::string vhdl_get_id (std::string model_name); 197 156 198 }; // end namespace behavioural 199 200 template<> inline std::string toString<morpheo::behavioural::vhdl_severity_t>(const morpheo::behavioural::vhdl_severity_t& x) 201 { 202 switch (x) 203 { 204 case morpheo::behavioural::VHDL_SEVERITY_NOTE : return "note" ; break; 205 case morpheo::behavioural::VHDL_SEVERITY_WARNING : return "warning"; break; 206 case morpheo::behavioural::VHDL_SEVERITY_ERROR : return "error" ; break; 207 case morpheo::behavioural::VHDL_SEVERITY_FAILURE : return "failure"; break; 208 default : return ""; break; 209 } 210 }; 211 157 212 }; // end namespace morpheo 158 213 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp
r81 r113 15 15 { 16 16 log_printf(FUNC,Behavioural,"Component::Component","Begin"); 17 _entity = NULL; 17 18 _list_component = new std::list<Tcomponent_t *>; 18 19 log_printf(FUNC,Behavioural,"Component::Component","End"); … … 31 32 { 32 33 log_printf(FUNC,Behavioural,"Component::~Component","Begin"); 33 delete _entity; 34 if (_entity != NULL) 35 delete _entity; 36 while (not _list_component->empty()) 37 { 38 delete _list_component->front(); 39 _list_component->pop_front(); 40 } 34 41 delete _list_component; 35 42 log_printf(FUNC,Behavioural,"Component::~Component","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp
r88 r113 80 80 Signal * signal_productor; 81 81 Entity * entity_productor; 82 Signal * signal_consumer ; 83 Entity * entity_consumer ; 82 84 83 85 bool src_is_productor = (signal_src->get_direction() == OUT); … … 85 87 if (src_is_productor == true) 86 88 { 87 signal_productor = signal_src; 88 entity_productor = entity_src; 89 signal_productor = signal_src ; 90 entity_productor = entity_src ; 91 signal_consumer = signal_dest; 92 entity_consumer = entity_dest; 89 93 } 90 94 else … … 92 96 signal_productor = signal_dest; 93 97 entity_productor = entity_dest; 98 signal_consumer = signal_src ; 99 entity_consumer = entity_src ; 94 100 } 95 101 96 102 // Create internal signal 97 signal_dest= signal_internal (entity_productor, signal_productor); 103 signal_dest= signal_internal (entity_productor, 104 signal_productor, 105 entity_consumer , 106 signal_consumer ); 98 107 signal_dest->set_size_max(signal_src->get_size()); 99 108 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp
r82 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ … … 21 21 #endif 22 22 ,Tinstance_t instance 23 ,std::string architecture 23 24 ) 24 25 { … … 29 30 Tcomponent_t * entry = new Tcomponent_t; 30 31 31 entry->_component= component; 32 entry->_instance = instance; 33 entry->_entity = entity; 32 entry->_component = component; 33 entry->_instance = instance; 34 entry->_architecture = architecture; 35 entry->_entity = entity; 34 36 35 37 _list_component->push_back(entry); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp
r81 r113 13 13 #undef FUNCTION 14 14 #define FUNCTION "Component::set_entity" 15 Entity * Component::set_entity (std::string name16 ,std::string type15 Entity * Component::set_entity (std::string name 16 ,std::string type 17 17 #ifdef POSITION 18 ,schema_t 18 ,schema_t schema 19 19 #endif 20 20 ) 21 21 { 22 22 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 23 24 if (_entity != NULL) 25 throw ERRORMORPHEO(FUNCTION,_("Entity is already allocated.\n")); 23 26 24 27 Entity * entity = new Entity (name … … 29 32 ,_usage 30 33 ); 34 31 35 _entity = entity; 32 36 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_signal_internal.cpp
r81 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ … … 14 14 #define FUNCTION "Component::signal_internal" 15 15 Signal * Component::signal_internal (Entity * entity_productor, 16 Signal * signal_productor) 16 Signal * signal_productor, 17 Entity * entity_consumer, 18 Signal * signal_consumer) 17 19 { 18 20 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 21 22 bool productor_is_cosimulation = usage_is_set(entity_productor->get_usage(),USE_COSIMULATION); 23 bool consumer_is_cosimulation = usage_is_set(entity_consumer ->get_usage(),USE_COSIMULATION); 24 bool is_cosimulation = consumer_is_cosimulation or productor_is_cosimulation; 25 if (productor_is_cosimulation and consumer_is_cosimulation) 26 throw ERRORMORPHEO (FUNCTION,toString(_("Entity \"%s\" and Entity \"%s\" use both cosimulation. It's not supported.\n"),entity_productor->get_name().c_str(),entity_consumer->get_name().c_str())); 27 20 28 // create name of internal's signal 21 std::string str_entity = entity_productor->get_name(); 22 std::string str_signal = signal_productor->get_name(); 29 Entity * entity = (consumer_is_cosimulation)?entity_consumer:entity_productor; 30 Signal * signal = (consumer_is_cosimulation)?signal_consumer:signal_productor; 31 32 std::string str_entity = entity->get_name(); 33 std::string str_signal = signal->get_name(); 23 34 24 UpperCase (str_entity);25 UpperCase (str_signal);35 // UpperCase (str_entity); 36 // UpperCase (str_signal); 26 37 27 std::string name_internal = "internal_"+str_entity+"_"+str_signal;38 std::string name_internal = (is_cosimulation)?str_signal:("internal_"+str_entity+"_"+str_signal); 28 39 29 40 // test if internal's signal exist ... else, create … … 38 49 39 50 if (interface == NULL) 40 throw (ErrorMorpheo ("<Component::port_map> Component \""+_entity->get_name()+"\", doesn't have an interface \"\".")); 41 42 std::string signame = entity_productor->get_name()+"_"+signal_productor->get_name(); 43 51 throw ERRORMORPHEO (FUNCTION,toString(_("Component \"%s\", doesn't have an interface \"\".\n"),_entity->get_name().c_str())); 52 53 // std::string signame = entity->get_name()+"_"+signal->get_name(); 54 std::string signame = name_internal; 55 type_info_t type_info = signal->get_type_info(); 56 44 57 // Signal's creation 45 switch ( signal_productor->get_type_info())58 switch (type_info) 46 59 { 47 case BOOL : 48 { 49 interface->set_signal_internal<bool >(signame, signal_productor->get_size()); 50 break; 51 } 52 case UINT8_T : 53 { 54 interface->set_signal_internal<uint8_t >(signame, signal_productor->get_size()); 55 break; 56 } 57 case UINT16_T : 58 { 59 interface->set_signal_internal<uint16_t>(signame, signal_productor->get_size()); 60 break; 61 } 62 case UINT32_T : 63 { 64 interface->set_signal_internal<uint32_t>(signame, signal_productor->get_size()); 65 break; 66 } 67 case UINT64_T : 68 { 69 interface->set_signal_internal<uint64_t>(signame, signal_productor->get_size()); 70 break; 71 } 72 default : 73 throw (ErrorMorpheo ("Signal \""+name_internal+"\" : type unknow.")); 60 case BOOL : interface->set_signal_internal<bool >(signame, signal->get_size()); break; 61 case UINT8_T : interface->set_signal_internal<uint8_t >(signame, signal->get_size()); break; 62 case UINT16_T : interface->set_signal_internal<uint16_t>(signame, signal->get_size()); break; 63 case UINT32_T : interface->set_signal_internal<uint32_t>(signame, signal->get_size()); break; 64 case UINT64_T : interface->set_signal_internal<uint64_t>(signame, signal->get_size()); break; 65 default :throw (ErrorMorpheo ("Signal \""+name_internal+"\" : type unknow.")); 74 66 } 75 67 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp
r95 r113 92 92 while (i != list_component->end()) 93 93 { 94 Entity * entity = (*i)->_entity; 95 Tinstance_t instance = (*i)->_instance; 94 Entity * entity = (*i)->_entity; 95 Tinstance_t instance = (*i)->_instance; 96 std::string architecture = (*i)->_architecture; 97 std::string package = "work"; 96 98 97 99 if (instance & INSTANCE_LIBRARY) … … 176 178 } 177 179 } 178 vhdl->set_body_component ("instance_"+entity->get_name(),entity->get_name(),list_port_map); 180 vhdl->set_body_component ("instance_"+entity->get_name(), 181 entity->get_name(), 182 architecture, 183 package, 184 list_port_map); 179 185 180 186 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r112 r113 73 73 it != _list_signal->end(); 74 74 ++it) 75 delete (*it); 75 { 76 if ((_usage & USE_SYSTEMC) and 77 ((*it)->get_direction() == INTERNAL)) 78 delete (*it)->get_sc_signal(); 79 delete (*it); 80 } 76 81 77 82 delete _list_signal; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_assert.cpp
r94 r113 34 34 while (i != _list_cycle->end()) 35 35 { 36 vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK *****\" severity NOTE;");37 vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity NOTE;");36 vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK *****\" severity "+toString(VHDL_SEVERITY_NOTE)+";"); 37 vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity "+toString(VHDL_SEVERITY_NOTE)+";"); 38 38 j++; 39 39 ++i; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_cycle.cpp
r81 r113 9 9 #include "Behavioural/include/Interface_fifo.h" 10 10 #include "Behavioural/include/Entity.h" 11 #include "Common/include/Systemc.h" 11 12 12 13 namespace morpheo { … … 18 19 19 20 // note : if defined(VHDL_TESTBENCH) then defined(SYSTEMC) 20 _list_cycle->push_back(static_cast<uint32_t>(s c_simulation_time()));21 _list_cycle->push_back(static_cast<uint32_t>(simulation_cycle())); 21 22 22 23 log_printf(FUNC,Behavioural,"testbench_cycle","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_find_signal.cpp
r81 r113 15 15 { 16 16 log_printf(FUNC,Behavioural,"find_signal","Begin"); 17 18 LowerCase(name); 17 19 18 20 std::list<Signal*>::iterator i = _list_signal->begin(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
r81 r113 26 26 } 27 27 } 28 28 29 log_printf(FUNC,Behavioural,"set_port (Vhdl)","End"); 29 30 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
r112 r113 11 11 namespace behavioural { 12 12 13 #undef FUNCTION 14 #define FUNCTION "Interface::set_signal" 13 15 Signal * Interface::set_signal (std::string name , 14 16 direction_t direction, … … 16 18 presence_port_t presence_port) 17 19 { 18 log_ printf(FUNC,Behavioural,"set_signal","Begin");20 log_begin(Behavioural,FUNCTION); 19 21 20 22 std::string signame = signal_name(_name, name, direction); … … 24 26 _list_signal->push_back (sig); 25 27 26 log_ printf(FUNC,Behavioural,"set_signal","End");28 log_end(Behavioural,FUNCTION); 27 29 28 30 return sig; … … 36 38 void Interface::set_signal (Vhdl * & vhdl) 37 39 { 38 log_ printf(FUNC,Behavioural,FUNCTION,"Begin");40 log_begin(Behavioural,FUNCTION); 39 41 if (not _list_signal->empty()) 40 42 { … … 47 49 } 48 50 } 49 log_ printf(FUNC,Behavioural,FUNCTION,"End");51 log_end(Behavioural,FUNCTION); 50 52 }; 51 53 # endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp
r81 r113 17 17 log_printf(FUNC,Behavioural,"signal_name","Begin"); 18 18 19 std::string str_direction = toString(direction);19 std::string str_direction = (direction==INTERNAL)?"":toString(direction); 20 20 std::string str_interface = name_interface; 21 21 std::string str_signal = name_signal; 22 22 23 LowerCase(str_direction);24 UpperCase(str_interface);25 UpperCase(str_signal );23 // LowerCase(str_direction); 24 // LowerCase(str_interface); 25 // LowerCase(str_signal ); 26 26 27 std::string signame = str_direction; 27 std::string signame = ""; 28 bool need_underscore = false; 29 30 if (str_direction != "") 31 { 32 signame += str_direction; 33 need_underscore = true; 34 } 28 35 if (str_interface != "") 29 signame += "_"+str_interface; 30 if (str_signal != "") 31 signame += "_"+str_signal; 36 { 37 signame += ((need_underscore)?"_":"")+str_interface; 38 need_underscore = true; 39 } 40 if (str_signal != "") 41 { 42 signame += ((need_underscore)?"_":"")+str_signal; 43 // need_underscore = true; 44 } 32 45 33 46 log_printf(FUNC,Behavioural,"signal_name","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r112 r113 11 11 namespace behavioural { 12 12 13 Interfaces::Interfaces (std::string 13 Interfaces::Interfaces (std::string name, 14 14 Tusage_t usage): 15 15 _name (name), -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
r81 r113 27 27 ++i; 28 28 } 29 30 // Signal * clock = get_clock(); 31 // if (clock != NULL) 32 // vhdl->set_port_clock (clock->get_name()); 29 33 } 34 30 35 log_printf(FUNC,Behavioural,FUNCTION,"End"); 31 36 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp
r94 r113 66 66 vhdl->set_body(""); 67 67 vhdl->set_body("-- if the systemC simulate have multiple reset, we make the last"); 68 vhdl->set_body(reset_name+" <= '1' after 150 ns;");68 vhdl->set_body(reset_name+" <= '1' after "+toString(2.*VHDL_TIME_PERIOD)+" "+toString(VHDL_TIME_UNIT)+";"); 69 69 70 70 vhdl->set_body(""); … … 73 73 vhdl->set_body("------------------------------------------------------"); 74 74 vhdl->set_body(""); 75 vhdl->set_body(clock_name+" <= not "+clock_name+" after 50 ns;");75 vhdl->set_body(clock_name+" <= not "+clock_name+" after "+toString(VHDL_TIME_PERIOD/2.)+" "+toString(VHDL_TIME_UNIT)+";"); 76 76 vhdl->set_body(""); 77 77 vhdl->set_body("process ("+clock_name+")"); … … 89 89 #ifdef VHDL_TESTBENCH_ASSERT 90 90 for (uint32_t cpt=0; cpt<=cycle; cpt++) 91 vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cpt)+") report \"===== Test number "+toString(cpt)+" =====\" severity NOTE;");91 vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cpt)+") report \"===== Test number "+toString(cpt)+" =====\" severity "+toString(VHDL_SEVERITY_NOTE)+";"); 92 92 93 93 for (std::list<Interface_fifo*>::iterator it=_list_interface->begin(); … … 106 106 107 107 vhdl->set_body(""); 108 vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity FAILURE;");109 vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity FAILURE;");108 vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity "+toString(VHDL_SEVERITY_FAILURE)+";"); 109 vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity "+toString(VHDL_SEVERITY_FAILURE)+";"); 110 110 vhdl->set_body("\t\tend if;"); 111 111 vhdl->set_body("\tend if;"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_set_model.cpp
r112 r113 12 12 13 13 #undef FUNCTION 14 #define FUNCTION "Model:: get_type"14 #define FUNCTION "Model::set_model" 15 15 void Model::set_model (std::string component, model_type_t type, debug_verbosity_t debug) 16 16 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters.cpp
r81 r113 13 13 #undef FUNCTION 14 14 #define FUNCTION "Parameters::Parameters" 15 Parameters::Parameters (void) 15 Parameters::Parameters (void) : 16 _type ("") 17 { 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 log_printf(FUNC,Behavioural,FUNCTION,"End"); 20 }; 21 22 #undef FUNCTION 23 #define FUNCTION "Parameters::Parameters" 24 Parameters::Parameters (std::string type) : 25 _type (type) 16 26 { 17 27 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp
r88 r113 20 20 Parameters_test x = msg_error(); 21 21 22 std::cerr << x.print();22 msg("%s",x.print().c_str()); 23 23 24 24 if (x.have_error()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r81 r113 11 11 namespace behavioural { 12 12 13 Signal::Signal (std::string 13 Signal::Signal (std::string name , 14 14 direction_t direction , 15 15 uint32_t size , … … 20 20 { 21 21 log_printf(FUNC,Behavioural,"Signal","Begin"); 22 _size = size; 22 23 23 _is_allocate = false; 24 24 _is_map_as_component_src = false; … … 33 33 _list_value = new std::list<std::string>; 34 34 #endif 35 set_size(size); 35 36 36 37 if (_size == 0) 37 38 throw ERRORMORPHEO(FUNCTION,"Size of signal '"+_name+"' is nul"); 38 39 39 40 40 log_printf(FUNC,Behavioural,"Signal","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_size.cpp
r81 r113 7 7 8 8 #include "Behavioural/include/Signal.h" 9 9 #include "Common/include/Environment.h" 10 10 11 11 namespace morpheo { … … 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 uint32_t _return = _size; 20 21 #ifdef MODELSIM_COSIMULATION 22 switch (_type_info) 23 { 24 case BOOL : _return = 1; break; 25 case UINT8_T : _return = 8; break; 26 case UINT16_T : _return = 16; break; 27 case UINT32_T : _return = 32; break; 28 case UINT64_T : _return = 64; break; 29 default : break; 30 } 31 #endif 32 20 33 log_printf(FUNC,Behavioural,FUNCTION,"End"); 21 34 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp
r88 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_presence_testbench.cpp
r81 r113 13 13 14 14 #undef FUNCTION 15 #define FUNCTION "Signal::presence_ vhdl"16 bool Signal::presence_ vhdl(void)15 #define FUNCTION "Signal::presence_testbench" 16 bool Signal::presence_testbench (void) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_port.cpp
r81 r113 21 21 (_presence_port == CLOCK_VHDL_YES) or 22 22 (_presence_port == RESET_VHDL_YES)) 23 vhdl->set_port (_name,_direction, _size);23 vhdl->set_port (_name,_direction,get_size()); 24 24 25 25 log_printf(FUNC,Behavioural,"set_port (Vhdl)","End"); … … 38 38 // or (_presence_port == RESET_VHDL_NO ) 39 39 ) 40 vhdl->set_signal (_name , _size);40 vhdl->set_signal (_name ,get_size()); 41 41 42 42 if (_direction == OUT) 43 vhdl->set_signal (_name+"_test", _size);43 vhdl->set_signal (_name+"_test",get_size()); 44 44 45 45 log_printf(FUNC,Behavioural,"set_signal (Vhdl)","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_size.cpp
r81 r113 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 _size = size; 20 20 21 log_printf(FUNC,Behavioural,FUNCTION,"End"); 21 22 }; … … 27 28 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 28 29 if (size > _size) 29 _size = size;30 set_size(size); 30 31 log_printf(FUNC,Behavioural,FUNCTION,"End"); 31 32 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp
r81 r113 44 44 switch (_direction) 45 45 { 46 case IN : {str = toBase2 (value, _size); break;}47 case OUT : {str = toBase2 (value, _size); break;}46 case IN : {str = toBase2 (value,get_size()); break;} 47 case OUT : {str = toBase2 (value,get_size()); break;} 48 48 default : {break;} 49 49 } … … 56 56 switch (_direction) 57 57 { 58 case IN : {str = toBase2 (value, _size); break;}59 case OUT : {str = toBase2 (value, _size); break;}58 case IN : {str = toBase2 (value,get_size()); break;} 59 case OUT : {str = toBase2 (value,get_size()); break;} 60 60 default : {break;} 61 61 } … … 68 68 switch (_direction) 69 69 { 70 case IN : {str = toBase2 (value, _size); break;}71 case OUT : {str = toBase2 (value, _size); break;}70 case IN : {str = toBase2 (value,get_size()); break;} 71 case OUT : {str = toBase2 (value,get_size()); break;} 72 72 default : {break;} 73 73 } … … 80 80 switch (_direction) 81 81 { 82 case IN : {str = toBase2 (value, _size); break;}83 case OUT : {str = toBase2 (value, _size); break;}82 case IN : {str = toBase2 (value,get_size()); break;} 83 case OUT : {str = toBase2 (value,get_size()); break;} 84 84 default : {break;} 85 85 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench_body.cpp
r81 r113 25 25 { 26 26 std::string separator; 27 if ( _size== 1)27 if (get_size() == 1) 28 28 separator = "\'"; 29 29 else … … 48 48 } 49 49 50 if ( _size== 1)50 if (get_size() == 1) 51 51 vhdl->set_body ("\t'0' when others;"); 52 52 else -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp
r110 r113 8 8 9 9 #include "Behavioural/include/Simulation.h" 10 #include "Common/include/Systemc.h" 10 11 11 12 namespace morpheo { … … 14 15 bool simulation_test_end (void) 15 16 { 16 msg("##########[ cycle %d ]\n",static_cast<uint32_t>(s c_simulation_time()));17 msg("##########[ cycle %d ]\n",static_cast<uint32_t>(simulation_cycle())); 17 18 18 19 // Test if a stop condition is activate … … 26 27 27 28 if (_simulation_nb_cycle != 0) 28 end_cycle = (_simulation_nb_cycle <= s c_simulation_time());29 end_cycle = (_simulation_nb_cycle <= simulation_cycle()); 29 30 else 30 31 end_cycle = true; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp
r81 r113 1 1 #ifdef STATISTICS 2 2 #include "Behavioural/include/Stat.h" 3 #include "Common/include/Systemc.h" 3 4 4 5 namespace morpheo { … … 6 7 void Stat::end_cycle (void) 7 8 { 8 cycle_t _cycle_sum = s c_simulation_time();9 cycle_t _cycle_sum = simulation_cycle(); 9 10 10 11 if (_cycle_sum >= _nb_cycle_before_begin) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp
r88 r113 3 3 #include "Behavioural/include/Version.h" 4 4 #include "Common/include/Environment.h" 5 #include "Common/include/Systemc.h" 5 6 6 7 namespace morpheo { … … 13 14 std::string body = print(1); 14 15 15 cycle_t _cycle_sum = s c_simulation_time();16 cycle_t _cycle_sum = simulation_cycle(); 16 17 17 18 morpheo::behavioural::XML * xml = new morpheo::behavioural::XML (_name_instance); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp
r88 r113 1 1 #ifdef STATISTICS 2 2 #include "Behavioural/include/Stat.h" 3 #include "Common/include/Systemc.h" 3 4 4 5 namespace morpheo { … … 12 13 end_simulation(); 13 14 14 cycle_t _cycle_sum = s c_simulation_time();15 cycle_t _cycle_sum = simulation_cycle(); 15 16 16 17 morpheo::behavioural::XML xml (_name_instance); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Usage.cpp
r88 r113 5 5 namespace morpheo { 6 6 namespace behavioural { 7 8 #ifdef MODELSIM_COSIMULATION 9 Tusage_t usage_cosimulation(Tusage_t usage) 10 { 11 Tusage_t _return = usage; 12 // _return = usage_unset(_return,USE_SYSTEMC ); 13 _return = usage_unset(_return,USE_SYSTEMC_INTERFACE ); 14 _return = usage_unset(_return,USE_SYSTEMC_BODY ); 15 _return = usage_unset(_return,USE_VHDL ); 16 _return = usage_unset(_return,USE_VHDL_TESTBENCH ); 17 _return = usage_unset(_return,USE_VHDL_TESTBENCH_ASSERT); 18 // _return = usage_unset(_return,USE_POSITION ); 19 _return = usage_unset(_return,USE_STATISTICS ); 20 // _return = usage_unset(_return,USE_INFORMATION ); 21 // _return = usage_unset(_return,USE_HEADER ); 22 _return = usage_set (_return,USE_COSIMULATION ); 23 24 return _return; 25 } 26 #endif 7 27 8 28 Tusage_t usage_set (Tusage_t usage, Tusage_t flag) … … 22 42 #undef FUNCTION 23 43 #define FUNCTION "usage_environment" 24 voidusage_environment (Tusage_t usage)44 Tusage_t usage_environment (Tusage_t usage) 25 45 { 26 46 #ifndef SYSTEMC 27 if (usage_is_set(usage,USE_SYSTEMC)) 28 throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC\", but the macro's compiler \"SYSTEMC\" is unset.\n")); 47 if (usage_is_set(usage,USE_SYSTEMC_INTERFACE)) 48 throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC_INTERFACE\", but the macro's compiler \"SYSTEMC\" is unset.\n")); 49 if (usage_is_set(usage,USE_SYSTEMC_BODY)) 50 throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC_BODY\", but the macro's compiler \"SYSTEMC\" is unset.\n")); 29 51 #endif 30 52 #ifndef VHDL … … 48 70 throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_STATISTICS\", but the macro's compiler \"STATISTICS\" is unset.\n")); 49 71 #endif 50 #ifndef INFORMATION51 if (usage_is_set(usage,USE_INFORMATION))52 throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_INFORMATION\", but the macro's compiler \"INFORMATION\" is unset.\n"));53 #endif72 // #ifndef INFORMATION 73 // if (usage_is_set(usage,USE_INFORMATION)) 74 // throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_INFORMATION\", but the macro's compiler \"INFORMATION\" is unset.\n")); 75 // #endif 54 76 55 77 #ifndef DEBUG 56 78 #endif 57 79 58 if (usage_is_set(usage,USE_STATISTICS) and not usage_is_set(usage,USE_SYSTEMC ))59 throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the statistics, you must set flag USE_SYSTEMC \n"));80 if (usage_is_set(usage,USE_STATISTICS) and not usage_is_set(usage,USE_SYSTEMC_BODY)) 81 throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the statistics, you must set flag USE_SYSTEMC_BODY\n")); 60 82 61 if (usage_is_set(usage,USE_INFORMATION) and not usage_is_set(usage,USE_STATISTICS))62 throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the information, you must set flag USE_STATISTICS\n"));83 // if (usage_is_set(usage,USE_INFORMATION) and not usage_is_set(usage,USE_STATISTICS)) 84 // throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the information, you must set flag USE_STATISTICS\n")); 63 85 64 if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_SYSTEMC ))65 throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the vhdl's test bench, you must set flag USE_SYSTEMC \n"));86 if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_SYSTEMC_BODY)) 87 throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the vhdl's test bench, you must set flag USE_SYSTEMC_BODY\n")); 66 88 67 89 if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_VHDL)) … … 70 92 if (usage_is_set(usage,USE_VHDL_TESTBENCH_ASSERT) and not usage_is_set(usage,USE_VHDL_TESTBENCH)) 71 93 throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use an assert in vhdl's test bench, you must set flag USE_VHDL_TESTBENCH\n")); 94 95 return usage; 72 96 } 73 97 … … 77 101 78 102 #ifdef SYSTEMC 79 usage = usage_set(usage,USE_SYSTEMC); 103 usage = usage_set(usage,USE_SYSTEMC_INTERFACE); 104 usage = usage_set(usage,USE_SYSTEMC_BODY); 80 105 #endif 81 106 #ifdef VHDL … … 94 119 usage = usage_set(usage,USE_STATISTICS); 95 120 #endif 96 #ifdef INFORMATION97 usage = usage_set(usage,USE_INFORMATION);98 #endif121 // #ifdef INFORMATION 122 // usage = usage_set(usage,USE_INFORMATION); 123 // #endif 99 124 usage = usage_set(usage,USE_HEADER); 100 125 #ifdef DEBUG -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp
r81 r113 15 15 #undef FUNCTION 16 16 #define FUNCTION "Vhdl::Vhdl" 17 Vhdl::Vhdl (std::string name): 18 _name (name) 17 Vhdl::Vhdl (std::string name, 18 std::string id): 19 _name (name), 20 _id (id), 21 _name_architecture_default ("morpheo_behavioural") 19 22 { 20 23 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 24 25 _name_architecture = _name_architecture_default; 26 // _port_clock = ""; 27 28 set_library_default(); 29 21 30 log_printf(FUNC,Behavioural,FUNCTION,"End"); 22 31 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp
r98 r113 22 22 directory(); 23 23 24 std::string filename = MORPHEO_VHDL + "/" + _name + ".vhdl";24 std::string filename = MORPHEO_VHDL + "/" + _name + VHDL_EXTENSION; 25 25 26 26 msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str()); … … 30 30 file.open(filename.c_str(),std::ios::out | std::ios::trunc); 31 31 32 file << get_model (0,filename,_name ,"behavioural");32 file << get_model (0,filename,_name); 33 33 file.close(); 34 34 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp
r88 r113 4 4 * $Id$ 5 5 * 6 * [ 6 * [ Description ] 7 7 * 8 8 */ … … 23 23 24 24 std::string name = _name + "_Pack"; 25 std::string filename = MORPHEO_VHDL + "/" + name + ".vhdl";25 std::string filename = MORPHEO_VHDL + "/" + name + VHDL_EXTENSION; 26 26 27 27 msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str()); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp
r81 r113 20 20 { 21 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 22 std::string _return = get_list(_list_alias, depth, ";", true); 22 23 test_architecture(); 24 25 std::string _return = get_list(_architecture[_name_architecture]._list_alias, depth, ";", true); 23 26 log_printf(FUNC,Behavioural,FUNCTION,"End"); 24 27 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp
r94 r113 11 11 #include "Common/include/Tabulation.h" 12 12 13 #include <sstream>14 15 13 namespace morpheo { 16 14 namespace behavioural { … … 18 16 #undef FUNCTION 19 17 #define FUNCTION "Vhdl::get_architecture" 20 std::string Vhdl::get_architecture (uint32_t depth , 21 std::string name , 22 std::string entity_name) 18 std::string Vhdl::get_architecture (uint32_t depth , 19 std::string entity_name) 23 20 { 24 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 25 22 26 std::string tab = morpheo::tab(depth);27 23 std::ostringstream text; 24 std::string name_architecture_old = _name_architecture; 25 std::string tab=morpheo::tab(depth); 28 26 29 text << tab << "architecture " << name << " of " << entity_name << " is" << std::endl 30 << tab << get_type (depth+1) << std::endl 31 << tab << get_signal (depth+1) << std::endl 32 << tab << get_alias (depth+1) << std::endl 33 << tab << "begin" << std::endl 34 << tab << get_body (depth+1) << std::endl 35 << tab << "end " << name << ";" << std::endl; 27 for (std::map<std::string,vhdl_architecture_t>::iterator it = _architecture.begin(); 28 it!=_architecture.end(); 29 ++it) 30 { 31 std::string name = it->first; 32 set_architecture(name); 33 34 text << tab << "architecture " << name << " of " << entity_name << " is" << std::endl 35 << tab << get_type (depth+1) << std::endl 36 << tab << get_signal (depth+1) << std::endl 37 << tab << get_alias (depth+1) << std::endl 38 << tab << "begin" << std::endl 39 << tab << get_body (depth+1) << std::endl 40 << tab << "end " << name << ";" << std::endl; 41 } 42 43 set_architecture (name_architecture_old); 36 44 37 45 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp
r81 r113 20 20 { 21 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 22 std::string _return = get_list(_list_body,depth,"",true); 22 23 test_architecture(); 24 std::string _return = get_list(_architecture[_name_architecture]._list_body,depth,"",true); 25 26 _return = _return + get_debug(depth); 27 23 28 log_printf(FUNC,Behavioural,FUNCTION,"End"); 24 29 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp
r98 r113 12 12 #include <time.h> 13 13 #include <sstream> 14 #include <fstream> 14 15 15 16 namespace morpheo { … … 21 22 std::string filename) 22 23 { 23 log_ printf(FUNC,Behavioural,FUNCTION,"Begin");24 log_begin(Behavioural,FUNCTION); 24 25 25 26 std::string text; … … 32 33 text += "-- "+toString(_("Date : ")) + ctime (¤t_time ); 33 34 text += "-- "+toString(_("Version : ")) + MORPHEO_HEADER +"\n"; 35 text += "-- "+toString(_("Id : ")) + _id +" \n"; 34 36 text += "-- "+toString(_("Comment : ")) + _("it's a autogenerated file, don't modify") +"\n"; 35 37 text += "-------------------------------------------------------------------------------\n"; 36 38 37 log_ printf(FUNC,Behavioural,FUNCTION,"End");39 log_end(Behavioural,FUNCTION); 38 40 39 41 return text; 42 }; 43 44 #undef FUNCTION 45 #define FUNCTION "vhdl_get_id" 46 std::string vhdl_get_id(std::string model_name) 47 { 48 log_begin(Behavioural,FUNCTION); 49 50 std::string id=""; 51 52 directory(); 53 54 std::string filename = MORPHEO_VHDL + "/" + model_name + VHDL_EXTENSION; 55 std::ifstream file; 56 57 file.open(filename.c_str(),std::ios::in); 58 59 // open file 60 if (!file) 61 { 62 log_printf(INFO,Behavioural,FUNCTION,_("Can't open file : \"%s\""),filename.c_str()); 63 } 64 else 65 { 66 // get line with Id 67 do 68 { 69 std::getline(file,id,'\n'); // comment 70 } while ((id.find("Id :") == std::string::npos) and 71 (not file.eof())); 72 73 if (file.eof()) 74 log_printf(INFO,Behavioural,FUNCTION,_("\"Id\" not find in file : \"%s\""),filename.c_str()); 75 else 76 { 77 // get id 78 id = id.substr(id.find_first_of(':',0)+1,std::string::npos); 79 80 // Erase all ' ' 81 size_t i=id.find_first_of(' ',0); 82 while (i!=std::string::npos) 83 { 84 id.erase(i,i+1); 85 i=id.find_first_of(' ',i); 86 } 87 } 88 } 89 90 log_end(Behavioural,FUNCTION); 91 92 return id; 40 93 }; 41 94 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library.cpp
r111 r113 16 16 17 17 #undef FUNCTION 18 #define FUNCTION "Vhdl::get_library _work"19 std::string Vhdl::get_library _work(uint32_t depth)18 #define FUNCTION "Vhdl::get_library" 19 std::string Vhdl::get_library (uint32_t depth) 20 20 { 21 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 22 22 23 std::list<std::string>::iterator i = _list_library _work.begin();23 std::list<std::string>::iterator i = _list_library.begin(); 24 24 std::string tab = morpheo::tab(depth); 25 25 std::ostringstream text; 26 26 27 if (i != _list_library_work.end()) 28 text << tab << std::endl 29 << tab << "library work;" << std::endl 30 << get_list(_list_library_work,depth,";",true); 27 if (i != _list_library.end()) 28 text << get_list(_list_library,depth,";",true); 31 29 32 30 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp
r81 r113 17 17 #undef FUNCTION 18 18 #define FUNCTION "Vhdl::get_list" 19 std::string Vhdl::get_list (std::list<std::string> liste 20 uint32_t depth,21 std::string separator,22 bool last_separator)19 std::string Vhdl::get_list (std::list<std::string> liste , 20 uint32_t depth , 21 std::string separator , 22 bool last_separator) 23 23 { 24 24 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp
r94 r113 15 15 namespace behavioural { 16 16 17 std::string Vhdl::get_model(uint32_t depth , 18 std::string filename , 19 std::string entity_name , 20 std::string architecture_name) 17 std::string Vhdl::get_model(uint32_t depth , 18 std::string filename , 19 std::string entity_name ) 21 20 { 22 21 log_printf(FUNC,Behavioural,"get_model","Begin"); … … 25 24 std::ostringstream text; 26 25 27 text << tab << get_header (depth,filename) << std::endl 28 << tab << get_library_ieee (depth) << std::endl 29 << tab << get_library_work (depth) << std::endl 30 << tab << get_entity (depth,entity_name) << std::endl 31 << tab << get_architecture (depth,architecture_name,entity_name) << std::endl; 26 std::string configuration_name = "configuration_"+entity_name; 27 28 text << tab << get_header (depth,filename) << std::endl 29 << tab << get_library (depth) << std::endl 30 << tab << get_entity (depth,entity_name) << std::endl 31 << tab << get_architecture (depth,entity_name) << std::endl 32 << tab << get_configuration(depth,entity_name,configuration_name) << std::endl 33 ; 32 34 33 35 log_printf(FUNC,Behavioural,"get_model","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp
r94 r113 27 27 std::ostringstream text; 28 28 29 text << tab << get_header (depth,filename)<< std::endl30 << tab << get_library_ieee (depth)<< std::endl31 << tab << "package " << package_name << " is" 32 << tab << get_component (depth+1,entity_name) 33 << tab << "end " << package_name << ";" 29 text << tab << get_header (depth,filename) << std::endl 30 << tab << get_library_default (depth) << std::endl 31 << tab << "package " << package_name << " is" << std::endl 32 << tab << get_component (depth+1,entity_name) << std::endl 33 << tab << "end " << package_name << ";" << std::endl; 34 34 35 35 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp
r81 r113 20 20 { 21 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 22 std::string _return = get_list (_list_signal, depth, ";", true); 22 23 test_architecture(); 24 25 std::string _return = get_list (_architecture[_name_architecture]._list_signal, depth, ";", true); 26 23 27 log_printf(FUNC,Behavioural,FUNCTION,"End"); 24 28 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp
r81 r113 20 20 { 21 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 22 std::string _return = get_list (_list_type, depth, ";", true); 22 23 test_architecture(); 24 std::string _return = get_list (_architecture[_name_architecture]._list_type, depth, ";", true); 25 23 26 log_printf(FUNC,Behavioural,FUNCTION,"End"); 24 27 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp
r81 r113 23 23 { 24 24 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 25 set_list(_list_alias, "alias "+ name1+"\t: "+type1+"\tis "+name2+"\t"+range2); 25 26 test_architecture(); 27 28 set_list(_architecture[_name_architecture]._list_alias, "alias "+ name1+"\t: "+type1+"\tis "+name2+"\t"+range2); 29 26 30 log_printf(FUNC,Behavioural,FUNCTION,"End"); 27 31 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp
r94 r113 30 30 { 31 31 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 32 set_list(_list_body, morpheo::tab(depth)+text); 32 33 test_architecture(); 34 35 set_list(_architecture[_name_architecture]._list_body, morpheo::tab(depth)+text); 33 36 log_printf(FUNC,Behavioural,FUNCTION,"End"); 34 37 }; … … 40 43 { 41 44 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 45 46 test_architecture(); 42 47 43 48 std::string tab=morpheo::tab(depth); 44 49 45 for (std::list<std::string>::iterator it=vhdl->_ list_body.begin();46 it!=vhdl->_ list_body.end();50 for (std::list<std::string>::iterator it=vhdl->_architecture[_name_architecture]._list_body.begin(); 51 it!=vhdl->_architecture[_name_architecture]._list_body.end(); 47 52 ++it) 48 set_list(_ list_body,tab+*it);53 set_list(_architecture[_name_architecture]._list_body,tab+*it); 49 54 50 55 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp
r81 r113 17 17 #undef FUNCTION 18 18 #define FUNCTION "Vhdl::set_body_component" 19 void Vhdl::set_body_component (std::string name_instance , 20 std::string name_component , 21 std::list<std::string> list_port_map ) 19 void Vhdl::set_body_component (std::string name_instance , 20 std::string name_component , 21 std::string name_architecture, 22 std::string name_package , 23 std::list<std::string> list_port_map ) 22 24 { 23 25 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 24 26 25 set_body(name_instance + " : " + name_component); 27 name_architecture = test_architecture(name_architecture); 28 29 set_body(name_instance + " : entity " + name_package + "." + name_component + " (" + name_architecture + ")"); 30 // set_body(name_instance + " : " + name_component); 26 31 set_body("port map ("); 27 set_list(_ list_body, get_list(list_port_map, 1, ",", false));32 set_list(_architecture[name_architecture]._list_body, get_list(list_port_map, 1, ",", false)); 28 33 set_body(");"); 29 34 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp
r95 r113 22 22 { 23 23 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 24 set_list(_list_type, "constant "+ name+"\t: "+type+"\t:= "+init); 24 25 test_architecture(); 26 27 set_list(_architecture[_name_architecture]._list_type, "constant "+ name+"\t: "+type+"\t:= "+init); 28 25 29 log_printf(FUNC,Behavioural,FUNCTION,"End"); 26 30 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_default.cpp
r111 r113 4 4 * $Id$ 5 5 * 6 * [ 6 * [ Description ] 7 7 * 8 8 */ … … 17 17 18 18 #undef FUNCTION 19 #define FUNCTION "Vhdl:: get_library_ieee"20 std::string Vhdl::get_library_ieee (uint32_t depth)19 #define FUNCTION "Vhdl::set_library_default" 20 void Vhdl::set_library_default (void) 21 21 { 22 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 23 24 std::string tab = morpheo::tab(depth); 25 std::ostringstream text; 26 27 text << tab << std::endl 28 << tab << "library ieee;" << std::endl 29 << tab << " use ieee.numeric_bit.all; " << std::endl 30 << tab << " use ieee.numeric_std.all; " << std::endl 31 << tab << " use ieee.std_logic_1164.all; " << std::endl 32 << tab << " use ieee.std_logic_arith.all; " << std::endl 33 << tab << " use ieee.std_logic_misc.all; " << std::endl 34 << tab << "--use ieee.std_logic_signed.all; " << std::endl 35 << tab << " use ieee.std_logic_unsigned.all;" << std::endl 36 << tab << "--use ieee.std_logic_textio.all; " << std::endl; 22 log_begin(Behavioural,FUNCTION); 23 24 set_library("ieee","numeric_bit" ,"all"); 25 set_library("ieee","numeric_std" ,"all"); 26 set_library("ieee","std_logic_1164" ,"all"); 27 set_library("ieee","std_logic_arith" ,"all"); 28 set_library("ieee","std_logic_misc" ,"all"); 29 // set_library("ieee","std_logic_signed" ,"all"); 30 set_library("ieee","std_logic_unsigned","all"); 31 // set_library("ieee","std_logic_textio" ,"all"); 37 32 38 log_printf(FUNC,Behavioural,FUNCTION,"End"); 39 40 return text.str(); 33 log_end(Behavioural,FUNCTION); 41 34 }; 42 35 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp
r81 r113 19 19 void Vhdl::set_library_work (std::string package_name) 20 20 { 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 22 set_list(_list_library_work, "use work."+ package_name + ".all"); 23 log_printf(FUNC,Behavioural,FUNCTION,"End"); 21 log_begin(Behavioural,FUNCTION); 22 23 set_library("work",package_name,"all"); 24 25 log_end(Behavioural,FUNCTION); 24 26 }; 25 27 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp
r81 r113 34 34 log_printf(FUNC,Behavioural,FUNCTION,"End"); 35 35 }; 36 37 // #undef FUNCTION 38 // #define FUNCTION "Vhdl::set_port_clock" 39 // void Vhdl::set_port_clock (std::string name) 40 // { 41 // log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 42 43 // _port_clock = name; 44 45 // log_printf(FUNC,Behavioural,FUNCTION,"End"); 46 // }; 36 47 37 48 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp
r95 r113 22 22 { 23 23 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 24 set_list(_list_signal, "signal "+ name + "\t: " + type); 24 25 test_architecture(); 26 27 set_list(_architecture[_name_architecture]._list_signal, "signal "+ name + "\t: " + type); 28 25 29 log_printf(FUNC,Behavioural,FUNCTION,"End"); 26 30 }; … … 39 43 { 40 44 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 41 _list_signal.push_back ("signal "+ name+"\t: "+type+"\t:= "+init); 45 46 test_architecture(); 47 48 _architecture[_name_architecture]._list_signal.push_back ("signal "+ name+"\t: "+type+"\t:= "+init); 49 42 50 log_printf(FUNC,Behavioural,FUNCTION,"End"); 43 51 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp
r81 r113 21 21 { 22 22 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 23 set_list(_list_type, "type "+ name + "\tis " + type); 23 24 test_architecture(); 25 26 set_list(_architecture[_name_architecture]._list_type, "type "+ name + "\tis " + type); 27 24 28 log_printf(FUNC,Behavioural,FUNCTION,"End"); 25 29 }; -
trunk/IPs/systemC/processor/Morpheo/Common/Makefile.defs
r81 r113 5 5 # 6 6 7 ENTITY = Common 8 7 9 #-----[ Directory ]---------------------------------------- 8 10 DIR_COMPONENT_MORPHEO = .. -
trunk/IPs/systemC/processor/Morpheo/Common/Makefile.deps
r81 r113 16 16 #-----[ Library ]------------------------------------------ 17 17 18 Common_SOURCES = $(Common_DIR)/src/*.cpp 19 18 20 Common_LIBRARY = -lCommon 19 21 -
trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h
r88 r113 42 42 }; 43 43 44 template <typename T> 45 T gen_mask_not (uint32_t size) 46 { 47 return gen_mask_not<T>(size-1,0); 48 }; 49 44 50 //............................................................................ 45 51 // mask, mask_not ............................................................ -
trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
r112 r113 24 24 */ 25 25 26 #include "Common/include/Systemc.h" 26 27 #include "Common/include/Message.h" 27 28 #include "Common/include/FromString.h" … … 64 65 #define debug_test_simulation_time \ 65 66 (not debug_cycle_test or \ 66 ( (s c_simulation_time() >= debug_cycle_start) and \67 ((s c_simulation_time() <= debug_cycle_stop) or \67 ( (simulation_cycle() >= debug_cycle_start) and \ 68 ((simulation_cycle() <= debug_cycle_stop) or \ 68 69 (debug_cycle_stop == -1)))) 69 70 #else … … 149 150 do \ 150 151 { \ 151 log_printf(TRACE,component,func,_("[%d] %s.%s"),static_cast<uint32_t>(s c_simulation_time()),name,func); \152 log_printf(TRACE,component,func,_("[%d] %s.%s"),static_cast<uint32_t>(simulation_cycle()),name,func); \ 152 153 } while(0) 153 154 -
trunk/IPs/systemC/processor/Morpheo/Common/include/Environment.h
r88 r113 14 14 15 15 #if (defined(STATISTICS) and not defined(SYSTEMC)) 16 # 16 # error "To have the statistics, you must set flags SYSTEMC" 17 17 #endif 18 18 19 19 #if (defined(INFORMATION) and not defined(STATISTICS)) 20 # 20 # error "To have the information, you must set flags STATISTICS" 21 21 #endif 22 22 23 23 #if (defined(VHDL_TESTBENCH) and not defined(SYSTEMC)) 24 # 24 # error "To have the vhdl's test bench, you must set flags SYSTEMC" 25 25 #endif 26 26 27 27 #if (defined(VHDL_TESTBENCH) and not defined(VHDL)) 28 # 28 # error "To have the vhdl's test bench, you must set flags VHDL" 29 29 #endif 30 30 31 31 #if (defined(VHDL_TESTBENCH_ASSERT) and not defined(VHDL_TESTBENCH)) 32 # 32 # error "To have an assert in vhdl's test bench, you must set flags VHDL_TESTBENCH" 33 33 #endif 34 34 35 35 #if (defined(VHDL_TESTBENCH) and defined(SYSTEMC)) 36 # 36 # define SYSTEMC_VHDL_COMPATIBILITY 37 37 #endif 38 38 39 39 #if (defined(DEBUG)) 40 # define DEBUG_TEST 40 # define DEBUG_TEST 41 #endif 42 43 #if defined(MTI_SYSTEMC) and defined(SYSTEMC) and defined(VHDL) 44 # define MODELSIM_COSIMULATION 41 45 #endif 42 46 -
trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h
r97 r113 33 33 # define MSG_INFORMATION _("[1;32m[INFORMATION][0m") 34 34 # define MSG_BREAKPOINT _("[1;38m[ BREAK ][0m") 35 # define MSG_VHDL _("[1;34m[ VHDL ][0m") 35 36 #else 36 37 # define MSG_DEBUG _("[ DEBUG ]") … … 39 40 # define MSG_INFORMATION _("[INFORMATION]") 40 41 # define MSG_BREAKPOINT _("[ BREAK ]") 42 # define MSG_VHDL _("[ VHDL ]") 41 43 #endif 42 44 … … 84 86 85 87 #define msg(arg...) fmsg(stdout,arg) 88 #define err(arg...) fmsgError(stderr,arg) 89 86 90 #define msgDebug(arg...) fmsgDebug(stdout,arg) 87 91 #define msgError(arg...) fmsgError(stdout,arg) 88 92 #define msgWarning(arg...) fmsgWarning(stdout,arg) 89 93 #define msgInformation(arg...) fmsgInformation(stdout,arg) 90 #define err(arg...) fmsgError(stderr,arg)91 94 92 95 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
r88 r113 16 16 #include "Common/include/ErrorMorpheo.h" 17 17 #include "Common/include/ToString.h" 18 18 #include "Common/include/Systemc.h" 19 19 namespace morpheo { 20 20 … … 26 26 inline void test_ko_error (void) 27 27 { 28 std::string msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\"";28 std::string msg = morpheo::toString(_("Test ko : error in test \"%d\""),num_test); 29 29 throw (morpheo::ErrorMorpheo (msg)); 30 30 } … … 33 33 inline void test_ko (char * file, uint32_t line, T exp1, T exp2) 34 34 { 35 fflush (stdout); 36 fflush (stderr); 37 38 std::cerr << "[" << num_test << "] : " << STR_KO 39 << "\tline " << line << std::endl 40 << " * Localisation" << std::endl 41 << " - File : " << file << std::endl 42 << " - Line : " << line << std::endl 43 << " * Expression is different" << std::endl 44 << " - exp1 : "+morpheo::toString(exp1) << std::endl 45 << " - exp2 : "+morpheo::toString(exp2) << std::endl; 35 msgError(_("[%d] : %s\n"),num_test,STR_KO); 36 msgError(_(" * Localisation\n")); 37 msgError(_(" - File : %s\n"),file); 38 msgError(_(" - Line : %d\n"),line); 39 msgError(_(" * Expression is different\n")); 40 msgError(_(" - exp1 : %s\n"),morpheo::toString(exp1).c_str()); 41 msgError(_(" - exp2 : %s\n"),morpheo::toString(exp2).c_str()); 46 42 47 43 test_ko_error (); … … 50 46 inline void test_ko (char * file, uint32_t line) 51 47 { 52 fflush (stdout); 53 fflush (stderr); 54 55 std::cerr << "[" << num_test << "] : " << STR_KO 56 << "\tline " << line << std::endl 57 << " * Localisation" << std::endl 58 << " - File : " << file << std::endl 59 << " - Line : " << line << std::endl; 48 msgError(_("[%d] : %s\n"),num_test,STR_KO); 49 msgError(_(" * Localisation\n")); 50 msgError(_(" - File : %s\n"),file); 51 msgError(_(" - Line : %d\n"),line); 60 52 61 53 test_ko_error (); … … 64 56 inline void test_ok () 65 57 { 66 fflush (stdout); 67 fflush (stderr); 68 69 msg (_("[%d] : %s\n"), num_test,STR_OK); 58 msgInformation (_("[%d] : %s\n"), num_test,STR_OK); 70 59 71 60 num_test ++; … … 74 63 inline void test_ok (char * file, uint32_t line) 75 64 { 76 fflush (stdout); 77 fflush (stderr); 78 79 msg (_("[%d] : %s\n"), num_test,STR_OK); 80 msg (_("\tline %d\n"), line); 65 msgInformation (_("[%d] : %s (line %d)\n"), num_test,STR_OK,line); 66 msgInformation (_(" - Line : %d\n"), line); 81 67 82 68 num_test ++; … … 86 72 inline void test_ok (char * file, uint32_t line, T exp) 87 73 { 88 fflush (stdout); 89 fflush (stderr); 90 91 msg (_("[%d] : %s\n"), num_test, STR_OK); 92 msg (_("\tline %d\n"), line); 93 msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str()); 74 msgInformation (_("[%d] : %s\n"), num_test, STR_OK); 75 msgInformation (_(" - Line : %d\n"), line); 76 msgInformation (_(" - Value : %s\n"), (morpheo::toString(exp)).c_str()); 94 77 95 78 num_test ++; … … 112 95 #define LABEL(str...) \ 113 96 { \ 114 msg (_("{%d} "),static_cast<uint32_t>(sc_simulation_time())); \ 115 msg (str); \ 116 msg (_("\n")); \ 117 fflush (stdout); \ 97 msgInformation (_("{%.0f} "),simulation_cycle()); \ 98 msg (str); \ 99 msg (_("\n")); \ 118 100 } while(0) 119 101 … … 122 104 #endif 123 105 124 #define SC_ START(cycle_offset) \106 #define SC_CYCLE(cycle_offset) \ 125 107 do \ 126 108 { \ 127 /*cout << "SC_ START(begin)" << endl;*/ \109 /*cout << "SC_CYCLE (begin)" << endl;*/ \ 128 110 \ 129 uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time());\111 double cycle_current = simulation_cycle(); \ 130 112 if (cycle_offset != 0) \ 131 113 { \ 132 cout << "##########[ cycle "<< cycle_current+cycle_offset << " ] (" << __LINE__ << ")" << endl; \114 msgInformation(_("##########[ cycle %.0f ] (%d)\n"),cycle_current+cycle_offset,__LINE__); \ 133 115 } \ 134 116 \ … … 138 120 } \ 139 121 \ 140 s c_start(cycle_offset);\122 simulation_run(cycle_offset); \ 141 123 \ 142 /*cout << "SC_ START(end )" << endl;*/ \124 /*cout << "SC_CYCLE (end )" << endl;*/ \ 143 125 } while(0) 144 126 145 127 // old support 128 #ifndef MTI_SYSTEMC 129 # define SC_START(x) SC_CYCLE(x) 130 #endif 146 131 147 132 }; -
trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h
r97 r113 9 9 #include <iostream> 10 10 #include <sys/time.h> 11 #include "Common/include/Systemc.h" 11 12 12 13 namespace morpheo { … … 28 29 { 29 30 #ifdef SYSTEMC 30 nb_cycles_begin = s c_simulation_time();31 nb_cycles_begin = simulation_cycle(); 31 32 #endif 32 33 gettimeofday(&time_begin,NULL); … … 48 49 if (x.systemc) 49 50 { 50 double nb_cycles_end = s c_simulation_time();51 double nb_cycles_end = simulation_cycle(); 51 52 double average = static_cast<double>(nb_cycles_end-x.nb_cycles_begin+1) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec+1); 52 53 -
trunk/IPs/systemC/processor/Morpheo/Common/src/MemCheck.cpp
r112 r113 10 10 // Global flags set by macros in MemCheck.h 11 11 bool traceFlag = false; 12 bool activeFlag = true;12 bool activeFlag = false; 13 13 14 14 namespace { -
trunk/IPs/systemC/processor/Morpheo/Documentation/Makefile.Documentation
r91 r113 273 273 $(RM) $(DIR_SCHEMA_EPS); \ 274 274 $(RM) $(DVI_FILES) $(PS_FILES) $(PDF_FILES); \ 275 $(MAKE) clean_rec DIR_CLEAN= .;275 $(MAKE) clean_rec DIR_CLEAN=$(PWD); 276 276 277 277 clean_all : clean -
trunk/IPs/systemC/processor/Morpheo/Documentation/doc/document-morpheo-vhdl_generation/tex/document-morpheo-vhdl_generation-fr-03_vhdl_body.tex
r100 r113 4 4 5 5 \Section{VHDL : comportement}\label{vhdl_body} 6 7 \subSection{Description du fichier {\it Component\_vhdl\_body.cpp}} 6 8 7 9 Le comportement du composant est défini dans le fichier {\it Component\_vhdl\_body.cpp}. … … 23 25 void set_comment (std::string text ); 24 26 \end{lstlisting} 27 28 \subSection{Description du fichier {\it Component\_vhdl.cpp}} 29 Nous allons décrire ici le fichier {\it Component\_vhdl.cpp}. 30 31 \lstparam{C++} 32 \begin{lstlisting}[caption={Component\_vhdl.cpp}, label=component_vhdl.cpp] 33 void component::vhdl (void) 34 { 35 Vhdl * vhdl = new Vhdl (_name); 36 37 _interfaces->set_port(vhdl); 38 _component->vhdl_instance(vhdl); 39 40 vhdl_declaration (vhdl); 41 vhdl_body (vhdl); 42 43 vhdl->generate_file(); 44 45 delete vhdl; 46 }; 47 \end{lstlisting} 48 49 50 La première étape est d'éditer le fichier {\it Component\_vhdl.cpp}. Le listing \ref{component_vhdl.cpp} représente le contenu de ce fichier. 51 \begin{itemize} 52 \item Ligne 3 : Déclaration et construction de la variable {\it vhdl} qui est du type {\it Vhdl}. 53 \item Ligne 5 : Ajout dans le modèle VHDL des interfaces présentes dans le modèle SystemC. (cf fichiers Component.h). 54 \item Ligne 6 : Ajout dans le modèle VHDL des composants internes dans le modèle SystemC. (cf fichiers Component.h et Component\_allocation.cpp). 55 \item Ligne 8 : Ajout dans le modèle VHDL des déclarations définit dans le fichiers Component\_vhdl\_declaration.cpp (cf section \ref{vhdl_declaration}). 56 \item Ligne 9 : Ajout dans le modèle VHDL de la description comportemental définit dans le fichiers Component\_vhdl\_body.cpp (cf section \ref{vhdl_body}). 57 \item Ligne 11 : Génération des fichiers VHDL. Le nom du fichier est construit à partir du nom fourni lors de la construction de la variable {\it vhdl}. 58 \item Ligne 13 : Destruction de l'objet. 59 \end{itemize} -
trunk/IPs/systemC/processor/Morpheo/Documentation/doc/document-morpheo-vhdl_generation/tex/document-morpheo-vhdl_generation-fr-04_vhdl_structural.tex
r100 r113 5 5 \Section{VHDL : structurelle}\label{vhdl_structural} 6 6 7 \subSection{Description du fichier {\it Component\_vhdl.cpp}}7 %\subSection{Description du fichier {\it Component\_vhdl.cpp}} 8 8 Les modèles systemC structurels sont des modèles qui instancient d'autres modèles. Il n'y a pas de description comportementale. Ces modèles sont générés automatiquement. 9 9 Par contre, les modèles systemC comportementaux peuvent être décrit par un modèle VHDL mixte (incluant une description comportementale et des instances d'autre composant). … … 11 11 Les modèles génériques sont dans le répertoire {\it IPs/systemC/processor/Morpheo/Behavioural/Generic}. 12 12 13 \lstparam{C++}14 \begin{lstlisting}[caption={Component\_vhdl.cpp}, label=component_vhdl.cpp]15 void component::vhdl (void)16 {17 Vhdl * vhdl = new Vhdl (_name);18 19 _interfaces->set_port(vhdl);20 _component->vhdl_instance(vhdl);21 22 vhdl_declaration (vhdl);23 vhdl_body (vhdl);24 25 vhdl->generate_file();26 27 delete vhdl;28 };29 \end{lstlisting}30 31 32 La première étape est d'éditer le fichier {\it Component\_vhdl.cpp}. Le listing \ref{component_vhdl.cpp} représente le contenu de ce fichier.33 \begin{itemize}34 \item Ligne 3 : Déclaration et construction de la variable {\it vhdl} qui est du type {\it Vhdl}.35 \item Ligne 5 : Ajout dans le modèle VHDL des interfaces présentes dans le modèle SystemC. (cf fichiers Component.h).36 \item Ligne 6 : Ajout dans le modèle VHDL des composants internes dans le modèle SystemC. (cf fichiers Component.h et Component\_allocation.cpp).37 \item Ligne 8 : Ajout dans le modèle VHDL des déclarations définit dans le fichiers Component\_vhdl\_declaration.cpp (cf section \ref{vhdl_declaration}).38 \item Ligne 9 : Ajout dans le modèle VHDL de la description comportemental définit dans le fichiers Component\_vhdl\_body.cpp (cf section \ref{vhdl_body}).39 \item Ligne 11 : Génération des fichiers VHDL. Le nom du fichier est construit à partir du nom fourni lors de la construction de la variable {\it vhdl}.40 \item Ligne 13 : Destruction de l'objet.41 \end{itemize}42 43 13 Pour la suite, nous allons supposer l'instanciation d'une FIFO. 44 14 45 15 \subSection{Ajout d'une instance} 46 16 47 Dans le fichier Component\_vhdl.cpp :48 17 \begin{enumerate} 49 \item Inclure la définition de la classe désirée.18 \item Dans le fichier Component.h : inclure la définition de la classe désirée. 50 19 \lstparam{C++} 51 20 \begin{lstlisting} 52 21 #include "Behavioural/Generic/Queue/include/Queue.h" 53 22 \end{lstlisting} 54 \item Creer les paramètres du modèle. 23 24 \item Dans le fichier Component.h : déclaré les paramètres et le component 55 25 \lstparam{C++} 56 26 \begin{lstlisting} 57 morpheo::behavioural::generic::queue::Parameters * param_queue; 58 param_queue = new morpheo::behavioural::generic::queue::Parameters 27 morpheo::behavioural::generic::queue::Parameters * _param_queue; 28 morpheo::behavioural::generic::queue::Queue * _component_queue; 29 \end{lstlisting} 30 31 \item Dans le fichier Component\_allocation.cpp : creer les paramètres du modèle. 32 \lstparam{C++} 33 \begin{lstlisting} 34 _param_queue = new morpheo::behavioural::generic::queue::Parameters 59 35 (16, //size_queue 60 36 32);//size_data 61 37 \end{lstlisting} 62 \item Creer le modèle38 \item Dans le fichier Component\_allocation.cpp : creer le modèle 63 39 \lstparam{C++} 64 40 \begin{lstlisting} 65 morpheo::behavioural::generic::queue::Queue * queue;66 41 std::string queue_name = _name + "_queue"; 67 42 68 queue = new morpheo::behavioural::generic::queue::Queue43 _component_queue = new morpheo::behavioural::generic::queue::Queue 69 44 (queue_name.c_str() // nom du modèle 70 45 #ifdef STATISTICS 71 46 ,NULL // Pas paramètres pour les statistiques 72 47 #endif 73 , param_queue// Paramètres de la file48 ,_param_queue // Paramètres de la file 74 49 ,USE_VHDL); // Utilisation du modèle VHDL 75 50 \end{lstlisting} 76 \item Inclure le modèle dans la liste des composants internes51 \item Dans le fichier Component\_allocation.cpp : inclure le modèle dans la liste des composants internes 77 52 \lstparam{C++} 78 53 \begin{lstlisting} 79 _component->set_component( queue->_component54 _component->set_component(_component_queue->_component 80 55 #ifdef POSITION 81 56 , 20, 20, 20, 20 … … 86 61 ); 87 62 \end{lstlisting} 88 \item indiquer dans le fichier Makefile.deps que le composant dépend de ce modèle.63 \item Dans le fichier Makefile.deps : ajouter les dépendances du modèle. 89 64 \lstparam{make} 90 65 \begin{lstlisting} … … 114 89 $(MAKE) --directory=$(Component_DIR) --makefile=Makefile clean; 115 90 \end{lstlisting} 91 \item Dans le fichier Component\_deallocation.cpp : détruire les modèles et leurs paramètres. 92 \lstparam{C++} 93 \begin{lstlisting} 94 delete _component_queue; 95 delete _param_queue; 96 \end{lstlisting} 116 97 \end{enumerate} 117 98 … … 138 119 vhdl->set_body (0,");"); 139 120 \end{lstlisting} 121 -
trunk/IPs/systemC/processor/Morpheo/Files/Morpheo.sim
r112 r113 30 30 <parameter name="debug_idle_time" value="5" /> 31 31 32 <component name="Comparator" model="systemc" debug="0" /> 32 33 <component name="Counter" model="systemc" debug="0" /> 34 <component name="Divider" model="systemc" debug="0" /> 35 <component name="Multiplier" model="systemc" debug="0" /> 33 36 <component name="Priority" model="systemc" debug="0" /> 34 37 <component name="Queue_Control" model="systemc" debug="0" /> -
trunk/IPs/systemC/processor/Morpheo/TopLevel/Makefile.defs
r88 r113 7 7 # 8 8 9 ENTITY = TopLevel 10 9 11 #-----[ Directory ]---------------------------------------- 10 12 DIR_COMPONENT_MORPHEO = ..
Note: See TracChangeset
for help on using the changeset viewer.