Changeset 78 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest
- Timestamp:
- Mar 27, 2008, 11:04:49 AM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/configuration.cfg
r42 r78 1 1 Victim_Pseudo_LRU 2 4 16 * 2# nb_entity3 1 4 * 2 # nb_access4 1 4 *2 # nb_update5 1 16 *2 # size_table 2 4 16 *4 # nb_entity 3 1 4 *4 # nb_access # 1 4 *4 # nb_update 4 1 16 *4 # size_table 5 0 1 +1 # table_global -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/src/main.cpp
r15 r78 14 14 cerr << "<Usage> " << exec << " name_instance list_params" << endl 15 15 << "list_params is :" << endl 16 << " - nb_entity (unsigned int)" << endl 17 << " - nb_access (unsigned int)" << endl 18 << " - nb_update (unsigned int)" << endl 19 << " - size_table (unsigned int)" << endl; 16 << " - nb_entity (unsigned int)" << endl 17 << " - nb_access (unsigned int)" << endl 18 // << " - nb_update (unsigned int)" << endl 19 << " - size_table (unsigned int)" << endl 20 << " - table_global (bool )" << endl; 20 21 exit (1); 21 22 } … … 30 31 usage (argv[0]); 31 32 32 const string name = argv[1]; 33 const uint32_t nb_entity = atoi(argv[2]); 34 const uint32_t nb_access = atoi(argv[3]); 35 const uint32_t nb_update = atoi(argv[4]); 36 const uint32_t size_table = atoi(argv[5]); 37 38 morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters param (nb_entity , 39 nb_access , 40 nb_update , 41 size_table); 33 const string name = argv[1]; 34 const uint32_t nb_entity = atoi(argv[2]); 35 const uint32_t nb_access = atoi(argv[3]); 36 // const uint32_t nb_update = atoi(argv[4]); 37 const uint32_t size_table = atoi(argv[4]); 38 const bool table_global = atoi(argv[5]); 39 morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters param 40 (nb_entity , 41 nb_access , 42 // nb_update , 43 size_table, 44 table_global); 42 45 43 46 test (name,param); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/src/test.cpp
r75 r78 15 15 cout << "<" << name << "> : Simulation SystemC" << endl; 16 16 17 if (param._nb_update < 1)18 {19 cerr << "<" << name << "> : To test, need a less one update's port" << endl;20 exit (EXIT_FAILURE);21 }22 23 17 try 24 18 { … … 45 39 param_stat, 46 40 #endif 47 param);41 ¶m); 48 42 49 43 #ifdef SYSTEMC … … 57 51 sc_signal<Tcontrol_t> ACCESS_ACK [param._nb_access]; 58 52 sc_signal<Taddress_t> ACCESS_ADDRESS [param._nb_access]; 53 sc_signal<Tcontrol_t> ACCESS_HIT [param._nb_access]; 59 54 sc_signal<Tentity_t > ACCESS_ENTITY [param._nb_access]; 60 61 sc_signal<Tcontrol_t> UPDATE_VAL [param._nb_update]; 62 sc_signal<Tcontrol_t> UPDATE_ACK [param._nb_update]; 63 sc_signal<Taddress_t> UPDATE_ADDRESS [param._nb_update]; 64 sc_signal<Tentity_t > UPDATE_ENTITY [param._nb_update]; 55 sc_signal<Tentity_t > ACCESS_VICTIM [param._nb_access]; 65 56 66 57 /******************************************************** … … 77 68 (*(_Victim_Pseudo_LRU-> in_ACCESS_VAL [i])) (ACCESS_VAL [i]); 78 69 (*(_Victim_Pseudo_LRU->out_ACCESS_ACK [i])) (ACCESS_ACK [i]); 79 if (param._size_ table>1)70 if (param._size_address>1) 80 71 (*(_Victim_Pseudo_LRU-> in_ACCESS_ADDRESS [i])) (ACCESS_ADDRESS [i]); 81 (*(_Victim_Pseudo_LRU->out_ACCESS_ENTITY [i])) (ACCESS_ENTITY [i]); 72 (*(_Victim_Pseudo_LRU-> in_ACCESS_HIT [i])) (ACCESS_HIT [i]); 73 (*(_Victim_Pseudo_LRU-> in_ACCESS_ENTITY [i])) (ACCESS_ENTITY [i]); 74 (*(_Victim_Pseudo_LRU->out_ACCESS_VICTIM [i])) (ACCESS_VICTIM [i]); 82 75 } 83 76 84 for (uint32_t i=0; i<param._nb_update; i++)85 {86 (*(_Victim_Pseudo_LRU-> in_UPDATE_VAL [i])) (UPDATE_VAL [i]);87 (*(_Victim_Pseudo_LRU->out_UPDATE_ACK [i])) (UPDATE_ACK [i]);88 if (param._size_table>1)89 (*(_Victim_Pseudo_LRU-> in_UPDATE_ADDRESS [i])) (UPDATE_ADDRESS [i]);90 (*(_Victim_Pseudo_LRU-> in_UPDATE_ENTITY [i])) (UPDATE_ENTITY [i]);91 }92 77 /******************************************************** 93 78 * Simulation - Begin … … 105 90 ACCESS_VAL[i].write(0); 106 91 } 107 for (uint32_t i=0; i<param._nb_update; i++)108 {109 UPDATE_VAL[i].write(0);110 }111 92 112 93 sc_start(5); 113 94 cout << "-----[ Test Update ]------------------------------" << endl; 114 for (uint32_t i=0; i<param._nb_update; i++) 115 { 116 UPDATE_VAL[i].write(1); 117 } 118 119 for (uint32_t j=0; j<param._size_table; j+=param._nb_update) 95 for (uint32_t i=0; i<param._nb_access; i++) 96 { 97 ACCESS_VAL[i].write(1); 98 ACCESS_HIT[i].write(1); 99 } 100 101 for (uint32_t j=0; j<param._size_table; j+=param._nb_access) 120 102 for (uint32_t k=0; k<param._nb_entity; k++) 121 103 { 122 104 cout << "time : " << static_cast<uint32_t>(sc_simulation_time()) << endl; 123 for (uint32_t i=0; i<param._nb_ update; i++)105 for (uint32_t i=0; i<param._nb_access; i++) 124 106 { 125 107 … … 131 113 addr = 0; 132 114 Tentity_t entity = (k+1)%param._nb_entity; 133 UPDATE_VAL [i].write(val );134 if (param._size_ table>1)135 UPDATE_ADDRESS [i].write(addr);136 UPDATE_ENTITY [i].write(entity);115 ACCESS_VAL [i].write(val ); 116 if (param._size_address>1) 117 ACCESS_ADDRESS [i].write(addr); 118 ACCESS_ENTITY [i].write(entity); 137 119 138 120 sc_start(0); 139 cout << "\t[" << i << "] " << val << " - " << UPDATE_ACK[i].read() << " addr : " << addr << " -> " << entity << endl;121 cout << "\t[" << i << "] " << val << " - " << ACCESS_ACK[i].read() << " addr : " << addr << " -> " << entity << endl; 140 122 } 141 123 sc_start(1); … … 143 125 144 126 145 for (uint32_t i=0; i<param._nb_ update; i++)146 { 147 UPDATE_VAL[i].write(0);127 for (uint32_t i=0; i<param._nb_access; i++) 128 { 129 ACCESS_VAL[i].write(0); 148 130 } 149 131 … … 151 133 152 134 cout << "-----[ Test Access ]------------------------------" << endl; 135 136 for (uint32_t i=0; i<param._nb_access; i++) 137 { 138 ACCESS_HIT[i].write(0); 139 } 153 140 154 141 … … 171 158 addr = 0; 172 159 ACCESS_VAL [i].write(val ); 173 if (param._size_ table>1)160 if (param._size_address>1) 174 161 ACCESS_ADDRESS [i].write(addr); 175 162 176 163 sc_start(0); 177 164 178 Tentity_t entity = ACCESS_ ENTITY[i].read();165 Tentity_t entity = ACCESS_VICTIM [i].read(); 179 166 180 167 cout << "\t[" << i << "] " << val << " - " << ACCESS_ACK[i].read() << " addr : " << addr << " -> " << entity << endl;
Note: See TracChangeset
for help on using the changeset viewer.