Changeset 57 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/test.cpp
- Timestamp:
- Sep 28, 2007, 2:58:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.