Changeset 57 for trunk/IPs/systemC/processor/Morpheo/Behavioural
- Timestamp:
- Sep 28, 2007, 2:58:08 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural
- Files:
-
- 7 added
- 1 deleted
- 67 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Constant/Constant_OpenRISC.h
r55 r57 15 15 #define _size_instruction_log2 5 16 16 17 //------------------------------------------------------[ Control ]-----18 typedef bool Tcontrol_t;19 20 17 //----------------------------------------------------[ Operation ]----- 21 typedef uint8_t Toperation_t;22 18 // #define _nb_operation 32 23 19 // #define _size_operation 5 … … 57 53 58 54 //--------------------------------------------------[ destination ]----- 59 typedef uint8_t Tdestination1_t;60 55 #define _size_destination1 4 61 56 … … 66 61 #define mask_DESTINATION1_MAC_UNIT 0x8 67 62 68 typedef uint8_t Tdestination2_t;69 63 #define _size_destination2 3 70 64 … … 75 69 76 70 //----------------------------------------------------[ exec_flag ]----- 77 typedef uint8_t Texec_flag_t;78 71 #define _size_exec_flag 2 79 72 … … 84 77 85 78 //---------------------------------------------------[ exec_excep ]----- 86 typedef bool Texec_excep_t;87 79 #define _size_exec_excep 1 88 80 … … 91 83 92 84 //----------------------------------------------------[ Condition ]----- 93 typedef uint8_t Tcondition_t;94 85 #define _size_condition 3 95 86 … … 102 93 103 94 //-------------------------------------------------[ branch_state ]----- 104 typedef uint8_t Tbranch_state_t;105 106 95 #define cst_BRANCH_STATE_NONE 0x0 // 0 0 107 96 #define cst_BRANCH_STATE_NSPEC_TAKE 0x1 // 0 1 -> incondionnal -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/mkf.info
r55 r57 20 20 target_dep RegisterFile_Monolithic_3.prj RegisterFile_Monolithic_3_Pack.vhdl RegisterFile_Monolithic_3.vhdl 21 21 22 # RegisterFile_Monolithic_4 23 target_dep all RegisterFile_Monolithic_4.ngc 24 target_dep RegisterFile_Monolithic_4.ngc RegisterFile_Monolithic_4.prj 25 target_dep RegisterFile_Monolithic_4.prj RegisterFile_Monolithic_4_Pack.vhdl RegisterFile_Monolithic_4.vhdl 26 27 # RegisterFile_Monolithic_5 28 target_dep all RegisterFile_Monolithic_5.ngc 29 target_dep RegisterFile_Monolithic_5.ngc RegisterFile_Monolithic_5.prj 30 target_dep RegisterFile_Monolithic_5.prj RegisterFile_Monolithic_5_Pack.vhdl RegisterFile_Monolithic_5.vhdl 31 32 # RegisterFile_Monolithic_6 33 target_dep all RegisterFile_Monolithic_6.ngc 34 target_dep RegisterFile_Monolithic_6.ngc RegisterFile_Monolithic_6.prj 35 target_dep RegisterFile_Monolithic_6.prj RegisterFile_Monolithic_6_Pack.vhdl RegisterFile_Monolithic_6.vhdl 36 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp
r55 r57 7 7 */ 8 8 9 #define NB_ITERATION 29 #define NB_ITERATION 1 10 10 11 11 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/include/test.h" -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h
r55 r57 27 27 #include "Behavioural/include/Vhdl.h" 28 28 #endif 29 #include "Behavioural/include/Usage.h" 29 30 30 31 using namespace std; … … 46 47 // Parameters 47 48 protected : const string _name; 49 protected : const Parameters * _param; 50 private : const Tusage_t _usage; 48 51 49 protected : const Parameters * _param;50 52 #ifdef STATISTICS 51 53 private : Statistics * _stat; … … 95 97 SC_HAS_PROCESS (RegisterFile_Monolithic); 96 98 #endif 97 98 public : RegisterFile_Monolithic(99 public : RegisterFile_Monolithic 100 ( 99 101 #ifdef SYSTEMC 100 sc_module_name name, 102 sc_module_name name 101 103 #else 102 string name, 104 string name 103 105 #endif 104 106 #ifdef STATISTICS 105 morpheo::behavioural::Parameters_Statistics * param_statistics, 107 ,morpheo::behavioural::Parameters_Statistics * param_statistics 106 108 #endif 107 Parameters * param ); 109 ,Parameters * param 110 ,morpheo::behavioural::Tusage_t usage=USE_ALL 111 ); 112 108 113 public : ~RegisterFile_Monolithic (void); 109 114 110 #ifdef SYSTEMC111 115 private : void allocation (void); 112 116 private : void deallocation (void); 113 117 118 #ifdef SYSTEMC 114 119 public : void transition (void); 115 120 //public : void genMoore (void) {/* empty */}; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h
r53 r57 9 9 */ 10 10 11 #include " Common/include/Types.h"11 #include "Behavioural/include/Types.h" 12 12 13 13 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp
r55 r57 14 14 namespace registerfile_monolithic { 15 15 16 RegisterFile_Monolithic::RegisterFile_Monolithic ( 16 RegisterFile_Monolithic::RegisterFile_Monolithic 17 ( 17 18 #ifdef SYSTEMC 18 19 sc_module_name name, 19 20 #else 20 21 string name , 21 22 #endif 22 23 #ifdef STATISTICS 23 24 morpheo::behavioural::Parameters_Statistics * param_statistics, 24 25 #endif 25 morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * param ): 26 _name (name), 27 _param (param) 26 morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * param, 27 morpheo::behavioural::Tusage_t usage 28 ): 29 _name (name), 30 _param (param), 31 _usage (usage) 28 32 { 29 33 log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","Begin"); 30 34 31 #ifdef SYSTEMC32 35 log_printf(INFO,RegisterFile_Monolithic,"RegisterFile_Monolithic","Allocation"); 33 34 36 allocation (); 35 #endif36 37 37 38 #ifdef STATISTICS … … 47 48 48 49 #ifdef SYSTEMC 49 SC_METHOD (transition); 50 dont_initialize (); 51 sensitive_pos << *(in_CLOCK); 50 if (_usage & USE_SYSTEMC) 51 { 52 SC_METHOD (transition); 53 dont_initialize (); 54 sensitive_pos << *(in_CLOCK); 55 56 SC_METHOD (genMealy_read); 57 dont_initialize (); 58 sensitive_neg << *(in_CLOCK); 59 for (uint32_t i=0; i<_param->_nb_port_read; i++) 60 sensitive << *(in_READ_VAL [i]) 61 << *(in_READ_ADDRESS [i]); 62 for (uint32_t i=0; i<_param->_nb_port_read_write; i++) 63 sensitive << *(in_READ_WRITE_VAL [i]) 64 << *(in_READ_WRITE_RW [i]) 65 << *(in_READ_WRITE_ADDRESS [i]); 66 67 # ifdef SYSTEMCASS_SPECIFIC 68 // List dependency information 69 for (uint32_t i=0; i<_param->_nb_port_read; i++) 70 { 71 (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); 72 (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); 73 } 74 for (uint32_t i=0; i<_param->_nb_port_read_write; i++) 75 { 76 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL [i])); 77 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW [i])); 78 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); 79 } 80 # endif 81 82 for (uint32_t i=0; i<_param->_nb_port_read ; i++) 83 PORT_WRITE(out_READ_ACK [i], 1); 84 for (uint32_t i=0; i<_param->_nb_port_write ; i++) 85 PORT_WRITE(out_WRITE_ACK [i], 1); 86 for (uint32_t i=0; i<_param->_nb_port_read_write ; i++) 87 PORT_WRITE(out_READ_WRITE_ACK [i], 1); 88 } 89 #endif 52 90 53 SC_METHOD (genMealy_read);54 dont_initialize ();55 sensitive_neg << *(in_CLOCK);56 for (uint32_t i=0; i<_param->_nb_port_read; i++)57 sensitive << *(in_READ_VAL [i])58 << *(in_READ_ADDRESS [i]);59 for (uint32_t i=0; i<_param->_nb_port_read_write; i++)60 sensitive << *(in_READ_WRITE_VAL [i])61 << *(in_READ_WRITE_RW [i])62 << *(in_READ_WRITE_ADDRESS [i]);63 64 #ifdef SYSTEMCASS_SPECIFIC65 // List dependency information66 for (uint32_t i=0; i<_param->_nb_port_read; i++)67 {68 (*(out_READ_DATA [i])) (*( in_READ_VAL [i]));69 (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i]));70 }71 for (uint32_t i=0; i<_param->_nb_port_read_write; i++)72 {73 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL [i]));74 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW [i]));75 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));76 }77 #endif78 79 for (uint32_t i=0; i<_param->_nb_port_read ; i++)80 PORT_WRITE(out_READ_ACK [i], 1);81 for (uint32_t i=0; i<_param->_nb_port_write ; i++)82 PORT_WRITE(out_WRITE_ACK [i], 1);83 for (uint32_t i=0; i<_param->_nb_port_read_write ; i++)84 PORT_WRITE(out_READ_WRITE_ACK [i], 1);85 #endif86 87 91 log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End"); 88 92 }; … … 95 99 #endif 96 100 97 #ifdef SYSTEMC98 101 deallocation (); 99 #endif100 102 }; 101 103 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp
r55 r57 1 #ifdef SYSTEMC2 1 /* 3 2 * $Id$ … … 17 16 void RegisterFile_Monolithic::allocation (void) 18 17 { 19 _component = new Component ( );18 _component = new Component (_usage); 20 19 21 20 Entity * entity = _component->set_entity (_name … … 133 132 }; // end namespace behavioural 134 133 }; // end namespace morpheo 135 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_deallocation.cpp
r55 r57 1 #ifdef SYSTEMC2 1 /* 3 2 * $Id$ … … 19 18 delete _component; 20 19 21 delete in_CLOCK; 22 delete in_NRESET; 23 // ----- Interface Read 24 delete [] in_READ_VAL ; 25 delete [] out_READ_ACK ; 26 delete [] in_READ_ADDRESS; 27 delete [] out_READ_DATA ; 28 29 // ----- Interface Write 30 delete [] in_WRITE_VAL ; 31 delete [] out_WRITE_ACK ; 32 delete [] in_WRITE_ADDRESS; 33 delete [] in_WRITE_DATA ; 34 35 // ----- Interface Read_Write 36 delete [] in_READ_WRITE_VAL ; 37 delete [] out_READ_WRITE_ACK ; 38 delete [] in_READ_WRITE_RW ; 39 delete [] in_READ_WRITE_ADDRESS; 40 delete [] in_READ_WRITE_WDATA ; 41 delete [] out_READ_WRITE_RDATA ; 42 43 // ----- Register 44 delete [] reg_DATA; 20 if (_usage & USE_SYSTEMC) 21 { 22 delete in_CLOCK; 23 delete in_NRESET; 24 // ----- Interface Read 25 delete [] in_READ_VAL ; 26 delete [] out_READ_ACK ; 27 delete [] in_READ_ADDRESS; 28 delete [] out_READ_DATA ; 29 30 // ----- Interface Write 31 delete [] in_WRITE_VAL ; 32 delete [] out_WRITE_ACK ; 33 delete [] in_WRITE_ADDRESS; 34 delete [] in_WRITE_DATA ; 35 36 // ----- Interface Read_Write 37 delete [] in_READ_WRITE_VAL ; 38 delete [] out_READ_WRITE_ACK ; 39 delete [] in_READ_WRITE_RW ; 40 delete [] in_READ_WRITE_ADDRESS; 41 delete [] in_READ_WRITE_WDATA ; 42 delete [] out_READ_WRITE_RDATA ; 43 44 // ----- Register 45 delete [] reg_DATA; 46 } 45 47 }; 46 48 … … 50 52 }; // end namespace behavioural 51 53 }; // end namespace morpheo 52 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/Makefile.deps
r53 r57 13 13 include $(DIR_MORPHEO)/Behavioural/Makefile.deps 14 14 endif 15 ifndef RegisterFile_Monolithic 16 include $(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.deps 17 endif 18 ifndef Select_Priority_Fixed 19 include $(DIR_MORPHEO)/Behavioural/Generic/Select/Select_Priority_Fixed/Makefile.deps 20 endif 15 21 16 22 #-----[ Library ]------------------------------------------ 17 RegisterFile_Multi_Banked_LIBRARY = -lRegisterFile_Multi_Banked \ 18 $(Behavioural_LIBRARY) 23 RegisterFile_Multi_Banked_LIBRARY = -lRegisterFile_Multi_Banked \ 24 $(Behavioural_LIBRARY) \ 25 $(RegisterFile_Monolithic_LIBRARY) \ 26 $(Select_Priority_Fixed_LIBRARY) 19 27 20 28 RegisterFile_Multi_Banked_DIR_LIBRARY = -L$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/lib \ 21 $(Behavioural_DIR_LIBRARY) 29 $(Behavioural_DIR_LIBRARY) \ 30 $(RegisterFile_Monolithic_DIR_LIBRARY) \ 31 $(Select_Priority_Fixed_DIR_LIBRARY) 22 32 23 33 #-----[ Rules ]-------------------------------------------- … … 25 35 RegisterFile_Multi_Banked_library : 26 36 @\ 27 $(MAKE) Behavioural_library; \ 37 $(MAKE) Behavioural_library; \ 38 $(MAKE) RegisterFile_Monolithic_library; \ 39 $(MAKE) Select_Priority_Fixed_library; \ 28 40 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked --makefile=Makefile; 29 41 30 42 RegisterFile_Multi_Banked_library_clean : 31 43 @\ 32 $(MAKE) Behavioural_library_clean; \ 44 $(MAKE) Behavioural_library_clean; \ 45 $(MAKE) RegisterFile_Monolithic_library_clean; \ 46 $(MAKE) Select_Priority_Fixed_library_clean; \ 33 47 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked --makefile=Makefile clean; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest/src/test.cpp
r53 r57 7 7 */ 8 8 9 #define NB_ITERATION 1 02410 #define CYCLE_MAX ( 512*NB_ITERATION)9 #define NB_ITERATION 1 10 #define CYCLE_MAX (10240*NB_ITERATION) 11 11 12 12 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest/include/test.h" … … 34 34 cout << "<" << name << "> : Simulation SystemC" << endl; 35 35 36 37 #ifdef STATISTICS 38 morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics(5,50); 39 #endif 40 36 41 RegisterFile_Multi_Banked * _RegisterFile_Multi_Banked = new RegisterFile_Multi_Banked (name.c_str(), 37 42 #ifdef STATISTICS 38 morpheo::behavioural::Parameters_Statistics(5,50),43 _param_stat, 39 44 #endif 40 *_param);45 _param); 41 46 42 47 #ifdef SYSTEMC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h
r53 r57 73 73 // A lot of table to the partial crossbar 74 74 public : uint32_t * _link_port_read_to_bank_read ; 75 // 75 //public : uint32_t * _link_port_read_to_num_bank ; 76 76 public : uint32_t * _link_port_write_to_bank_write; 77 // 77 //public : uint32_t * _link_port_write_to_num_bank ; 78 78 79 79 //-----[ methods ]----------------------------------------------------------- -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h
r53 r57 43 43 // -----[ fields ]---------------------------------------------------- 44 44 // Parameters 45 protected : const string _name;45 protected : const string _name; 46 46 47 protected : const Parameters _param;47 protected : const Parameters * _param; 48 48 //#ifdef STATISTICS 49 49 // protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; … … 98 98 public : RegisterFile_Multi_Banked ( 99 99 #ifdef SYSTEMC 100 sc_module_name name,100 sc_module_name name, 101 101 #else 102 string name,102 string name, 103 103 #endif 104 104 #ifdef STATISTICS 105 morpheo::behavioural::Parameters_Statistics param_statistics,105 morpheo::behavioural::Parameters_Statistics * param_statistics, 106 106 #endif 107 Parameters param );107 Parameters * param ); 108 108 109 public : RegisterFile_Multi_Banked (Parameters param );110 109 public : ~RegisterFile_Multi_Banked (void); 111 110 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Statistics.h
r53 r57 28 28 { 29 29 // -----[ fields ]---------------------------------------------------- 30 private : const Parameters 30 private : const Parameters * _parameters; 31 31 32 32 // -----[ methods ]--------------------------------------------------- 33 public : Statistics (string name ,34 morpheo::behavioural::Parameters_Statistics parameters_statistics ,35 Parameters parameters33 public : Statistics (string name , 34 morpheo::behavioural::Parameters_Statistics * parameters_statistics , 35 Parameters * parameters 36 36 ); 37 37 //public : Statistics (Statistics & stat); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h
r53 r57 9 9 */ 10 10 11 #include " Common/include/Types.h"11 #include "Behavioural/include/Types.h" 12 12 13 13 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Parameters.cpp
r53 r57 53 53 54 54 _link_port_read_to_bank_read = new uint32_t [_nb_port_read ]; 55 // _link_port_read_to_num_bank = new uint32_t [_nb_port_read ];56 55 _link_port_write_to_bank_write = new uint32_t [_nb_port_write]; 57 // _link_port_write_to_num_bank = new uint32_t [_nb_port_write];58 56 59 // uint32_t _nb_port_bank_by_bank_read_port [_nb_port_read_by_bank ];60 // uint32_t _nb_port_bank_by_bank_write_port [_nb_port_write_by_bank];61 62 57 // init 63 // for (uint32_t i=0; i<_nb_port_read_by_bank ;i++) 64 // _nb_port_bank_by_bank_read_port [i] = 0; 65 66 for (uint32_t i=0; i<_nb_port_read ;i++) 58 for (uint32_t i=0; i<_nb_port_read ;i++) 67 59 { 68 60 uint32_t x = i%_nb_port_read_by_bank; 69 61 _link_port_read_to_bank_read [i] = x; 70 // _link_port_read_to_num_bank [i] = _nb_port_bank_by_bank_read_port [x];71 // _nb_port_bank_by_bank_read_port [x] ++;72 62 } 73 74 // init 75 // for (uint32_t i=0; i<_nb_port_write_by_bank ;i++) 76 // _nb_port_bank_by_bank_write_port [i] = 0; 77 78 for (uint32_t i=0; i<_nb_port_write ;i++) 63 for (uint32_t i=0; i<_nb_port_write;i++) 79 64 { 80 65 uint32_t x = i%_nb_port_write_by_bank; 81 66 _link_port_write_to_bank_write [i] = x; 82 // _link_port_write_to_num_bank [i] = _nb_port_bank_by_bank_write_port [x];83 // _nb_port_bank_by_bank_write_port [x] ++;84 67 } 85 68 … … 87 70 log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_read_to_bank_read"); 88 71 for (uint32_t i=0; i<_nb_port_read ;i++) 72 { 89 73 log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * Read in [%d] to out [%d]",i,_link_port_read_to_bank_read [i]); 90 // log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_read_to_num_bank "); 91 // for (uint32_t i=0; i<_nb_port_read ;i++) 92 // log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * Read in [%d] to bank [%d]",i,_link_port_read_to_num_bank [i]); 93 74 printf(" * Read in [%d] to out [%d]\n",i,_link_port_read_to_bank_read [i]); 75 } 94 76 log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_write_to_bank_write"); 95 77 for (uint32_t i=0; i<_nb_port_write ;i++) 96 log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * Write in [%d] to out [%d]",i,_link_port_write_to_bank_write [i]);97 // log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_write_to_num_bank ");98 // for (uint32_t i=0; i<_nb_port_write ;i++) 99 // log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * Write in [%d] to bank [%d]",i,_link_port_write_to_num_bank [i]); 78 { 79 log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * Write in [%d] to out [%d]",i,_link_port_write_to_bank_write [i]); 80 printf(" * Write in [%d] to out [%d]\n",i,_link_port_write_to_bank_write [i]); 81 } 100 82 } 101 83 // else : don't allocate -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked.cpp
r53 r57 21 21 #endif 22 22 #ifdef STATISTICS 23 morpheo::behavioural::Parameters_Statistics 23 morpheo::behavioural::Parameters_Statistics * param_statistics, 24 24 #endif 25 morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters param ):25 morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters * param ): 26 26 _name (name) 27 27 ,_param (param) … … 56 56 #ifdef SYSTEMC 57 57 // Function pointer 58 if (_param ._crossbar == FULL_CROSSBAR)58 if (_param->_crossbar == FULL_CROSSBAR) 59 59 { 60 60 function_transition = &morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked:: full_crossbar_transition; … … 84 84 dont_initialize (); 85 85 sensitive_neg << *(in_CLOCK); 86 for (uint32_t i=0; i<_param ._nb_port_read; i++)86 for (uint32_t i=0; i<_param->_nb_port_read; i++) 87 87 sensitive << *( in_READ_VAL [i]) 88 88 << *( in_READ_ADDRESS [i]); … … 90 90 #ifdef SYSTEMCASS_SPECIFIC 91 91 // List dependency information 92 for (uint32_t i=0; i<_param ._nb_port_read; i++)92 for (uint32_t i=0; i<_param->_nb_port_read; i++) 93 93 { 94 94 (*(out_READ_ACK [i])) (*( in_READ_VAL [i])); … … 97 97 (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); 98 98 } 99 // for (uint32_t i=0; i<_param->_nb_port_read_write; i++) 100 // { 101 // (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL [i])); 102 // (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW [i])); 103 // (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); 104 // } 99 105 #endif 100 106 … … 102 108 dont_initialize (); 103 109 sensitive_neg << *(in_CLOCK); 104 for (uint32_t i=0; i<_param ._nb_port_write; i++)110 for (uint32_t i=0; i<_param->_nb_port_write; i++) 105 111 sensitive << *( in_WRITE_VAL [i]) 106 112 << *( in_WRITE_ADDRESS [i]) … … 109 115 #ifdef SYSTEMCASS_SPECIFIC 110 116 // List dependency information 111 for (uint32_t i=0; i<_param ._nb_port_write; i++)117 for (uint32_t i=0; i<_param->_nb_port_write; i++) 112 118 { 113 119 (*(out_WRITE_ACK [i])) (*( in_WRITE_VAL [i])); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_address_xxx.cpp
r53 r57 20 20 log_printf(FUNC,RegisterFile_Multi_Banked,"address_bank","Begin"); 21 21 22 Taddress_t _return = _param ._bank_mask & (address >> _param._bank_shift);22 Taddress_t _return = _param->_bank_mask & (address >> _param->_bank_shift); 23 23 24 24 log_printf(FUNC,RegisterFile_Multi_Banked,"address_bank","End"); … … 31 31 log_printf(FUNC,RegisterFile_Multi_Banked,"address_num_reg","Begin"); 32 32 33 Taddress_t _return = _param ._num_reg_mask & (address >> _param._num_reg_shift);33 Taddress_t _return = _param->_num_reg_mask & (address >> _param->_num_reg_shift); 34 34 35 35 log_printf(FUNC,RegisterFile_Multi_Banked,"address_num_reg","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp
r53 r57 48 48 // ~~~~~[ Interface : "read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 49 50 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param ._nb_port_read];51 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param ._nb_port_read];52 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param ._nb_port_read];53 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param ._nb_port_read];50 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_read]; 51 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read]; 52 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_read]; 53 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param->_nb_port_read]; 54 54 55 for (uint32_t i=0; i<_param ._nb_port_read; i++)55 for (uint32_t i=0; i<_param->_nb_port_read; i++) 56 56 { 57 57 Interface_fifo * interface = _interfaces->set_interface("read_"+toString(i) … … 65 65 in_READ_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 66 66 out_READ_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 67 in_READ_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param ._nb_word)));68 out_READ_DATA [i] = interface->set_signal_out <Tdata_t > ("data" , _param ._size_word);67 in_READ_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word))); 68 out_READ_DATA [i] = interface->set_signal_out <Tdata_t > ("data" , _param->_size_word); 69 69 } 70 70 71 71 // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 72 73 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param ._nb_port_write];74 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param ._nb_port_write];75 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param ._nb_port_write];76 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param ._nb_port_write];73 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_write]; 74 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write]; 75 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_write]; 76 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param->_nb_port_write]; 77 77 78 for (uint32_t i=0; i<_param ._nb_port_write; i++)78 for (uint32_t i=0; i<_param->_nb_port_write; i++) 79 79 { 80 80 Interface_fifo * interface = _interfaces->set_interface("write_"+toString(i) … … 88 88 in_WRITE_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 89 89 out_WRITE_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 90 in_WRITE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param ._nb_word)));91 in_WRITE_DATA [i] = interface->set_signal_in <Tdata_t > ("data" , _param ._size_word);90 in_WRITE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word))); 91 in_WRITE_DATA [i] = interface->set_signal_in <Tdata_t > ("data" , _param->_size_word); 92 92 } 93 93 94 94 // ~~~~~[ Registers ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95 95 96 reg_DATA = new SC_REGISTER (Tdata_t) ** [_param ._nb_bank];96 reg_DATA = new SC_REGISTER (Tdata_t) ** [_param->_nb_bank]; 97 97 98 for (uint32_t i=0; i<_param ._nb_bank; i++)98 for (uint32_t i=0; i<_param->_nb_bank; i++) 99 99 { 100 reg_DATA [i] = new SC_REGISTER (Tdata_t) * [_param ._nb_word];100 reg_DATA [i] = new SC_REGISTER (Tdata_t) * [_param->_nb_word]; 101 101 102 for (uint32_t j=0; j<_param ._nb_word; j++)102 for (uint32_t j=0; j<_param->_nb_word; j++) 103 103 { 104 104 string rename = "reg_DATA_" + toString(i) + "_" + toString(j); … … 108 108 109 109 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 110 internal_WRITE_VAL = new bool [_param ._nb_port_write];111 internal_WRITE_BANK = new Taddress_t [_param ._nb_port_write];112 internal_WRITE_NUM_REG = new Taddress_t [_param ._nb_port_write];110 internal_WRITE_VAL = new bool [_param->_nb_port_write]; 111 internal_WRITE_BANK = new Taddress_t [_param->_nb_port_write]; 112 internal_WRITE_NUM_REG = new Taddress_t [_param->_nb_port_write]; 113 113 114 114 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_read.cpp
r53 r57 21 21 log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read","Begin"); 22 22 23 bool read_port_use [_param ._nb_bank][_param._nb_port_read_by_bank];23 bool read_port_use [_param->_nb_bank][_param->_nb_port_read_by_bank]; 24 24 25 for (uint32_t i=0; i<_param ._nb_bank; i++)26 for (uint32_t j=0; j<_param ._nb_port_read_by_bank; j++)25 for (uint32_t i=0; i<_param->_nb_bank; i++) 26 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 27 27 read_port_use [i][j]=false; 28 28 29 for (uint32_t i=0; i<_param ._nb_port_read; i++)29 for (uint32_t i=0; i<_param->_nb_port_read; i++) 30 30 { 31 31 bool val = PORT_READ(in_READ_VAL [i]); … … 43 43 44 44 // Search loop 45 for (uint32_t j=0; j<_param ._nb_port_read_by_bank; j++)45 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 46 46 { 47 47 // find a unbusy port on this bank -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_write.cpp
r53 r57 21 21 log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write","Begin"); 22 22 23 bool write_port_use [_param ._nb_bank][_param._nb_port_write_by_bank];23 bool write_port_use [_param->_nb_bank][_param->_nb_port_write_by_bank]; 24 24 25 for (uint32_t i=0; i<_param ._nb_bank; i++)26 for (uint32_t j=0; j<_param ._nb_port_write_by_bank; j++)25 for (uint32_t i=0; i<_param->_nb_bank; i++) 26 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 27 27 write_port_use [i][j]=false; 28 28 29 for (uint32_t i=0; i<_param ._nb_port_write; i++)29 for (uint32_t i=0; i<_param->_nb_port_write; i++) 30 30 { 31 31 bool val = PORT_READ(in_WRITE_VAL [i]); … … 44 44 45 45 // Search loop 46 for (uint32_t j=0; j<_param ._nb_port_write_by_bank; j++)46 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 47 47 { 48 48 // find a unbusy port on this bank -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_read.cpp
r53 r57 21 21 log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_read","Begin"); 22 22 23 bool read_port_use [_param ._nb_bank][_param._nb_port_read_by_bank];23 bool read_port_use [_param->_nb_bank][_param->_nb_port_read_by_bank]; 24 24 25 for (uint32_t i=0; i<_param ._nb_bank; i++)26 for (uint32_t j=0; j<_param ._nb_port_read_by_bank; j++)25 for (uint32_t i=0; i<_param->_nb_bank; i++) 26 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 27 27 read_port_use [i][j]=false; 28 28 29 for (uint32_t i=0; i<_param ._nb_port_read; i++)29 for (uint32_t i=0; i<_param->_nb_port_read; i++) 30 30 { 31 31 bool val = PORT_READ(in_READ_VAL [i]); … … 43 43 44 44 // // Search loop 45 // for (uint32_t j=0; j<_param ._nb_port_read_by_bank; j++)45 // for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 46 46 // { 47 47 48 uint32_t j = _param ._link_port_read_to_bank_read [i];48 uint32_t j = _param->_link_port_read_to_bank_read [i]; 49 49 50 50 // find a unbusy port on this bank -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_write.cpp
r53 r57 21 21 log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write","Begin"); 22 22 23 bool write_port_use [_param ._nb_bank][_param._nb_port_write_by_bank];24 for (uint32_t i=0; i<_param ._nb_bank; i++)25 for (uint32_t j=0; j<_param ._nb_port_write_by_bank; j++)23 bool write_port_use [_param->_nb_bank][_param->_nb_port_write_by_bank]; 24 for (uint32_t i=0; i<_param->_nb_bank; i++) 25 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 26 26 write_port_use [i][j]=false; 27 27 28 for (uint32_t i=0; i<_param ._nb_port_write; i++)28 for (uint32_t i=0; i<_param->_nb_port_write; i++) 29 29 { 30 30 bool val = PORT_READ(in_WRITE_VAL [i]); … … 43 43 44 44 // // Search loop 45 // for (uint32_t j=0; j<_param ._nb_port_write_by_bank; j++)45 // for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 46 46 // { 47 uint32_t j = _param ._link_port_write_to_bank_write [i];47 uint32_t j = _param->_link_port_write_to_bank_write [i]; 48 48 49 49 // find a unbusy port on this bank -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_transition.cpp
r53 r57 24 24 // (this->*function_transition) (); 25 25 26 for (uint32_t i=0; i<_param ._nb_port_write; i++)26 for (uint32_t i=0; i<_param->_nb_port_write; i++) 27 27 { 28 28 if (internal_WRITE_VAL [i] == 1) … … 34 34 } 35 35 } 36 37 38 36 39 37 #ifdef STATISTICS -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl.cpp
r53 r57 8 8 9 9 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h" 10 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h" 11 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h" 10 12 #include "Behavioural/include/Vhdl.h" 11 13 … … 16 18 namespace registerfile_multi_banked { 17 19 18 19 20 void RegisterFile_Multi_Banked::vhdl (void) 20 21 { 21 22 log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl","Begin"); 22 23 24 //=================================== 25 //===== Component ===== 26 //=================================== 27 28 //----- RegisterFile_Monolithic ----- 29 30 morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * param_bank; 31 morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic * bank; 32 33 // Create all bank. All bank is identical 34 param_bank = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters 35 (_param->_nb_port_read_by_bank 36 ,_param->_nb_port_write_by_bank 37 ,0 // mixte port 38 ,_param->_nb_word/_param->_nb_bank 39 ,_param->_size_word); 40 41 string bank_name = _name + "_bank"; 42 bank = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic 43 (bank_name.c_str() 44 #ifdef STATISTICS 45 ,NULL 46 #endif 47 ,param_bank 48 ,USE_VHDL); 49 50 _component->set_component(bank->_component 51 #ifdef POSITION 52 , 0, 0, 0, 0 53 #endif 54 , INSTANCE_LIBRARY 55 ); 56 57 58 //----- Select_Priority_Fixed ----- 59 60 // Create all select_unit : 61 // * 4 units : to the read port, "quotient" ports and "rest" ports. Idem to the write port. 62 // * for a FULL_CROSSBAR, there are no "rest" ports 63 uint32_t nb_select_port_1 ; 64 uint32_t nb_select_port_2 ; 65 uint32_t nb_select_port_3 ; 66 uint32_t nb_select_port_4 ; 67 68 if (_param->_crossbar == FULL_CROSSBAR) 69 { 70 nb_select_port_1 = _param->_nb_port_read ; 71 nb_select_port_3 = _param->_nb_port_write; 72 nb_select_port_2 = nb_select_port_4 = 0; 73 } 74 else 75 { 76 nb_select_port_2=(_param->_nb_port_read )/_param->_nb_port_read_by_bank; 77 nb_select_port_1=((_param->_nb_port_read%_param->_nb_port_read_by_bank)==0)?0:(nb_select_port_2+1); 78 nb_select_port_4=(_param->_nb_port_write )/_param->_nb_port_write_by_bank; 79 nb_select_port_3=((_param->_nb_port_write%_param->_nb_port_write_by_bank)==0)?0:(nb_select_port_4+1); 80 } 81 82 // cout << "nb_select_port_1 : " << nb_select_port_1 << endl; 83 // cout << "nb_select_port_2 : " << nb_select_port_2 << endl; 84 // cout << "nb_select_port_3 : " << nb_select_port_3 << endl; 85 // cout << "nb_select_port_4 : " << nb_select_port_4 << endl; 86 87 morpheo::behavioural::generic::select::select_priority_fixed::Parameters *param_select1 = NULL; 88 morpheo::behavioural::generic::select::select_priority_fixed::Parameters *param_select2 = NULL; 89 morpheo::behavioural::generic::select::select_priority_fixed::Parameters *param_select3 = NULL; 90 morpheo::behavioural::generic::select::select_priority_fixed::Parameters *param_select4 = NULL; 91 92 morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed *select1 = NULL; 93 morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed *select2 = NULL; 94 morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed *select3 = NULL; 95 morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed *select4 = NULL; 96 97 bool have_select1 = ((nb_select_port_1 != 0 )); 98 bool have_select2 = ((nb_select_port_2 != 0 ) and 99 (nb_select_port_2 != nb_select_port_1)); 100 bool have_select3 = ((nb_select_port_3 != 0 ) and 101 (nb_select_port_3 != nb_select_port_2) and 102 (nb_select_port_3 != nb_select_port_1)); 103 bool have_select4 = ((nb_select_port_4 != 0 ) and 104 (nb_select_port_4 != nb_select_port_3) and 105 (nb_select_port_4 != nb_select_port_2) and 106 (nb_select_port_4 != nb_select_port_1) ); 107 108 string select_name1; 109 string select_name2; 110 string select_name3; 111 string select_name4; 112 113 if (have_select1) 114 { 115 select_name1 = _name+"_select_"+toString(nb_select_port_1)+"_ports"; 116 param_select1 = new morpheo::behavioural::generic::select::select_priority_fixed::Parameters (nb_select_port_1,true, false); 117 select1 = new morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed 118 (select_name1.c_str() 119 #ifdef STATISTICS 120 ,NULL 121 #endif 122 ,param_select1 123 ,USE_VHDL); 124 125 _component->set_component(select1->_component 126 #ifdef POSITION 127 , 0, 0, 0, 0 128 #endif 129 , INSTANCE_LIBRARY 130 ); 131 } 132 133 if (have_select2) 134 { 135 select_name2 = _name+"_select_"+toString(nb_select_port_2)+"_ports"; 136 137 param_select2 = new morpheo::behavioural::generic::select::select_priority_fixed::Parameters (nb_select_port_2,true, false); 138 select2 = new morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed 139 (select_name2.c_str() 140 #ifdef STATISTICS 141 ,NULL 142 #endif 143 ,param_select2 144 ,USE_VHDL); 145 146 _component->set_component(select2->_component 147 #ifdef POSITION 148 , 0, 0, 0, 0 149 #endif 150 , INSTANCE_LIBRARY 151 ); 152 } 153 154 if (have_select3) 155 { 156 select_name3 = _name+"_select_"+toString(nb_select_port_3)+"_ports"; 157 158 param_select3 = new morpheo::behavioural::generic::select::select_priority_fixed::Parameters (nb_select_port_3,true, false); 159 select3 = new morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed 160 (select_name3.c_str() 161 #ifdef STATISTICS 162 ,NULL 163 #endif 164 ,param_select3 165 ,USE_VHDL); 166 167 _component->set_component(select3->_component 168 #ifdef POSITION 169 , 0, 0, 0, 0 170 #endif 171 , INSTANCE_LIBRARY 172 ); 173 } 174 175 if (have_select4) 176 { 177 select_name4 = _name+"_select_"+toString(nb_select_port_4)+"_ports"; 178 179 param_select4 = new morpheo::behavioural::generic::select::select_priority_fixed::Parameters (nb_select_port_4,true, false); 180 select4 = new morpheo::behavioural::generic::select::select_priority_fixed::Select_Priority_Fixed 181 (select_name4.c_str() 182 #ifdef STATISTICS 183 ,NULL 184 #endif 185 ,param_select4 186 ,USE_VHDL); 187 188 _component->set_component(select4->_component 189 #ifdef POSITION 190 , 0, 0, 0, 0 191 #endif 192 , INSTANCE_LIBRARY 193 ); 194 } 195 23 196 Vhdl * vhdl = new Vhdl (_name); 24 197 … … 32 205 33 206 delete vhdl; 207 delete bank; 208 delete param_bank; 209 if (have_select1) 210 { 211 delete select1; 212 delete param_select1; 213 } 214 if (have_select2) 215 { 216 delete select2; 217 delete param_select2; 218 } 219 if (have_select3) 220 { 221 delete select3; 222 delete param_select3; 223 } 224 if (have_select4) 225 { 226 delete select4; 227 delete param_select4; 228 } 34 229 35 230 log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_body.cpp
r53 r57 20 20 log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_body","Begin"); 21 21 22 uint32_t read_select_limit ; 23 uint32_t read_nb_select1 ; 24 uint32_t read_nb_select2 ; 25 uint32_t write_select_limit; 26 uint32_t write_nb_select1 ; 27 uint32_t write_nb_select2 ; 28 29 read_select_limit = _param->_nb_port_read%_param->_nb_port_read_by_bank; 30 read_nb_select2 = _param->_nb_port_read/_param->_nb_port_read_by_bank; 31 read_nb_select1 = (read_select_limit==0)?0:(read_nb_select2+1); 32 33 write_select_limit= _param->_nb_port_write%_param->_nb_port_write_by_bank; 34 write_nb_select2 = _param->_nb_port_write/_param->_nb_port_write_by_bank; 35 write_nb_select1 = (write_select_limit==0)?0:(write_nb_select2+1); 36 37 vhdl->set_body(""); 38 vhdl->set_body("-----------------------------------"); 39 vhdl->set_body("-- Instance bank "); 40 vhdl->set_body("-----------------------------------"); 41 vhdl->set_body(""); 42 43 for (uint32_t i=0; i<_param->_nb_bank; i++) 44 { 45 vhdl->set_body(_name+"_bank_"+toString(i)+" : "+_name+"_bank"); 46 vhdl->set_body("port map ("); 47 vhdl->set_body("\t in_CLOCK \t=>\tin_CLOCK "); 48 vhdl->set_body("\t, in_NRESET\t=>\tin_NRESET"); 49 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 50 { 51 vhdl->set_body("\t, in_READ_"+toString(j)+"_VAL \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_VAL"); 52 vhdl->set_body("\t,out_READ_"+toString(j)+"_ACK \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ACK"); 53 vhdl->set_body("\t, in_READ_"+toString(j)+"_ADDRESS \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ADDRESS"); 54 vhdl->set_body("\t,out_READ_"+toString(j)+"_DATA \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_DATA"); 55 } 56 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 57 { 58 vhdl->set_body("\t, in_WRITE_"+toString(j)+"_VAL \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_VAL"); 59 vhdl->set_body("\t,out_WRITE_"+toString(j)+"_ACK \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ACK"); 60 vhdl->set_body("\t, in_WRITE_"+toString(j)+"_ADDRESS \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ADDRESS"); 61 vhdl->set_body("\t, in_WRITE_"+toString(j)+"_DATA \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_DATA"); 62 } 63 64 vhdl->set_body(");"); 65 vhdl->set_body(""); 66 } 67 68 vhdl->set_body(""); 69 vhdl->set_body("-----------------------------------"); 70 vhdl->set_body("-- Instance select"); 71 vhdl->set_body("-- (1 select by port)"); 72 vhdl->set_body("-----------------------------------"); 73 vhdl->set_body(""); 74 for (uint32_t i=0; i<_param->_nb_bank; i++) 75 { 76 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 77 { 78 uint32_t nb_port = (_param->_crossbar == FULL_CROSSBAR)?_param->_nb_port_read:((j<read_select_limit)?read_nb_select1:read_nb_select2); 79 80 vhdl->set_body(_name+"_read_select_"+toString(i)+"_"+toString(j)+" : "+_name+"_select_"+toString(nb_port)+"_ports"); 81 vhdl->set_body("port map ("); 82 for (uint32_t k=0; k<nb_port; k++) 83 { 84 uint32_t num_port = _param->_nb_port_read_by_bank*k+j; 85 string separator = ((k==0)?" ":","); 86 87 vhdl->set_body("\t"+separator+" in_VAL_"+toString(k)+" \t=>\tinternal_READ_"+toString(i)+"_"+toString(num_port)+"_VAL"); 88 vhdl->set_body("\t,out_ACK_"+toString(k)+" \t=>\tinternal_SELECT_READ_"+toString(i)+"_"+toString(num_port)+"_VAL"); 89 } 90 vhdl->set_body(");"); 91 vhdl->set_body(""); 92 } 93 94 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 95 { 96 uint32_t nb_port = (_param->_crossbar == FULL_CROSSBAR)?_param->_nb_port_write:((j<write_select_limit)?write_nb_select1:write_nb_select2); 97 98 vhdl->set_body(_name+"_write_select_"+toString(i)+"_"+toString(j)+" : "+_name+"_select_"+toString(nb_port)+"_ports"); 99 vhdl->set_body("port map ("); 100 for (uint32_t k=0; k<nb_port; k++) 101 { 102 uint32_t num_port = _param->_nb_port_write_by_bank*k+j; 103 string separator = ((k==0)?" ":","); 104 105 vhdl->set_body("\t"+separator+" in_VAL_"+toString(k)+" \t=>\tinternal_WRITE_"+toString(i)+"_"+toString(num_port)+"_VAL"); 106 vhdl->set_body("\t,out_ACK_"+toString(k)+" \t=>\tinternal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+"_VAL"); 107 } 108 vhdl->set_body(");"); 109 vhdl->set_body(""); 110 } 111 } 112 113 vhdl->set_body(""); 114 vhdl->set_body("-----------------------------------"); 115 vhdl->set_body("-- Bank Val"); 116 vhdl->set_body("-----------------------------------"); 117 vhdl->set_body(""); 118 for (uint32_t i=0; i<_param->_nb_bank; i++) 119 { 120 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 121 { 122 uint32_t nb_port = (_param->_crossbar == FULL_CROSSBAR)?_param->_nb_port_read:((j<read_select_limit)?read_nb_select1:read_nb_select2); 123 124 vhdl->set_body("internal_BANK_READ_"+toString(i)+"_"+toString(j)+ "_VAL <= '0'"); 125 for (uint32_t k=0; k<nb_port; k++) 126 { 127 uint32_t num_port = _param->_nb_port_read_by_bank*k+j; 128 129 vhdl->set_body("\tor internal_SELECT_READ_"+toString(i)+"_"+toString(num_port)+"_VAL"); 130 } 131 vhdl->set_body(";"); 132 } 133 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 134 { 135 uint32_t nb_port = (_param->_crossbar == FULL_CROSSBAR)?_param->_nb_port_write:((j<write_select_limit)?write_nb_select1:write_nb_select2); 136 137 vhdl->set_body("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+ "_VAL <= '0'"); 138 for (uint32_t k=0; k<nb_port; k++) 139 { 140 uint32_t num_port = _param->_nb_port_write_by_bank*k+j; 141 142 vhdl->set_body("\tor internal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+"_VAL"); 143 } 144 vhdl->set_body(";"); 145 } 146 } 147 148 vhdl->set_body(""); 149 vhdl->set_body("-----------------------------------"); 150 vhdl->set_body("-- Bank Address"); 151 vhdl->set_body("-----------------------------------"); 152 vhdl->set_body(""); 153 for (uint32_t i=0; i<_param->_nb_bank; i++) 154 { 155 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++) 156 { 157 uint32_t nb_port = (_param->_crossbar == FULL_CROSSBAR)?_param->_nb_port_read:((j<read_select_limit)?read_nb_select1:read_nb_select2); 158 159 vhdl->set_body("internal_BANK_READ_"+toString(i)+"_"+toString(j)+ "_ADDRESS <="); 160 for (uint32_t k=1; k<nb_port; k++) 161 { 162 uint32_t num_port = _param->_nb_port_read_by_bank*k+j; 163 164 vhdl->set_body("\tin_READ_"+toString(num_port)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+" when internal_READ_"+toString(i)+"_"+toString(num_port)+"_VAL='1' else"); 165 } 166 vhdl->set_body("\tin_READ_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+";"); 167 // vhdl->set_body("\t"+std_logic_others(_param->_size_word,0)+";"); 168 } 169 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 170 { 171 uint32_t nb_port = (_param->_crossbar == FULL_CROSSBAR)?_param->_nb_port_write:((j<write_select_limit)?write_nb_select1:write_nb_select2); 172 173 vhdl->set_body("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+ "_ADDRESS <="); 174 for (uint32_t k=1; k<nb_port; k++) 175 { 176 uint32_t num_port = _param->_nb_port_write_by_bank*k+j; 177 178 vhdl->set_body("\tin_WRITE_"+toString(num_port)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+" when internal_WRITE_"+toString(i)+"_"+toString(num_port)+"_VAL='1' else"); 179 } 180 vhdl->set_body("\tin_WRITE_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+";"); 181 // vhdl->set_body("\t"+std_logic_others(_param->_size_word,0)+";"); 182 } 183 } 184 185 vhdl->set_body(""); 186 vhdl->set_body("-----------------------------------"); 187 vhdl->set_body("-- Bank Data"); 188 vhdl->set_body("-----------------------------------"); 189 vhdl->set_body(""); 190 for (uint32_t i=0; i<_param->_nb_bank; i++) 191 { 192 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j++) 193 { 194 uint32_t nb_port = (_param->_crossbar == FULL_CROSSBAR)?_param->_nb_port_write:((j<write_select_limit)?write_nb_select1:write_nb_select2); 195 196 vhdl->set_body("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+ "_DATA <="); 197 for (uint32_t k=1; k<nb_port; k++) 198 { 199 uint32_t num_port = _param->_nb_port_write_by_bank*k+j; 200 201 vhdl->set_body("\tin_WRITE_"+toString(num_port)+"_DATA when internal_WRITE_"+toString(i)+"_"+toString(num_port)+"_VAL='1' else"); 202 } 203 vhdl->set_body("\tin_WRITE_"+toString(j)+"_DATA;"); 204 // vhdl->set_body("\t"+std_logic_others(_param->_size_word,0)+";"); 205 } 206 } 207 208 vhdl->set_body(""); 209 vhdl->set_body("-----------------------------------"); 210 vhdl->set_body("-- VAL (to Select)"); 211 vhdl->set_body("-----------------------------------"); 212 vhdl->set_body(""); 213 214 for (uint32_t i=0; i<_param->_nb_bank; i++) 215 { 216 for (uint32_t j=0; j<_param->_nb_port_read; j ++) 217 { 218 string address = (_param->_nb_bank==1)?"":("and (in_READ_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+")"); 219 220 vhdl->set_body("internal_READ_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_READ_"+toString(j)+"_VAL='1') "+address+"else '0';"); 221 } 222 for (uint32_t j=0; j<_param->_nb_port_write; j ++) 223 { 224 string address = (_param->_nb_bank==1)?"":("and (in_WRITE_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+")"); 225 vhdl->set_body("internal_WRITE_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_WRITE_"+toString(j)+"_VAL='1') "+address+" else '0';"); 226 } 227 } 228 229 vhdl->set_body(""); 230 vhdl->set_body("-----------------------------------"); 231 vhdl->set_body("-- OUTPUT"); 232 vhdl->set_body("-----------------------------------"); 233 vhdl->set_body(""); 234 235 if (_param->_crossbar == FULL_CROSSBAR) 236 { 237 for (uint32_t i=0; i<_param->_nb_port_read; i ++) 238 { 239 vhdl->set_body("out_READ_"+toString(i)+"_ACK <= "); 240 for (uint32_t j=0; j<_param->_nb_bank; j ++) 241 { 242 for (uint32_t k=0; k<_param->_nb_port_read_by_bank; k ++) 243 { 244 vhdl->set_body("\tinternal_BANK_READ_"+toString(j)+"_"+toString(k)+"_ACK when internal_SELECT_READ_"+toString(j)+"_"+toString(k)+"_VAL = '1' else"); 245 } 246 } 247 vhdl->set_body("\t'0';"); 248 vhdl->set_body("out_READ_"+toString(i)+"_DATA <= "); 249 for (uint32_t j=0; j<_param->_nb_bank; j ++) 250 { 251 for (uint32_t k=0; k<_param->_nb_port_read_by_bank; k ++) 252 { 253 vhdl->set_body("\tinternal_BANK_READ_"+toString(j)+"_"+toString(k)+"_DATA when internal_SELECT_READ_"+toString(j)+"_"+toString(k)+"_VAL = '1' else"); 254 } 255 } 256 vhdl->set_body("\t"+std_logic_others(_param->_size_word,0)+";"); 257 } 258 for (uint32_t i=0; i<_param->_nb_port_write; i ++) 259 { 260 vhdl->set_body("out_WRITE_"+toString(i)+"_ACK <= "); 261 for (uint32_t j=0; j<_param->_nb_bank; j ++) 262 { 263 for (uint32_t k=0; k<_param->_nb_port_write_by_bank; k ++) 264 { 265 vhdl->set_body("\tinternal_BANK_WRITE_"+toString(j)+"_"+toString(k)+"_ACK when internal_SELECT_WRITE_"+toString(j)+"_"+toString(k)+"_VAL = '1' else"); 266 } 267 } 268 vhdl->set_body("\t'0';"); 269 } 270 } 271 else 272 { 273 for (uint32_t i=0; i<_param->_nb_port_read; i ++) 274 { 275 uint32_t link = _param->_link_port_read_to_bank_read[i]; 276 277 vhdl->set_body("out_READ_"+toString(i)+"_ACK <= "); 278 for (uint32_t j=0; j<_param->_nb_bank; j ++) 279 { 280 vhdl->set_body("\tinternal_BANK_READ_"+toString(j)+"_"+toString(link)+"_ACK when internal_SELECT_READ_"+toString(j)+"_"+toString(link)+"_VAL = '1' else"); 281 } 282 // vhdl->set_body("\tinternal_BANK_READ_"+toString(0)+"_"+toString(link)+"_ACK;"); 283 vhdl->set_body("\t'0';"); 284 285 vhdl->set_body("out_READ_"+toString(i)+"_DATA <= "); 286 for (uint32_t j=1; j<_param->_nb_bank; j ++) 287 { 288 vhdl->set_body("\tinternal_BANK_READ_"+toString(j)+"_"+toString(link)+"_DATA when internal_SELECT_READ_"+toString(j)+"_"+toString(i)+"_VAL = '1' else"); 289 } 290 vhdl->set_body("\tinternal_BANK_READ_"+toString(0)+"_"+toString(link)+"_DATA;"); 291 // vhdl->set_body("\t"+std_logic_others(_param->_size_word,0)+";"); 292 } 293 for (uint32_t i=0; i<_param->_nb_port_write; i ++) 294 { 295 uint32_t link = _param->_link_port_write_to_bank_write[i]; 296 297 vhdl->set_body("out_WRITE_"+toString(i)+"_ACK <= "); 298 for (uint32_t j=0; j<_param->_nb_bank; j ++) 299 { 300 vhdl->set_body("\tinternal_BANK_WRITE_"+toString(j)+"_"+toString(link)+"_ACK when internal_SELECT_WRITE_"+toString(j)+"_"+toString(i)+"_VAL = '1' else"); 301 } 302 // vhdl->set_body("\tinternal_BANK_WRITE_"+toString(0)+"_"+toString(link)+"_ACK;"); 303 vhdl->set_body("\t'0';"); 304 } 305 } 306 22 307 log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_body","End"); 23 308 }; … … 26 311 }; // end namespace registerfile 27 312 }; // end namespace generic 28 29 313 }; // end namespace behavioural 30 314 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_declaration.cpp
r53 r57 20 20 log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_declaration","Begin"); 21 21 22 vhdl->set_type ("Tregfile", "array (" + toString(_param._nb_word_by_bank-1) + " downto 0) of " + std_logic(_param._size_word)); 22 for (uint32_t i=0; i<_param->_nb_bank; i++) 23 { 24 for (uint32_t j=0; j<_param->_nb_port_read; j ++) 25 { 26 vhdl->set_signal ("internal_READ_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 27 vhdl->set_signal ("internal_READ_"+toString(i)+"_"+toString(j)+"_ACK" ,1); 28 vhdl->set_signal ("internal_SELECT_READ_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 23 29 24 vhdl->set_type ("Tbank" , "array (" + toString(_param._nb_bank) + " downto 0) of Tregfile"); 25 26 vhdl->set_signal ("reg_DATA", "Tbank"); 27 28 for (uint32_t i=0; i<_param._nb_bank; i++) 29 { 30 for (uint32_t j=0; j<_param._nb_port_read_by_bank; j ++) 30 } 31 for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j ++) 31 32 { 32 vhdl->set_signal ("internal_READ_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 33 vhdl->set_signal ("internal_READ_"+toString(i)+"_"+toString(j)+"_PORT" ,static_cast<uint32_t>(ceil(log2(_param._nb_port_read)))); 33 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 34 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ACK" ,1); 35 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ADDRESS",_param->_size_address_by_bank); 36 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_DATA" ,_param->_size_word); 34 37 } 35 for (uint32_t j=0; j<_param ._nb_port_write_by_bank; j ++)38 for (uint32_t j=0; j<_param->_nb_port_write; j ++) 36 39 { 37 40 vhdl->set_signal ("internal_WRITE_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 38 vhdl->set_signal ("internal_WRITE_"+toString(i)+"_"+toString(j)+"_PORT",static_cast<uint32_t>(ceil(log2(_param._nb_port_write)))); 41 vhdl->set_signal ("internal_WRITE_"+toString(i)+"_"+toString(j)+"_ACK" ,1); 42 vhdl->set_signal ("internal_SELECT_WRITE_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 43 } 44 for (uint32_t j=0; j<_param->_nb_port_write_by_bank; j ++) 45 { 46 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 47 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ACK" ,1); 48 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ADDRESS",_param->_size_address_by_bank); 49 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_DATA" ,_param->_size_word); 39 50 } 40 51 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Statistics.cpp
r53 r57 17 17 18 18 Statistics::Statistics (string name , 19 morpheo::behavioural::Parameters_Statistics parameters_statistics ,20 Parameters parameters19 morpheo::behavioural::Parameters_Statistics * parameters_statistics , 20 Parameters * parameters 21 21 ) : 22 22 morpheo::behavioural::Statistics(name , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/config_compact.cfg
r43 r57 1 1 Select_Priority_Fixed 2 2 2 16 *2 # nb_entity 3 0 1+1 # encoding_one_hot3 0 0 +1 # encoding_one_hot 4 4 1 1 +1 # encoding_compact -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/include/test.h
r15 r57 25 25 26 26 void test (string name, 27 morpheo::behavioural::generic::select::select_priority_fixed::Parameters param);27 morpheo::behavioural::generic::select::select_priority_fixed::Parameters * param); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/mkf.info
r15 r57 5 5 target_dep Select_Priority_Fixed_0.prj Select_Priority_Fixed_0_Pack.vhdl Select_Priority_Fixed_0.vhdl 6 6 7 # Select_Priority_Fixed_10 8 target_dep all Select_Priority_Fixed_10.ngc 9 target_dep Select_Priority_Fixed_10.ngc Select_Priority_Fixed_10.prj 10 target_dep Select_Priority_Fixed_10.prj Select_Priority_Fixed_10_Pack.vhdl Select_Priority_Fixed_10.vhdl 11 12 # Select_Priority_Fixed_11 13 target_dep all Select_Priority_Fixed_11.ngc 14 target_dep Select_Priority_Fixed_11.ngc Select_Priority_Fixed_11.prj 15 target_dep Select_Priority_Fixed_11.prj Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_11.vhdl 16 7 17 # Select_Priority_Fixed_1 8 18 target_dep all Select_Priority_Fixed_1.ngc 9 19 target_dep Select_Priority_Fixed_1.ngc Select_Priority_Fixed_1.prj 10 target_dep Select_Priority_Fixed_1.prj Select_Priority_Fixed_1 _Pack.vhdl Select_Priority_Fixed_1.vhdl20 target_dep Select_Priority_Fixed_1.prj Select_Priority_Fixed_10_Pack.vhdl Select_Priority_Fixed_10.vhdl Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_11.vhdl Select_Priority_Fixed_1_Pack.vhdl Select_Priority_Fixed_1.vhdl 11 21 12 22 # Select_Priority_Fixed_2 … … 40 50 target_dep Select_Priority_Fixed_7.prj Select_Priority_Fixed_7_Pack.vhdl Select_Priority_Fixed_7.vhdl 41 51 52 # Select_Priority_Fixed_8 53 target_dep all Select_Priority_Fixed_8.ngc 54 target_dep Select_Priority_Fixed_8.ngc Select_Priority_Fixed_8.prj 55 target_dep Select_Priority_Fixed_8.prj Select_Priority_Fixed_8_Pack.vhdl Select_Priority_Fixed_8.vhdl 56 57 # Select_Priority_Fixed_9 58 target_dep all Select_Priority_Fixed_9.ngc 59 target_dep Select_Priority_Fixed_9.ngc Select_Priority_Fixed_9.prj 60 target_dep Select_Priority_Fixed_9.prj Select_Priority_Fixed_9_Pack.vhdl Select_Priority_Fixed_9.vhdl 61 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/main.cpp
r15 r57 42 42 try 43 43 { 44 morpheo::behavioural::generic::select::select_priority_fixed::Parameters param (nb_entity , 45 encoding_one_hot, 46 encoding_compact); 44 morpheo::behavioural::generic::select::select_priority_fixed::Parameters * param = new morpheo::behavioural::generic::select::select_priority_fixed::Parameters 45 (nb_entity , 46 encoding_one_hot, 47 encoding_compact); 47 48 48 cout << param .print(1);49 cout << param->print(1); 49 50 50 51 test (name,param); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/test.cpp
r44 r57 13 13 14 14 void test (string name, 15 morpheo::behavioural::generic::select::select_priority_fixed::Parameters _param)15 morpheo::behavioural::generic::select::select_priority_fixed::Parameters * _param) 16 16 { 17 17 cout << "<" << name << "> : Simulation SystemC" << endl; 18 18 19 20 #ifdef STATISTICS 21 morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics (5,50); 22 #endif 19 23 Select_Priority_Fixed * _Select_Priority_Fixed = new Select_Priority_Fixed (name.c_str(), 20 24 #ifdef STATISTICS 21 morpheo::behavioural::Parameters_Statistics(5,50),25 _param_stat, 22 26 #endif 23 27 _param); … … 38 42 CLOCK = new sc_clock ("clock", 1.0, 0.5); 39 43 NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 40 VAL = new sc_signal<Tcontrol_t> * [_param ._nb_entity];41 ACK = new sc_signal<Tcontrol_t> * [_param ._nb_entity];44 VAL = new sc_signal<Tcontrol_t> * [_param->_nb_entity]; 45 ACK = new sc_signal<Tcontrol_t> * [_param->_nb_entity]; 42 46 43 for (uint32_t i=0; i<_param ._nb_entity; i++)47 for (uint32_t i=0; i<_param->_nb_entity; i++) 44 48 { 45 49 rename = "VAL_"+toString(i); … … 61 65 (*(_Select_Priority_Fixed->in_NRESET)) (*(NRESET)); 62 66 63 for (uint32_t i=0; i<_param ._nb_entity; i++)67 for (uint32_t i=0; i<_param->_nb_entity; i++) 64 68 { 65 69 (*(_Select_Priority_Fixed-> in_VAL [i])) (*(VAL [i])); 66 if (_param ._encoding_one_hot)70 if (_param->_encoding_one_hot) 67 71 (*(_Select_Priority_Fixed->out_ACK [i])) (*(ACK [i])); 68 72 } 69 if (_param ._encoding_compact)73 if (_param->_encoding_compact) 70 74 { 71 75 (*(_Select_Priority_Fixed->out_ENTITY )) (*(ENTITY )); … … 78 82 cout << "<" << name << "> Start Simulation ............" << endl; 79 83 80 if (_param ._nb_entity > (8*sizeof (Tentity_t)))84 if (_param->_nb_entity > (8*sizeof (Tentity_t))) 81 85 throw ErrorMorpheo("No Selftest with nb_entity higher at "+toString(8*sizeof (Tentity_t))); 82 86 … … 99 103 bool find = false; 100 104 101 for (uint32_t i=0; i<_param ._nb_entity; i++)105 for (uint32_t i=0; i<_param->_nb_entity; i++) 102 106 { 103 107 Tcontrol_t val = rand() % 2; … … 118 122 entity = (find)?entity:0; 119 123 120 if (_param ._encoding_one_hot)124 if (_param->_encoding_one_hot) 121 125 TEST(Tcontrol_t, ACK [entity]->read(), find ); 122 if (_param ._encoding_compact)126 if (_param->_encoding_compact) 123 127 { 124 128 TEST(Tentity_t , ENTITY ->read(), entity); // burk -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h
r44 r57 26 26 #include "Behavioural/include/Vhdl.h" 27 27 #endif 28 #include "Behavioural/include/Usage.h" 28 29 29 30 using namespace std; … … 44 45 // Parameters 45 46 protected : const string _name; 46 47 pr otected : const Parameters _param;47 protected : const Parameters * _param; 48 private : const Tusage_t _usage; 48 49 //#ifdef STATISTICS 49 50 // protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; … … 54 55 #endif 55 56 56 p rivate: Component * _component;57 public : Component * _component; 57 58 private : Interfaces * _interfaces; 58 59 … … 81 82 SC_HAS_PROCESS (Select_Priority_Fixed); 82 83 #endif 83 public : Select_Priority_Fixed ( 84 public : Select_Priority_Fixed 85 ( 84 86 #ifdef SYSTEMC 85 87 sc_module_name name, 86 88 #else 87 89 string name, 88 90 #endif 89 91 #ifdef STATISTICS 90 morpheo::behavioural::Parameters_Statisticsparam_statistics,92 morpheo::behavioural::Parameters_Statistics * param_statistics, 91 93 #endif 92 Parameters param ); 93 94 public : Select_Priority_Fixed (Parameters param );94 Parameters * param , 95 morpheo::behavioural::Tusage_t usage=USE_ALL); 96 95 97 public : ~Select_Priority_Fixed (void); 96 98 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h
r44 r57 28 28 { 29 29 // -----[ fields ]---------------------------------------------------- 30 private : const Parameters 30 private : const Parameters * _parameters; 31 31 32 32 // -----[ methods ]--------------------------------------------------- 33 33 public : Statistics (string name , 34 morpheo::behavioural::Parameters_Statistics parameters_statistics ,35 Parameters parameters34 morpheo::behavioural::Parameters_Statistics * parameters_statistics , 35 Parameters * parameters 36 36 ); 37 37 //public : Statistics (Statistics & stat); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h
r44 r57 9 9 */ 10 10 11 #include " Common/include/Types.h"11 #include "Behavioural/include/Types.h" 12 12 13 13 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp
r42 r57 15 15 16 16 17 Select_Priority_Fixed::Select_Priority_Fixed 18 ( 17 19 #ifdef SYSTEMC 18 Select_Priority_Fixed::Select_Priority_Fixed (sc_module_name name,20 sc_module_name name, 19 21 #else 20 Select_Priority_Fixed::Select_Priority_Fixed (string name,22 string name, 21 23 #endif 22 24 #ifdef STATISTICS 23 morpheo::behavioural::Parameters_Statisticsparam_statistics,25 morpheo::behavioural::Parameters_Statistics * param_statistics, 24 26 #endif 25 morpheo::behavioural::generic::select::select_priority_fixed::Parameters param ): 26 _name (name) 27 ,_param (param) 27 morpheo::behavioural::generic::select::select_priority_fixed::Parameters * param, 28 morpheo::behavioural::Tusage_t usage ): 29 _name (name), 30 _param (param), 31 _usage (usage) 28 32 // #ifdef STATISTICS 29 33 // ,_param_statistics (param_statistics) … … 32 36 log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin"); 33 37 34 #ifdef SYSTEMC35 38 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation"); 36 37 39 allocation (); 38 #endif39 40 40 41 #ifdef STATISTICS … … 55 56 56 57 #ifdef SYSTEMC 57 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 58 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition"); 59 60 SC_METHOD (transition); 61 dont_initialize (); 62 sensitive_pos << *(in_CLOCK); 63 #endif 64 65 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity"); 66 67 SC_METHOD (genMealy_entity); 68 dont_initialize (); 69 //sensitive_pos << *(in_CLOCK); 70 for (uint32_t i=0; i<_param._nb_entity; i++) 71 sensitive << *(in_VAL [i]); 72 58 if (_usage & USE_SYSTEMC) 59 { 60 # if defined(STATISTICS) or defined(VHDL_TESTBENCH) 61 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition"); 62 63 SC_METHOD (transition); 64 dont_initialize (); 65 sensitive_pos << *(in_CLOCK); 66 # endif 67 68 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity"); 69 70 SC_METHOD (genMealy_entity); 71 dont_initialize (); 72 //sensitive_pos << *(in_CLOCK); 73 for (uint32_t i=0; i<_param->_nb_entity; i++) 74 sensitive << *(in_VAL [i]); 75 73 76 # ifdef SYSTEMCASS_SPECIFIC 74 // List dependency information 75 76 for (uint32_t i=0; i<_param._nb_entity; i++) 77 { 78 if (_param._encoding_one_hot) 79 (*(out_ACK [i])) (*(in_VAL [i])); 80 if (_param._encoding_compact) 77 // List dependency information 78 79 for (uint32_t i=0; i<_param->_nb_entity; i++) 81 80 { 82 (*(out_ENTITY )) (*(in_VAL [i])); 83 (*(out_ENTITY_ACK)) (*(in_VAL [i])); 81 if (_param->_encoding_one_hot) 82 (*(out_ACK [i])) (*(in_VAL [i])); 83 if (_param->_encoding_compact) 84 { 85 (*(out_ENTITY )) (*(in_VAL [i])); 86 (*(out_ENTITY_ACK)) (*(in_VAL [i])); 87 } 84 88 } 89 90 # endif 85 91 } 86 87 # endif88 92 #endif 89 93 log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp
r42 r57 19 19 log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin"); 20 20 21 _component = new Component ( );21 _component = new Component (_usage); 22 22 23 23 Entity * entity = _component->set_entity (_name 24 ,"Select_Priority_Fixed" 24 25 #ifdef POSITION 25 ,"Select_Priority_Fixed"26 26 ,COMBINATORY 27 27 #endif … … 41 41 42 42 in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_NO); 43 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1); 44 in_VAL = new SC_IN (Tcontrol_t) * [_param._nb_entity]; 45 if (_param._encoding_one_hot) 46 out_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_entity]; 43 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_NO); 47 44 48 for (uint32_t i=0; i<_param._nb_entity; i++) 45 in_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_entity]; 46 if (_param->_encoding_one_hot) 47 out_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_entity]; 48 49 for (uint32_t i=0; i<_param->_nb_entity; i++) 49 50 { 50 51 in_VAL [i] = interface->set_signal_in <Tcontrol_t> ("val_"+toString(i),1); 51 if (_param ._encoding_one_hot)52 if (_param->_encoding_one_hot) 52 53 out_ACK [i] = interface->set_signal_out <Tcontrol_t> ("ack_"+toString(i),1); 53 54 } 54 55 55 if (_param ._encoding_compact)56 if (_param->_encoding_compact) 56 57 { 57 out_ENTITY = interface->set_signal_out <Tentity_t > ("entity" , _param ._size_entity);58 out_ENTITY = interface->set_signal_out <Tentity_t > ("entity" , _param->_size_entity); 58 59 out_ENTITY_ACK = interface->set_signal_out <Tcontrol_t> ("entity_ack", 1); 59 60 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp
r42 r57 20 20 log_printf(FUNC,Select_Priority_Fixed,"deallocation","Begin"); 21 21 22 delete in_CLOCK; 23 delete in_NRESET; 24 25 delete [] in_VAL; 26 if (_param._encoding_one_hot) 27 delete [] out_ACK; 28 29 if (_param._encoding_compact) 22 if (_usage & USE_SYSTEMC) 30 23 { 31 delete out_ENTITY; 32 delete out_ENTITY_ACK; 24 delete in_CLOCK; 25 delete in_NRESET; 26 27 delete [] in_VAL; 28 if (_param->_encoding_one_hot) 29 delete [] out_ACK; 30 31 if (_param->_encoding_compact) 32 { 33 delete out_ENTITY; 34 delete out_ENTITY_ACK; 35 } 33 36 } 34 37 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 38 36 39 delete _component; 37 40 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_genMealy_entity.cpp
r40 r57 22 22 // init 23 23 24 Tcontrol_t ack [_param ._nb_entity];24 Tcontrol_t ack [_param->_nb_entity]; 25 25 bool find = false; 26 26 Tentity_t entity; 27 27 28 if (_param ._encoding_one_hot)29 for (uint32_t i=0; i<_param ._nb_entity; i++)28 if (_param->_encoding_one_hot) 29 for (uint32_t i=0; i<_param->_nb_entity; i++) 30 30 ack [i] = 0; 31 31 32 32 log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Scearch..."); 33 for (entity=0; entity<_param ._nb_entity; entity++)33 for (entity=0; entity<_param->_nb_entity; entity++) 34 34 { 35 35 if (PORT_READ(in_VAL [entity]) == 1) 36 36 { 37 37 log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Find! entity %d",entity); 38 if (_param ._encoding_one_hot)38 if (_param->_encoding_one_hot) 39 39 ack [entity] = 1; 40 40 find = true; … … 44 44 45 45 // Write port 46 if (_param ._encoding_one_hot)47 for (uint32_t i=0; i<_param ._nb_entity; i++)46 if (_param->_encoding_one_hot) 47 for (uint32_t i=0; i<_param->_nb_entity; i++) 48 48 PORT_WRITE(out_ACK [i], ack [i]); 49 49 50 if (_param ._encoding_compact)50 if (_param->_encoding_compact) 51 51 { 52 52 PORT_WRITE(out_ENTITY , (find==true)?entity:0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_body.cpp
r29 r57 22 22 23 23 vhdl->set_body("internal_entity <="); 24 for (uint32_t i=0; i<_param ._nb_entity; i++)24 for (uint32_t i=0; i<_param->_nb_entity; i++) 25 25 { 26 vhdl->set_body("\t"+std_logic_conv(_param ._size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else");26 vhdl->set_body("\t"+std_logic_conv(_param->_size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else"); 27 27 } 28 vhdl->set_body("\t"+std_logic_conv(_param ._size_entity+1,1<<_param._size_entity)+";");28 vhdl->set_body("\t"+std_logic_conv(_param->_size_entity+1,1<<_param->_size_entity)+";"); 29 29 vhdl->set_body (""); 30 30 31 if (_param ._encoding_one_hot)31 if (_param->_encoding_one_hot) 32 32 { 33 for (uint32_t i=0; i<_param ._nb_entity; i++)34 vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param ._size_entity+1)+" = "+std_logic_conv(_param._size_entity+1,i)+" else '0';");33 for (uint32_t i=0; i<_param->_nb_entity; i++) 34 vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param->_size_entity+1)+" = "+std_logic_conv(_param->_size_entity+1,i)+" else '0';"); 35 35 vhdl->set_body (""); 36 36 } 37 37 38 if (_param ._encoding_compact)38 if (_param->_encoding_compact) 39 39 { 40 vhdl->set_body ("out_ENTITY <= internal_entity"+std_logic_range(_param ._size_entity-1, 0)+";");41 vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param ._size_entity ,_param._size_entity)+";");40 vhdl->set_body ("out_ENTITY <= internal_entity"+std_logic_range(_param->_size_entity-1, 0)+";"); 41 vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param->_size_entity ,_param->_size_entity)+";"); 42 42 } 43 43 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_declaration.cpp
r29 r57 20 20 log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","Begin"); 21 21 22 vhdl->set_signal("internal_entity",_param ._size_entity+1);22 vhdl->set_signal("internal_entity",_param->_size_entity+1); 23 23 24 24 log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Statistics.cpp
r15 r57 17 17 18 18 Statistics::Statistics (string name , 19 morpheo::behavioural::Parameters_Statistics parameters_statistics ,20 Parameters parameters19 morpheo::behavioural::Parameters_Statistics * parameters_statistics , 20 Parameters * parameters 21 21 ) : 22 22 morpheo::behavioural::Statistics(name , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags
r56 r57 15 15 #-----[ Flags ]-------------------------------------------- 16 16 MORPHEO_FLAGS = -DSYSTEMC \ 17 -DVHDL \ 18 -DVHDL_TESTBENCH \ 19 -DVHDL_TESTBENCH_ASSERT \ 20 -DSTATISTICS \ 17 21 -DDEBUG=DEBUG_TRACE 18 22 19 # -DVHDL \ 20 # -DVHDL_TESTBENCH \ 21 # -DSTATISTICS \ 22 # -DVHDL_TESTBENCH_ASSERT \ 23 23 24 # -DCONFIGURATION \ 24 25 # -DPOSITION \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.mkf
r55 r57 3 3 # 4 4 5 all: _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest Generic/Select/Priority_Fixed/SelfTest Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest5 all: _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest _Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest _Generic/Select/Select_Priority_Fixed/SelfTest 6 6 7 7 _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest: 8 8 gmake all -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 9 9 10 Generic/Select/Priority_Fixed/SelfTest: 10 _Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest: 11 gmake all -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 11 12 12 Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest: 13 _Generic/Select/Select_Priority_Fixed/SelfTest: 14 gmake all -C Generic/Select/Select_Priority_Fixed/SelfTest 13 15 14 16 clean: 15 17 gmake clean -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 18 gmake clean -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 19 gmake clean -C Generic/Select/Select_Priority_Fixed/SelfTest 16 20 17 21 re: clean all … … 19 23 install: 20 24 gmake install -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 25 gmake install -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 26 gmake install -C Generic/Select/Select_Priority_Fixed/SelfTest 21 27 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h
r53 r57 16 16 #include "Common/include/ToString.h" 17 17 #include "Common/include/Debug.h" 18 #include "Behavioural/include/Types.h" 18 19 19 20 #include "Behavioural/@DIRECTORY/include/Parameters.h" 20 #include "Behavioural/@DIRECTORY/include/Types.h"21 21 #ifdef STATISTICS 22 22 #include "Behavioural/@DIRECTORY/include/Statistics.h" … … 26 26 #include "Behavioural/include/Vhdl.h" 27 27 #endif 28 #include "Behavioural/include/Usage.h" 28 29 29 30 using namespace std; … … 31 32 namespace morpheo { 32 33 namespace behavioural { 34 33 35 @NAMESPACE_BEGIN 34 36 … … 41 43 // Parameters 42 44 protected : const string _name; 45 protected : const Parameters * _param; 46 private : const Tusage_t _usage; 43 47 44 protected : const Parameters * _param;45 48 //#ifdef STATISTICS 46 49 // protected : const morpheo::behavioural::Parameters_Statistics * _param_statistics; … … 72 75 SC_HAS_PROCESS (@COMPONENT); 73 76 #endif 74 public : @COMPONENT ( 77 public : @COMPONENT 78 ( 75 79 #ifdef SYSTEMC 76 80 sc_module_name name, 77 81 #else 78 82 string name, 79 83 #endif 80 84 #ifdef STATISTICS 81 85 morpheo::behavioural::Parameters_Statistics * param_statistics, 82 86 #endif 83 Parameters * param ); 87 Parameters * param, 88 morpheo::behavioural::Tusage_t usage=USE_ALL 89 ); 84 90 public : ~@COMPONENT (void); 85 91 86 #ifdef SYSTEMC87 92 private : void allocation (void); 88 93 private : void deallocation (void); 89 94 95 #ifdef SYSTEMC 90 96 //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) 91 97 public : void transition (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component.cpp
r53 r57 14 14 #undef FUNCTION 15 15 #define FUNCTION "@COMPONENT::@COMPONENT" 16 @COMPONENT::@COMPONENT 17 ( 16 18 #ifdef SYSTEMC 17 @COMPONENT::@COMPONENT (sc_module_name name,19 sc_module_name name, 18 20 #else 19 @COMPONENT::@COMPONENT (string name,21 string name, 20 22 #endif 21 23 #ifdef STATISTICS 22 24 morpheo::behavioural::Parameters_Statistics * param_statistics, 23 25 #endif 24 morpheo::behavioural::@NAMESPACE_USE::Parameters * param ): 25 _name (name) 26 ,_param (param) 26 morpheo::behavioural::@NAMESPACE_USE::Parameters * param, 27 morpheo::behavioural::Tusage_t usage 28 ): 29 _name (name) 30 ,_param (param) 31 ,_usage (usage) 27 32 // #ifdef STATISTICS 28 33 // ,_param_statistics (param_statistics) … … 31 36 log_printf(FUNC,@COMPONENT,FUNCTION,"Begin"); 32 37 33 #ifdef SYSTEMC34 38 log_printf(INFO,@COMPONENT,FUNCTION,"Allocation"); 35 36 39 allocation (); 37 #endif38 40 39 41 #ifdef STATISTICS … … 80 82 81 83 _stat->generate_file(statistics(0)); 82 83 84 delete _stat; 84 85 #endif 85 86 86 #ifdef SYSTEMC87 87 log_printf(INFO,@COMPONENT,FUNCTION,"Deallocation"); 88 89 88 deallocation (); 90 #endif91 89 92 90 log_printf(FUNC,@COMPONENT,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_allocation.cpp
r53 r57 1 #ifdef SYSTEMC2 1 /* 3 2 * $Id$ … … 58 57 }; // end namespace behavioural 59 58 }; // end namespace morpheo 60 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_deallocation.cpp
r53 r57 1 #undef FUNCTION2 #define FUNCTION "@COMPONENT::"3 4 #ifdef SYSTEMC5 1 /* 6 2 * $Id$ … … 37 33 }; // end namespace behavioural 38 34 }; // end namespace morpheo 39 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_msg_error.cpp
r53 r57 6 6 */ 7 7 8 #include "Behavioural/include/Types.h" 8 9 #include "Behavioural/@DIRECTORY/include/Parameters.h" 9 #include "Behavioural/@DIRECTORY/include/Types.h"10 10 #include <sstream> 11 11 using namespace std; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h
r44 r57 20 20 #include "Common/include/ToString.h" 21 21 #include "Common/include/Debug.h" 22 #include "Behavioural/include/Usage.h" 22 23 23 24 using namespace std; … … 26 27 namespace behavioural { 27 28 29 typedef uint8_t Tinstance_t; 30 31 #define INSTANCE_NONE 0x0 32 #define INSTANCE_LIBRARY 0x1 33 #define INSTANCE_COMPONENT 0x2 34 #define INSTANCE_POSITION 0x4 35 #define INSTANCE_ALL 0x7 36 37 typedef struct 38 { 39 public : Tinstance_t _instance; 40 public : Entity * _entity ; 41 } Tcomponent_t; 42 28 43 class Component 29 44 { 30 45 // -----[ fields ]---------------------------------------------------- 46 private : const Tusage_t _usage; 31 47 private : Entity * _entity ; 32 private : list< Entity *>* _list_component;33 48 private : list<Tcomponent_t*> * _list_component; 49 34 50 // -----[ methods ]--------------------------------------------------- 35 public : Component ( void);51 public : Component (Tusage_t usage=USE_ALL); 36 52 public : Component (const Component & component); 37 53 public : ~Component (); … … 52 68 ,uint32_t size_y 53 69 #endif 70 ,Tinstance_t instance=INSTANCE_ALL 54 71 ); 55 72 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h
r44 r57 18 18 #include "Common/include/ToString.h" 19 19 #include "Common/include/Debug.h" 20 #include "Behavioural/include/Usage.h" 20 21 21 22 using namespace std; … … 32 33 private : const schema_t _schema ; 33 34 #endif 35 private : const Tusage_t _usage; 36 34 37 private : Interfaces * _interfaces ; 35 38 … … 50 53 ,schema_t schema 51 54 #endif 55 ,Tusage_t usage=USE_ALL 52 56 ); 53 57 public : Entity (const Entity & entity); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r44 r57 25 25 #include "Common/include/ErrorMorpheo.h" 26 26 #include "Common/include/Debug.h" 27 #include "Behavioural/include/Usage.h" 27 28 28 29 using namespace std; … … 38 39 protected : const direction_t _direction ; 39 40 protected : const localisation_t _localisation ; 41 #endif 42 protected : const Tusage_t _usage; 43 44 #ifdef POSITION 40 45 protected : string _comment ; 41 46 #endif … … 59 64 ,localisation_t localisation 60 65 #endif 66 ,Tusage_t usage=USE_ALL 61 67 ); 62 68 … … 97 103 98 104 Signal * sig = set_signal (name, IN , size, presence_port); 99 sc_in_clk * port = new sc_in_clk (sig->_name.c_str()); 100 101 sig->alloc<bool> (static_cast<void *>(port)); 105 sc_in_clk * port; 106 107 if (_usage & USE_SYSTEMC) 108 { 109 port = new sc_in_clk (sig->_name.c_str()); 110 sig->alloc<bool> (static_cast<void *>(port)); 111 } 112 else 113 { 114 port = NULL; 115 } 102 116 103 117 log_printf(FUNC,Behavioural,"set_signal_clk","End"); … … 118 132 119 133 Signal * sig = set_signal (name, IN , size, presence_port); 120 sc_in <T> * port = new sc_in <T> (sig->_name.c_str()); 121 122 sig->alloc<T> (static_cast<void *>(port)); 134 sc_in <T> * port; 135 136 if (_usage & USE_SYSTEMC) 137 { 138 port = new sc_in <T> (sig->_name.c_str()); 139 sig->alloc<T> (static_cast<void *>(port)); 140 } 141 else 142 { 143 port = NULL; 144 } 123 145 124 146 log_printf(FUNC,Behavioural,"set_signal_in","End"); … … 139 161 140 162 Signal * sig = set_signal (name, OUT , size, presence_port); 141 sc_out <T> * port = new sc_out <T> (sig->_name.c_str()); 142 143 sig->alloc<T> (static_cast<void *>(port)); 163 sc_out <T> * port; 164 165 if (_usage & USE_SYSTEMC) 166 { 167 port = new sc_out <T> (sig->_name.c_str()); 168 sig->alloc<T> (static_cast<void *>(port)); 169 } 170 else 171 { 172 port = NULL; 173 } 144 174 145 175 log_printf(FUNC,Behavioural,"set_signal_out","End"); … … 155 185 156 186 Signal * sig = set_signal (name, INTERNAL , size, PORT_VHDL_NO_TESTBENCH_NO); 157 sc_signal <T> * port = new sc_signal <T> (sig->_name.c_str()); 158 159 sig->alloc<T> (static_cast<void *>(port)); 187 sc_signal <T> * port; 188 189 if (_usage & USE_SYSTEMC) 190 { 191 port = new sc_signal <T> (sig->_name.c_str()); 192 sig->alloc<T> (static_cast<void *>(port)); 193 } 194 else 195 { 196 port = NULL; 197 } 160 198 161 199 log_printf(FUNC,Behavioural,"set_signal_internal","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.h
r55 r57 45 45 ,localisation_t localisation 46 46 #endif 47 ,Tusage_t usage=USE_ALL 47 48 ); 48 49 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
r44 r57 18 18 #include "Behavioural/include/Vhdl.h" 19 19 #endif 20 #include "Behavioural/include/Usage.h" 20 21 21 22 using namespace std; … … 28 29 // -----[ fields ]---------------------------------------------------- 29 30 private : const string _name; 31 private : const Tusage_t _usage; 30 32 private : list<Interface_fifo*> * _list_interface; 31 33 32 34 // -----[ methods ]--------------------------------------------------- 33 public : Interfaces (string name); 35 public : Interfaces (string name, 36 Tusage_t usage=USE_ALL); 34 37 public : Interfaces (const Interfaces & interfaces); 35 38 public : ~Interfaces (); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/mkf.info
r42 r57 15 15 16 16 # build src directory content 17 #target_dep all Generic/Counter/SelfTest18 17 target_dep all Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 19 #target_dep all Generic/Shifter/SelfTest 20 target_dep all Generic/Select/Priority_Fixed/SelfTest 21 #target_dep all Generic/Victim/Pseudo_LRU/SelfTest 22 #target_dep all Stage_1_Ifetch/Predictor/Meta_Predictor/SelfTest 23 #target_dep all Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest 24 #target_dep all Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest 25 #target_dep all Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest 26 #target_dep all Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest 27 target_dep all Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest 28 #target_dep all Stage_5_Execute/Execution_cluster/Execution_group/Execution_unit/SelfTest 18 target_dep all Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 19 target_dep all Generic/Select/Select_Priority_Fixed/SelfTest 29 20 30 21 # mkf include path -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp
r43 r57 11 11 namespace behavioural { 12 12 13 Component::Component (void) 13 Component::Component (Tusage_t usage): 14 _usage (usage) 14 15 { 15 16 log_printf(FUNC,Behavioural,"Component::Component","Begin"); 16 _list_component = new list< Entity*>;17 _list_component = new list<Tcomponent_t *>; 17 18 log_printf(FUNC,Behavioural,"Component::Component","End"); 18 19 }; 19 20 20 Component::Component (const Component & component) 21 Component::Component (const Component & component): 22 _usage (component._usage) 21 23 { 22 24 log_printf(FUNC,Behavioural,"Component::Component (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_find_entity.cpp
r43 r57 22 22 if (_list_component->empty()== false) 23 23 { 24 list< Entity*>::iterator i = _list_component->begin();24 list<Tcomponent_t *>::iterator i = _list_component->begin(); 25 25 26 26 while (i != _list_component->end()) 27 27 { 28 if ((*i)->get_name() == name) 28 Entity * entity = (*i)->_entity; 29 30 if (entity->get_name() == name) 29 31 { 30 _return = *i;32 _return = entity; 31 33 break; 32 34 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_component.cpp
r43 r57 22 22 bool last_separator = false; 23 23 24 list< Entity*>::iterator i = _list_component->begin();24 list<Tcomponent_t *>::iterator i = _list_component->begin(); 25 25 bool empty = _list_component->empty(); 26 26 … … 33 33 if (i != _list_component->end()) 34 34 { 35 text << tab << * *i;35 text << tab << *((*i)->_entity); 36 36 ++i; 37 37 } … … 40 40 { 41 41 text << separator; 42 text << tab << * *i;42 text << tab << *((*i)->_entity); 43 43 ++i; 44 44 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp
r43 r57 15 15 void Component::set_component (Component * component 16 16 #ifdef POSITION 17 ,uint32_t pos_x18 ,uint32_t pos_y19 ,uint32_t size_x20 ,uint32_t size_y17 ,uint32_t pos_x 18 ,uint32_t pos_y 19 ,uint32_t size_x 20 ,uint32_t size_y 21 21 #endif 22 ,Tinstance_t instance 22 23 ) 23 24 { … … 26 27 Entity * entity = component->_entity; 27 28 28 _list_component->push_back(entity); 29 Tcomponent_t * entry = new Tcomponent_t; 30 31 entry->_instance = instance; 32 entry->_entity = entity; 33 34 _list_component->push_back(entry); 29 35 30 36 #ifdef POSITION 31 entity->mapping( pos_x, pos_y, size_x, size_y); 37 if (instance & INSTANCE_POSITION) 38 entity->mapping( pos_x, pos_y, size_x, size_y); 32 39 #endif 33 40 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp
r43 r57 27 27 ,schema 28 28 #endif 29 ,_usage 29 30 ); 30 31 _entity = entity; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_toXML.cpp
r43 r57 27 27 if (_list_component->empty()== false) 28 28 { 29 list< Entity*>::iterator i = _list_component->begin();29 list<Tcomponent_t *>::iterator i = _list_component->begin(); 30 30 31 31 while (i != _list_component->end()) 32 32 { 33 xml.insert_XML ((*i)-> toXML_mapping());33 xml.insert_XML ((*i)->_entity->toXML_mapping()); 34 34 ++i; 35 35 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp
r44 r57 75 75 76 76 // for each entity 77 list< Entity*> * list_component = _list_component;78 list< Entity*>::iterator i = list_component->begin();77 list<Tcomponent_t *> * list_component = _list_component; 78 list<Tcomponent_t *>::iterator i = list_component->begin(); 79 79 if (not list_component->empty()) 80 80 { 81 81 while (i != list_component->end()) 82 82 { 83 vhdl->set_library_work ((*i)->get_name() + "_Pack"); 83 Entity * entity = (*i)->_entity; 84 Tinstance_t instance = (*i)->_instance; 85 86 if (instance & INSTANCE_LIBRARY) 87 vhdl->set_library_work (entity->get_name() + "_Pack"); 84 88 85 list<string> list_port_map; 86 87 // for each interface 88 list<Interface_fifo *> * list_interface = (*i)->get_interfaces_list()->get_interface_list(); 89 list<Interface_fifo *>::iterator j = list_interface->begin(); 90 if (not list_interface->empty()) 91 { 92 while (j != list_interface->end()) 93 { 94 // for each signal 95 list<Signal *> * list_signal = (*j)->get_signal_list(); 96 list<Signal *>::iterator k = list_signal->begin(); 97 if (not list_signal->empty()) 98 { 99 while (k != list_signal->end()) 100 { 101 // test if is connect with external interface or with an another component. 102 Signal * signal_src = (*k); 103 104 if (signal_src->presence_vhdl () == true) 105 { 106 Signal * signal_dest = signal_src->get_connect_to_signal(); 107 string name_src = signal_src->get_name(); 108 string name_dest; 109 89 if (instance & INSTANCE_COMPONENT) 90 { 91 list<string> list_port_map; 92 93 // for each interface 94 list<Interface_fifo *> * list_interface = entity->get_interfaces_list()->get_interface_list(); 95 list<Interface_fifo *>::iterator j = list_interface->begin(); 96 if (not list_interface->empty()) 97 { 98 while (j != list_interface->end()) 99 { 100 // for each signal 101 list<Signal *> * list_signal = (*j)->get_signal_list(); 102 list<Signal *>::iterator k = list_signal->begin(); 103 if (not list_signal->empty()) 104 { 105 while (k != list_signal->end()) 106 { 107 // test if is connect with external interface or with an another component. 108 Signal * signal_src = (*k); 109 110 if (signal_src->presence_vhdl () == true) 111 { 112 Signal * signal_dest = signal_src->get_connect_to_signal(); 113 string name_src = signal_src->get_name(); 114 string name_dest; 115 110 116 // // Test if destination signal is a interface port ? 111 117 // if (_entity->find_signal(signal_dest) == false) 112 118 // { 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 119 // find if signal is already link 120 map<Signal *,string>::iterator it = tab.find(signal_dest); 121 if (tab.find(signal_dest) == tab.end()) 122 { 123 // Create name 124 name_dest = "signal_"+toString(cpt++); 125 126 tab [signal_src ] = name_dest; 127 tab [signal_dest] = name_dest; 128 129 // Add a new signal 130 vhdl->set_signal (name_dest, signal_src->get_size()); 131 } 132 else 133 { 134 // find !!!! 135 name_dest = (*it).second; 136 tab [signal_src ] = name_dest; 137 } 132 138 // } 133 139 // else … … 150 156 // } 151 157 152 vhdl->set_body_component_port_map (list_port_map, name_src, name_dest); 153 } 154 ++k; 155 } 156 } 157 ++j; 158 } 159 } 160 vhdl->set_body_component ("instance_"+(*i)->get_name(),(*i)->get_name(),list_port_map); 158 vhdl->set_body_component_port_map (list_port_map, name_src, name_dest); 159 } 160 ++k; 161 } 162 } 163 ++j; 164 } 165 } 166 vhdl->set_body_component ("instance_"+entity->get_name(),entity->get_name(),list_port_map); 167 168 } 161 169 ++i; 162 170 } … … 164 172 log_printf(FUNC,Behavioural,FUNCTION,"End"); 165 173 }; 166 174 167 175 }; // end namespace behavioural 168 176 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp
r42 r57 16 16 ,schema_t schema 17 17 #endif 18 ,Tusage_t usage 18 19 ): 19 20 _name (name ) … … 22 23 ,_schema (schema ) 23 24 #endif 25 ,_usage (usage ) 24 26 { 25 27 log_printf(FUNC,Behavioural,"Entity","Begin"); 26 _interfaces = new Interfaces (name );28 _interfaces = new Interfaces (name, usage); 27 29 #ifdef POSITION 28 30 _is_map = false; … … 37 39 ,_schema (entity._schema ) 38 40 #endif 41 ,_usage (entity._usage ) 39 42 { 40 43 log_printf(FUNC,Behavioural,"Entity (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r42 r57 16 16 ,localisation_t localisation 17 17 #endif 18 ,Tusage_t usage 18 19 ): 19 20 _name (name ) … … 22 23 ,_localisation (localisation) 23 24 #endif 25 ,_usage (usage) 24 26 { 25 27 log_printf(FUNC,Behavioural,"Interface","Begin"); … … 47 49 ,_localisation (interface._localisation) 48 50 #endif 51 ,_usage (interface._usage) 49 52 { 50 53 log_printf(FUNC,Behavioural,"Interface (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp
r42 r57 16 16 ,localisation_t localisation 17 17 #endif 18 ,Tusage_t usage 18 19 ): 19 20 Interface (name … … 22 23 ,localisation 23 24 #endif 25 ,usage 24 26 ) 25 27 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r41 r57 11 11 namespace behavioural { 12 12 13 Interfaces::Interfaces (string name): 14 _name (name) 13 Interfaces::Interfaces (string name, 14 Tusage_t usage): 15 _name (name), 16 _usage (usage) 15 17 { 16 18 log_printf(FUNC,Behavioural,"Interfaces","Begin"); … … 20 22 21 23 Interfaces::Interfaces (const Interfaces & interfaces) : 22 _name (interfaces._name) 24 _name (interfaces._name), 25 _usage (interfaces._usage) 23 26 { 24 27 log_printf(FUNC,Behavioural,"Interfaces (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp
r43 r57 27 27 ,localisation 28 28 #endif 29 );29 ,_usage); 30 30 31 31 _list_interface->push_back (interface); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp
r43 r57 66 66 string type; 67 67 68 if (max == min)69 type = " ("+toString(max)+")";68 if (max == 0) 69 type = ""; 70 70 else 71 type = "("+toString(max)+" downto "+toString(min)+")"; 71 if (max == min) 72 type = "("+toString(max)+")"; 73 else 74 type = "("+toString(max)+" downto "+toString(min)+")"; 72 75 73 76 log_printf(FUNC,Behavioural,FUNCTION,"End");
Note: See TracChangeset
for help on using the changeset viewer.