Changeset 95 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_body.cpp
- Timestamp:
- Dec 16, 2008, 5:24:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_body.cpp
r81 r95 116 116 } 117 117 118 vhdl->set_body ("");119 vhdl->set_body ("-- port update");120 for (uint32_t i=0; i<_param->_nb_update; i++)121 for (int32_t j=static_cast<uint32_t>(log2(_param->_nb_entity)-1); j>=0; j--)122 {123 uint32_t cpt=0;118 // vhdl->set_body (""); 119 // vhdl->set_body ("-- port update"); 120 // for (uint32_t i=0; i<_param->_nb_update; i++) 121 // for (int32_t j=static_cast<uint32_t>(log2(_param->_nb_entity)-1); j>=0; j--) 122 // { 123 // uint32_t cpt=0; 124 124 125 for (int32_t k=(1<<j)-1; k<static_cast<int32_t>(_param->_nb_entity-1); k+=(1<<(j+1)))126 {127 bool have_cond = false;128 std::string cond = "";129 130 // condition to change the bit131 for (uint32_t l=j+1; l<static_cast<uint32_t>(log2(_param->_nb_entity));l++)132 {133 have_cond = true;134 135 if (l==static_cast<uint32_t>(j+1))136 cond += "when";137 else138 cond += " and";139 cond += " in_UPDATE_"+toString(i)+"_ENTITY("+toString(l)+")='"+toString((cpt>>(l-(j+1)))&1)+"'";140 }141 142 vhdl->set_body ("update_next_entry_"+toString(i)+"("+toString(k)+") <=");143 vhdl->set_body ("\tnot in_UPDATE_"+toString(i)+"_ENTITY("+toString(j)+") "+cond);144 if (have_cond == true)145 {146 std::string update_address;147 148 if (_param->_size_table>1)149 update_address = "conv_integer(in_UPDATE_"+toString(i)+"_ADDRESS)";150 else151 update_address = "0";125 // for (int32_t k=(1<<j)-1; k<static_cast<int32_t>(_param->_nb_entity-1); k+=(1<<(j+1))) 126 // { 127 // bool have_cond = false; 128 // std::string cond = ""; 129 130 // // condition to change the bit 131 // for (uint32_t l=j+1; l<static_cast<uint32_t>(log2(_param->_nb_entity));l++) 132 // { 133 // have_cond = true; 134 135 // if (l==static_cast<uint32_t>(j+1)) 136 // cond += "when"; 137 // else 138 // cond += " and"; 139 // cond += " in_UPDATE_"+toString(i)+"_ENTITY("+toString(l)+")='"+toString((cpt>>(l-(j+1)))&1)+"'"; 140 // } 141 142 // vhdl->set_body ("update_next_entry_"+toString(i)+"("+toString(k)+") <="); 143 // vhdl->set_body ("\tnot in_UPDATE_"+toString(i)+"_ENTITY("+toString(j)+") "+cond); 144 // if (have_cond == true) 145 // { 146 // std::string update_address; 147 148 // if (_param->_size_table>1) 149 // update_address = "conv_integer(in_UPDATE_"+toString(i)+"_ADDRESS)"; 150 // else 151 // update_address = "0"; 152 152 153 vhdl->set_body ("\telse reg_TABLE ("+update_address+")("+toString(k)+")");154 }155 vhdl->set_body ("\t;");156 cpt ++;157 }158 }153 // vhdl->set_body ("\telse reg_TABLE ("+update_address+")("+toString(k)+")"); 154 // } 155 // vhdl->set_body ("\t;"); 156 // cpt ++; 157 // } 158 // } 159 159 160 160 vhdl->set_body (""); … … 182 182 } 183 183 184 vhdl->set_body ("\t\t-- Update port");185 for (uint32_t i=0; i<_param->_nb_update; i++)186 {187 std::string update_address;188 189 if (_param->_size_table>1)190 update_address = "conv_integer(in_UPDATE_"+toString(i)+"_ADDRESS)";191 else192 update_address = "0";184 // vhdl->set_body ("\t\t-- Update port"); 185 // for (uint32_t i=0; i<_param->_nb_update; i++) 186 // { 187 // std::string update_address; 188 189 // if (_param->_size_table>1) 190 // update_address = "conv_integer(in_UPDATE_"+toString(i)+"_ADDRESS)"; 191 // else 192 // update_address = "0"; 193 193 194 vhdl->set_body ("\t\tif (in_UPDATE_"+toString(i)+"_VAL = '1') then");195 vhdl->set_body ("\t\t\treg_TABLE ("+update_address+") <= update_next_entry_"+toString(i)+";");196 vhdl->set_body ("\t\tend if;");197 }194 // vhdl->set_body ("\t\tif (in_UPDATE_"+toString(i)+"_VAL = '1') then"); 195 // vhdl->set_body ("\t\t\treg_TABLE ("+update_address+") <= update_next_entry_"+toString(i)+";"); 196 // vhdl->set_body ("\t\tend if;"); 197 // } 198 198 199 199 vhdl->set_body ("\tend if;"); … … 210 210 { 211 211 vhdl->set_body ("out_ACCESS_"+toString(i)+"_ACK <= '1';"); 212 vhdl->set_body ("out_ACCESS_"+toString(i)+"_ ENTITY<= access_entity_"+toString(i)+" when in_ACCESS_"+toString(i)+"_VAL = '1' else (others => '0');");212 vhdl->set_body ("out_ACCESS_"+toString(i)+"_VICTIM <= access_entity_"+toString(i)+" when in_ACCESS_"+toString(i)+"_VAL = '1' else (others => '0');"); 213 213 } 214 214 vhdl->set_body (""); 215 for (uint32_t i=0; i<_param->_nb_update; i++)216 {217 vhdl->set_body ("out_UPDATE_"+toString(i)+"_ACK <= '1';");218 }215 // for (uint32_t i=0; i<_param->_nb_update; i++) 216 // { 217 // vhdl->set_body ("out_UPDATE_"+toString(i)+"_ACK <= '1';"); 218 // } 219 219 }; 220 220
Note: See TracChangeset
for help on using the changeset viewer.