Changeset 100 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/test.cpp
- Timestamp:
- Jan 8, 2009, 2:06:27 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:ignore
set to
Makefile.flags
Makefile.tools
Makefile.tools_path
-
Property
svn:ignore
set to
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/test.cpp
r88 r100 11 11 12 12 #include "Behavioural/Generic/Queue/SelfTest/include/test.h" 13 #include "Behavioural/include/Allocation.h" 13 14 #include "Common/include/Test.h" 14 15 … … 48 49 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 49 50 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 50 sc_signal<Tcontrol_t> * in_INSERT_VAL = new sc_signal<Tcontrol_t> ( "in_INSERT_VAL" ); 51 sc_signal<Tcontrol_t> * out_INSERT_ACK = new sc_signal<Tcontrol_t> ("out_INSERT_ACK" ); 52 sc_signal<Tdata_t > * in_INSERT_DATA = new sc_signal<Tdata_t > ( "in_INSERT_DATA"); 53 sc_signal<Tcontrol_t> * out_RETIRE_VAL = new sc_signal<Tcontrol_t> ("out_RETIRE_VAL" ); 54 sc_signal<Tcontrol_t> * in_RETIRE_ACK = new sc_signal<Tcontrol_t> ( "in_RETIRE_ACK" ); 55 sc_signal<Tdata_t > * out_RETIRE_DATA = new sc_signal<Tdata_t > ("out_RETIRE_DATA"); 51 52 ALLOC0_SC_SIGNAL( in_INSERT_VAL , "in_INSERT_VAL" ,Tcontrol_t); 53 ALLOC0_SC_SIGNAL(out_INSERT_ACK ,"out_INSERT_ACK" ,Tcontrol_t); 54 ALLOC0_SC_SIGNAL( in_INSERT_DATA, "in_INSERT_DATA",Tdata_t ); 55 ALLOC0_SC_SIGNAL(out_RETIRE_VAL ,"out_RETIRE_VAL" ,Tcontrol_t); 56 ALLOC0_SC_SIGNAL( in_RETIRE_ACK , "in_RETIRE_ACK" ,Tcontrol_t); 57 ALLOC0_SC_SIGNAL(out_RETIRE_DATA,"out_RETIRE_DATA",Tdata_t ); 58 ALLOC1_SC_SIGNAL(out_SLOT_VAL ,"out_SLOT_VAL" ,Tcontrol_t,_param->_nb_port_slot); 59 ALLOC1_SC_SIGNAL(out_SLOT_DATA ,"out_SLOT_DATA" ,Tdata_t ,_param->_nb_port_slot); 56 60 57 61 /******************************************************** … … 64 68 (*(_Queue->in_NRESET)) (*(in_NRESET)); 65 69 66 (*(_Queue-> in_INSERT_VAL )) (*( in_INSERT_VAL )); 67 (*(_Queue->out_INSERT_ACK )) (*(out_INSERT_ACK )); 68 (*(_Queue-> in_INSERT_DATA)) (*( in_INSERT_DATA)); 69 (*(_Queue->out_RETIRE_VAL )) (*(out_RETIRE_VAL )); 70 (*(_Queue-> in_RETIRE_ACK )) (*( in_RETIRE_ACK )); 71 (*(_Queue->out_RETIRE_DATA)) (*(out_RETIRE_DATA)); 70 INSTANCE0_SC_SIGNAL(_Queue, in_INSERT_VAL ); 71 INSTANCE0_SC_SIGNAL(_Queue,out_INSERT_ACK ); 72 INSTANCE0_SC_SIGNAL(_Queue, in_INSERT_DATA); 73 INSTANCE0_SC_SIGNAL(_Queue,out_RETIRE_VAL ); 74 INSTANCE0_SC_SIGNAL(_Queue, in_RETIRE_ACK ); 75 INSTANCE0_SC_SIGNAL(_Queue,out_RETIRE_DATA); 76 INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_VAL ,_param->_nb_port_slot); 77 INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_DATA ,_param->_nb_port_slot); 72 78 73 79 cout << "<" << name << "> Start Simulation ............" << endl; … … 103 109 uint32_t data_in = 0; 104 110 uint32_t data_out = 0; 111 uint32_t nb_elt = 0; 105 112 106 113 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) … … 116 123 SC_START(0); // genMoore 117 124 125 for (uint32_t i=0; i<_param->_nb_port_slot; ++i) 126 { 127 TEST(Tcontrol_t, out_SLOT_VAL [i]->read(), (i<nb_elt)); 128 if (i<nb_elt) 129 TEST(Tdata_t , out_SLOT_DATA[i]->read(), data_out+i); 130 131 } 132 118 133 if ( in_INSERT_VAL->read() and out_INSERT_ACK->read()) 119 134 { 120 135 LABEL ("Transaction with interface : INSERT"); 121 136 data_in ++; 137 nb_elt ++; 122 138 } 123 139 if (out_RETIRE_VAL->read() and in_RETIRE_ACK->read()) … … 126 142 TEST(Tdata_t, out_RETIRE_DATA->read(), data_out); 127 143 data_out++; 144 nb_elt --; 128 145 } 129 146 … … 142 159 delete in_CLOCK; 143 160 delete in_NRESET; 161 162 DELETE0_SC_SIGNAL( in_INSERT_VAL ); 163 DELETE0_SC_SIGNAL(out_INSERT_ACK ); 164 DELETE0_SC_SIGNAL( in_INSERT_DATA); 165 DELETE0_SC_SIGNAL(out_RETIRE_VAL ); 166 DELETE0_SC_SIGNAL( in_RETIRE_ACK ); 167 DELETE0_SC_SIGNAL(out_RETIRE_DATA); 168 DELETE1_SC_SIGNAL(out_SLOT_VAL ,_param->_nb_port_slot); 169 DELETE1_SC_SIGNAL(out_SLOT_DATA ,_param->_nb_port_slot); 170 144 171 #endif 145 172
Note: See TracChangeset
for help on using the changeset viewer.