Line 400... |
Line 400... |
bool lower_packet_partofchain[NB_OF_BUFFERS/2];
|
bool lower_packet_partofchain[NB_OF_BUFFERS/2];
|
sc_uint<MAX_PASSPW_P1_LOG2_COUNT> lower_pass_count[NB_OF_BUFFERS/2];
|
sc_uint<MAX_PASSPW_P1_LOG2_COUNT> lower_pass_count[NB_OF_BUFFERS/2];
|
for(int n = 0; n < NB_OF_BUFFERS/2; n++){
|
for(int n = 0; n < NB_OF_BUFFERS/2; n++){
|
if(compare_with_higher.read()){
|
if(compare_with_higher.read()){
|
lower_buffer_free[n] = (sc_bit)buffer_free[2 * (n + 1)];
|
lower_buffer_free[n] = (sc_bit)buffer_free[2 * (n + 1)];
|
lower_clumped_unitid[n] = clumped_unitid_registers[2 * (n + 1)];
|
lower_clumped_unitid[n] = clumped_unitid_registers[2 * (n + 1)].read();
|
lower_passPW[n] = packet_passpw_register[2 * (n + 1)];
|
lower_passPW[n] = packet_passpw_register[2 * (n + 1)];
|
lower_seqID[n] = packet_seqid_register[2 * (n + 1)];
|
lower_seqID[n] = packet_seqid_register[2 * (n + 1)].read();
|
lower_packet_partofchain[n] = packet_partofchain_register[2 * (n + 1)];
|
lower_packet_partofchain[n] = packet_partofchain_register[2 * (n + 1)];
|
lower_pass_count[n] = pass_count[2 * (n + 1)];
|
lower_pass_count[n] = pass_count[2 * (n + 1)].read();
|
}
|
}
|
else{
|
else{
|
lower_buffer_free[n] = (sc_bit)buffer_free[2 * n];
|
lower_buffer_free[n] = (sc_bit)buffer_free[2 * n];
|
lower_clumped_unitid[n] = clumped_unitid_registers[2 * n];
|
lower_clumped_unitid[n] = clumped_unitid_registers[2 * n].read();
|
lower_passPW[n] = packet_passpw_register[2 * n];
|
lower_passPW[n] = packet_passpw_register[2 * n];
|
lower_seqID[n] = packet_seqid_register[2 * n];
|
lower_seqID[n] = packet_seqid_register[2 * n].read();
|
lower_packet_partofchain[n] = packet_partofchain_register[2 * n];
|
lower_packet_partofchain[n] = packet_partofchain_register[2 * n];
|
lower_pass_count[n] = pass_count[2 * n];
|
lower_pass_count[n] = pass_count[2 * n].read();
|
}
|
}
|
}
|
}
|
|
|
//Calculate if packets should be switched
|
//Calculate if packets should be switched
|
for(int n = 0; n < NB_OF_BUFFERS/2; n++){
|
for(int n = 0; n < NB_OF_BUFFERS/2; n++){
|
Line 494... |
Line 494... |
packet_partofchain_register[0] = packet_partofchain_register[0];
|
packet_partofchain_register[0] = packet_partofchain_register[0];
|
packet_nposted_refid_rejected_register[0] = packet_nposted_refid_rejected_register[0];
|
packet_nposted_refid_rejected_register[0] = packet_nposted_refid_rejected_register[0];
|
packet_response_refid_rejected_register[0] = packet_response_refid_rejected_register[0];
|
packet_response_refid_rejected_register[0] = packet_response_refid_rejected_register[0];
|
packet_nposted_refid_accepted_register[0] = packet_nposted_refid_accepted_register[0];
|
packet_nposted_refid_accepted_register[0] = packet_nposted_refid_accepted_register[0];
|
packet_response_refid_accepted_register[0] = packet_response_refid_accepted_register[0];
|
packet_response_refid_accepted_register[0] = packet_response_refid_accepted_register[0];
|
pass_count[0] = pass_count[0];
|
pass_count[0] = pass_count[0].read();
|
}
|
}
|
|
|
|
|
//Special case : second register
|
//Special case : second register
|
sc_uint<4> second_case_selector;
|
sc_uint<4> second_case_selector;
|
Line 520... |
Line 520... |
clumped_unitid_registers[1] = clumped_unitid_registers[0];
|
clumped_unitid_registers[1] = clumped_unitid_registers[0];
|
packet_addr_register[1] = packet_addr_register[0];
|
packet_addr_register[1] = packet_addr_register[0];
|
packet_passpw_register[1] = packet_passpw_register[0];
|
packet_passpw_register[1] = packet_passpw_register[0];
|
packet_seqid_register[1] = packet_seqid_register[0];
|
packet_seqid_register[1] = packet_seqid_register[0];
|
packet_partofchain_register[1] = packet_partofchain_register[0];
|
packet_partofchain_register[1] = packet_partofchain_register[0];
|
original_pass_count1 = pass_count[0];
|
original_pass_count1 = pass_count[0].read();
|
break;
|
break;
|
|
|
case 2:
|
case 2:
|
case 10:
|
case 10:
|
destination_registers[1] = destination_with_deletion[2];
|
destination_registers[1] = destination_with_deletion[2];
|
clumped_unitid_registers[1] = clumped_unitid_registers[2];
|
clumped_unitid_registers[1] = clumped_unitid_registers[2];
|
packet_addr_register[1] = packet_addr_register[2];
|
packet_addr_register[1] = packet_addr_register[2];
|
packet_passpw_register[1] = packet_passpw_register[2];
|
packet_passpw_register[1] = packet_passpw_register[2];
|
packet_seqid_register[1] = packet_seqid_register[2];
|
packet_seqid_register[1] = packet_seqid_register[2];
|
packet_partofchain_register[1] = packet_partofchain_register[2];
|
packet_partofchain_register[1] = packet_partofchain_register[2];
|
original_pass_count1 = pass_count[2];
|
original_pass_count1 = pass_count[2].read();
|
break;
|
break;
|
|
|
default:
|
default:
|
destination_registers[1] = destination_with_deletion[1];
|
destination_registers[1] = destination_with_deletion[1];
|
clumped_unitid_registers[1] = clumped_unitid_registers[1];
|
clumped_unitid_registers[1] = clumped_unitid_registers[1];
|
packet_addr_register[1] = packet_addr_register[1];
|
packet_addr_register[1] = packet_addr_register[1];
|
packet_passpw_register[1] = packet_passpw_register[1];
|
packet_passpw_register[1] = packet_passpw_register[1];
|
packet_seqid_register[1] = packet_seqid_register[1];
|
packet_seqid_register[1] = packet_seqid_register[1];
|
packet_partofchain_register[1] = packet_partofchain_register[1];
|
packet_partofchain_register[1] = packet_partofchain_register[1];
|
original_pass_count1 = pass_count[1];
|
original_pass_count1 = pass_count[1].read();
|
}
|
}
|
|
|
switch(second_case_selector){
|
switch(second_case_selector){
|
case 1:
|
case 1:
|
case 3:
|
case 3:
|
Line 603... |
Line 603... |
clumped_unitid_registers[NB_OF_BUFFERS - 1] = clumped_unitid_registers[NB_OF_BUFFERS - 2];
|
clumped_unitid_registers[NB_OF_BUFFERS - 1] = clumped_unitid_registers[NB_OF_BUFFERS - 2];
|
packet_addr_register[NB_OF_BUFFERS - 1] = packet_addr_register[NB_OF_BUFFERS - 2];
|
packet_addr_register[NB_OF_BUFFERS - 1] = packet_addr_register[NB_OF_BUFFERS - 2];
|
packet_passpw_register[NB_OF_BUFFERS - 1] = packet_passpw_register[NB_OF_BUFFERS - 2];
|
packet_passpw_register[NB_OF_BUFFERS - 1] = packet_passpw_register[NB_OF_BUFFERS - 2];
|
packet_seqid_register[NB_OF_BUFFERS - 1] = packet_seqid_register[NB_OF_BUFFERS - 2];
|
packet_seqid_register[NB_OF_BUFFERS - 1] = packet_seqid_register[NB_OF_BUFFERS - 2];
|
packet_partofchain_register[NB_OF_BUFFERS - 1] = packet_partofchain_register[NB_OF_BUFFERS - 2];
|
packet_partofchain_register[NB_OF_BUFFERS - 1] = packet_partofchain_register[NB_OF_BUFFERS - 2];
|
pass_count[NB_OF_BUFFERS - 1] = pass_count[NB_OF_BUFFERS - 2];
|
pass_count[NB_OF_BUFFERS - 1] = pass_count[NB_OF_BUFFERS - 2].read();
|
break;
|
break;
|
|
|
case 5:
|
case 5:
|
destination_registers[NB_OF_BUFFERS - 1] = destination_with_deletion[NB_OF_BUFFERS - 3];
|
destination_registers[NB_OF_BUFFERS - 1] = destination_with_deletion[NB_OF_BUFFERS - 3];
|
clumped_unitid_registers[NB_OF_BUFFERS - 1] = clumped_unitid_registers[NB_OF_BUFFERS - 3];
|
clumped_unitid_registers[NB_OF_BUFFERS - 1] = clumped_unitid_registers[NB_OF_BUFFERS - 3];
|
packet_addr_register[NB_OF_BUFFERS - 1] = packet_addr_register[NB_OF_BUFFERS - 3];
|
packet_addr_register[NB_OF_BUFFERS - 1] = packet_addr_register[NB_OF_BUFFERS - 3];
|
packet_passpw_register[NB_OF_BUFFERS - 1] = packet_passpw_register[NB_OF_BUFFERS - 3];
|
packet_passpw_register[NB_OF_BUFFERS - 1] = packet_passpw_register[NB_OF_BUFFERS - 3];
|
packet_seqid_register[NB_OF_BUFFERS - 1] = packet_seqid_register[NB_OF_BUFFERS - 3];
|
packet_seqid_register[NB_OF_BUFFERS - 1] = packet_seqid_register[NB_OF_BUFFERS - 3];
|
packet_partofchain_register[NB_OF_BUFFERS - 1] = packet_partofchain_register[NB_OF_BUFFERS - 3];
|
packet_partofchain_register[NB_OF_BUFFERS - 1] = packet_partofchain_register[NB_OF_BUFFERS - 3];
|
pass_count[NB_OF_BUFFERS - 1] = pass_count[NB_OF_BUFFERS - 3];
|
pass_count[NB_OF_BUFFERS - 1] = pass_count[NB_OF_BUFFERS - 3].read();
|
break;
|
break;
|
|
|
default:
|
default:
|
destination_registers[NB_OF_BUFFERS - 1] = destination_with_deletion[NB_OF_BUFFERS - 1];
|
destination_registers[NB_OF_BUFFERS - 1] = destination_with_deletion[NB_OF_BUFFERS - 1];
|
clumped_unitid_registers[NB_OF_BUFFERS - 1] = clumped_unitid_registers[NB_OF_BUFFERS - 1];
|
clumped_unitid_registers[NB_OF_BUFFERS - 1] = clumped_unitid_registers[NB_OF_BUFFERS - 1];
|
packet_addr_register[NB_OF_BUFFERS - 1] = packet_addr_register[NB_OF_BUFFERS - 1];
|
packet_addr_register[NB_OF_BUFFERS - 1] = packet_addr_register[NB_OF_BUFFERS - 1];
|
packet_passpw_register[NB_OF_BUFFERS - 1] = packet_passpw_register[NB_OF_BUFFERS - 1];
|
packet_passpw_register[NB_OF_BUFFERS - 1] = packet_passpw_register[NB_OF_BUFFERS - 1];
|
packet_seqid_register[NB_OF_BUFFERS - 1] = packet_seqid_register[NB_OF_BUFFERS - 1];
|
packet_seqid_register[NB_OF_BUFFERS - 1] = packet_seqid_register[NB_OF_BUFFERS - 1];
|
packet_partofchain_register[NB_OF_BUFFERS - 1] = packet_partofchain_register[NB_OF_BUFFERS - 1];
|
packet_partofchain_register[NB_OF_BUFFERS - 1] = packet_partofchain_register[NB_OF_BUFFERS - 1];
|
pass_count[NB_OF_BUFFERS - 1] = pass_count[NB_OF_BUFFERS - 1];
|
pass_count[NB_OF_BUFFERS - 1] = pass_count[NB_OF_BUFFERS - 1].read();
|
}
|
}
|
|
|
switch(last_case_selector){
|
switch(last_case_selector){
|
case 1:
|
case 1:
|
//case 2 removed : packet N-2 switching with packet N-1, take older refid value
|
//case 2 removed : packet N-2 switching with packet N-1, take older refid value
|
Line 670... |
Line 670... |
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 2];
|
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 2];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 2];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 2];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 2];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 2];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 2];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 2];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 2];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 2];
|
original_pass_count_pair = pass_count[2 * n + 2];
|
original_pass_count_pair = pass_count[2 * n + 2].read();
|
break;
|
break;
|
|
|
case 8:
|
case 8:
|
case 10:
|
case 10:
|
destination_registers[2 * n + 3] = destination_with_deletion[2 * n + 4];
|
destination_registers[2 * n + 3] = destination_with_deletion[2 * n + 4];
|
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 4];
|
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 4];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 4];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 4];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 4];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 4];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 4];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 4];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 4];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 4];
|
original_pass_count_pair = pass_count[2 * n + 4];
|
original_pass_count_pair = pass_count[2 * n + 4].read();
|
break;
|
break;
|
|
|
case 12:
|
case 12:
|
case 13:
|
case 13:
|
destination_registers[2 * n + 3] = destination_with_deletion[2 * n + 1];
|
destination_registers[2 * n + 3] = destination_with_deletion[2 * n + 1];
|
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 1];
|
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 1];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 1];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 1];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 1];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 1];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 1];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 1];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 1];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 1];
|
original_pass_count_pair = pass_count[2 * n + 1];
|
original_pass_count_pair = pass_count[2 * n + 1].read();
|
break;
|
break;
|
|
|
default:
|
default:
|
destination_registers[2 * n + 3] = destination_with_deletion[2 * n + 3];
|
destination_registers[2 * n + 3] = destination_with_deletion[2 * n + 3];
|
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 3];
|
clumped_unitid_registers[2 * n + 3] = clumped_unitid_registers[2 * n + 3];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 3];
|
packet_addr_register[2 * n + 3] = packet_addr_register[2 * n + 3];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 3];
|
packet_passpw_register[2 * n + 3] = packet_passpw_register[2 * n + 3];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 3];
|
packet_seqid_register[2 * n + 3] = packet_seqid_register[2 * n + 3];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 3];
|
packet_partofchain_register[2 * n + 3] = packet_partofchain_register[2 * n + 3];
|
original_pass_count_pair = pass_count[2 * n + 3];
|
original_pass_count_pair = pass_count[2 * n + 3].read();
|
}
|
}
|
|
|
switch(pair_case_selector){
|
switch(pair_case_selector){
|
//case 1 and 3 removed : 2 * n + 3 switching with packet 2 * n + 3, take older refid value
|
//case 1 and 3 removed : 2 * n + 3 switching with packet 2 * n + 3, take older refid value
|
case 4:
|
case 4:
|
Line 773... |
Line 773... |
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n + 1];
|
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n + 1];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n + 1];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n + 1];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n + 1];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n + 1];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n + 1];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n + 1];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n + 1];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n + 1];
|
original_pass_count_impair = pass_count[2 * n + 1];
|
original_pass_count_impair = pass_count[2 * n + 1].read();
|
break;
|
break;
|
|
|
case 1:
|
case 1:
|
case 3:
|
case 3:
|
destination_registers[2 * n + 2] = destination_with_deletion[2 * n + 3];
|
destination_registers[2 * n + 2] = destination_with_deletion[2 * n + 3];
|
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n + 3];
|
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n + 3];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n + 3];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n + 3];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n + 3];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n + 3];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n + 3];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n + 3];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n + 3];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n + 3];
|
original_pass_count_impair = pass_count[2 * n + 3];
|
original_pass_count_impair = pass_count[2 * n + 3].read();
|
break;
|
break;
|
|
|
case 6:
|
case 6:
|
case 7:
|
case 7:
|
destination_registers[2 * n + 2] = destination_with_deletion[2 * n];
|
destination_registers[2 * n + 2] = destination_with_deletion[2 * n];
|
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n];
|
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n];
|
original_pass_count_impair = pass_count[2 * n];
|
original_pass_count_impair = pass_count[2 * n].read();
|
break;
|
break;
|
|
|
default:
|
default:
|
destination_registers[2 * n + 2] = destination_with_deletion[2 * n + 2];
|
destination_registers[2 * n + 2] = destination_with_deletion[2 * n + 2];
|
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n + 2];
|
clumped_unitid_registers[2 * n + 2] = clumped_unitid_registers[2 * n + 2];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n + 2];
|
packet_addr_register[2 * n + 2] = packet_addr_register[2 * n + 2];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n + 2];
|
packet_passpw_register[2 * n + 2] = packet_passpw_register[2 * n + 2];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n + 2];
|
packet_seqid_register[2 * n + 2] = packet_seqid_register[2 * n + 2];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n + 2];
|
packet_partofchain_register[2 * n + 2] = packet_partofchain_register[2 * n + 2];
|
original_pass_count_impair = pass_count[2 * n + 2];
|
original_pass_count_impair = pass_count[2 * n + 2].read();
|
}
|
}
|
|
|
switch(impair_case_selector){
|
switch(impair_case_selector){
|
case 4:
|
case 4:
|
case 5:
|
case 5:
|