Skip to content

Commit a9ce736

Browse files
authored
Merge pull request #2020 from CAS-Atlantic/removed_unused_if_statements
Removed 3 unused if conditions from ODIN's partial_map.cpp.
2 parents 9719c3d + 720c4e9 commit a9ce736

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

ODIN_II/SRC/partial_map.cpp

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ void partial_map_node(nnode_t* node, short traverse_number, netlist_t* netlist);
5858
void instantiate_not_logic(nnode_t* node, short mark, netlist_t* netlist);
5959
bool eliminate_buffer(nnode_t* node, short, netlist_t*);
6060
void instantiate_bitwise_logic(nnode_t* node, operation_list op, short mark, netlist_t* netlist);
61-
void instantiate_bitwise_reduction(nnode_t* node, operation_list op, short mark, netlist_t* netlist);
62-
void instantiate_logical_logic(nnode_t* node, operation_list op, short mark, netlist_t* netlist);
61+
void instantiate_bitwise_reduction(nnode_t* node, operation_list op, short mark);
62+
void instantiate_logical_logic(nnode_t* node, operation_list op, short mark);
6363
void instantiate_EQUAL(nnode_t* node, operation_list type, short mark, netlist_t* netlist);
6464
void instantiate_GE(nnode_t* node, operation_list type, short mark, netlist_t* netlist);
6565
void instantiate_GT(nnode_t* node, operation_list type, short mark, netlist_t* netlist);
@@ -155,7 +155,7 @@ void partial_map_node(nnode_t* node, short traverse_number, netlist_t* netlist)
155155
if (node->num_input_port_sizes >= 2) {
156156
instantiate_bitwise_logic(node, node->type, traverse_number, netlist);
157157
} else if (node->num_input_port_sizes == 1) {
158-
instantiate_bitwise_reduction(node, node->type, traverse_number, netlist);
158+
instantiate_bitwise_reduction(node, node->type, traverse_number);
159159
} else
160160
oassert(false);
161161
break;
@@ -167,7 +167,7 @@ void partial_map_node(nnode_t* node, short traverse_number, netlist_t* netlist)
167167
case LOGICAL_XOR:
168168
case LOGICAL_XNOR:
169169
if (node->num_input_port_sizes == 2) {
170-
instantiate_logical_logic(node, node->type, traverse_number, netlist);
170+
instantiate_logical_logic(node, node->type, traverse_number);
171171
}
172172
break;
173173

@@ -602,7 +602,7 @@ bool eliminate_buffer(nnode_t* node, short, netlist_t*) {
602602
/*---------------------------------------------------------------------------------------------
603603
* (function: instantiate_logical_logic )
604604
*-------------------------------------------------------------------------------------------*/
605-
void instantiate_logical_logic(nnode_t* node, operation_list op, short mark, netlist_t* netlist) {
605+
void instantiate_logical_logic(nnode_t* node, operation_list op, short mark) {
606606
int i;
607607
int port_B_offset;
608608
int width_a;
@@ -627,28 +627,18 @@ void instantiate_logical_logic(nnode_t* node, operation_list op, short mark, net
627627
/* connect inputs. In the case that a signal is smaller than the other then zero pad */
628628
for (i = 0; i < width_a; i++) {
629629
/* Joining the inputs to the input 1 of that gate */
630-
if (i < width_a) {
631-
remap_pin_to_new_node(node->input_pins[i], reduction1, i);
632-
} else {
633-
/* ELSE - the B input does not exist, so this answer goes right through */
634-
add_input_pin_to_node(reduction1, get_zero_pin(netlist), i);
635-
}
630+
remap_pin_to_new_node(node->input_pins[i], reduction1, i);
636631
}
637632
for (i = 0; i < width_b; i++) {
638633
/* Joining the inputs to the input 1 of that gate */
639-
if (i < width_b) {
640-
remap_pin_to_new_node(node->input_pins[i + port_B_offset], reduction2, i);
641-
} else {
642-
/* ELSE - the B input does not exist, so this answer goes right through */
643-
add_input_pin_to_node(reduction2, get_zero_pin(netlist), i);
644-
}
634+
remap_pin_to_new_node(node->input_pins[i + port_B_offset], reduction2, i);
645635
}
646636

647637
connect_nodes(reduction1, 0, new_logic_cell, 0);
648638
connect_nodes(reduction2, 0, new_logic_cell, 1);
649639

650-
instantiate_bitwise_reduction(reduction1, BITWISE_OR, mark, netlist);
651-
instantiate_bitwise_reduction(reduction2, BITWISE_OR, mark, netlist);
640+
instantiate_bitwise_reduction(reduction1, BITWISE_OR, mark);
641+
instantiate_bitwise_reduction(reduction2, BITWISE_OR, mark);
652642

653643
remap_pin_to_new_node(node->output_pins[0], new_logic_cell, 0);
654644
free_nnode(node);
@@ -657,7 +647,7 @@ void instantiate_logical_logic(nnode_t* node, operation_list op, short mark, net
657647
* (function: instantiate_bitwise_reduction )
658648
* Makes 2 input gates to break into bitwise
659649
*-------------------------------------------------------------------------------------------*/
660-
void instantiate_bitwise_reduction(nnode_t* node, operation_list op, short mark, netlist_t* netlist) {
650+
void instantiate_bitwise_reduction(nnode_t* node, operation_list op, short mark) {
661651
int i;
662652
int width_a;
663653
nnode_t* new_logic_cell;
@@ -705,12 +695,7 @@ void instantiate_bitwise_reduction(nnode_t* node, operation_list op, short mark,
705695
/* connect inputs. In the case that a signal is smaller than the other then zero pad */
706696
for (i = 0; i < width_a; i++) {
707697
/* Joining the inputs to the input 1 of that gate */
708-
if (i < width_a) {
709-
remap_pin_to_new_node(node->input_pins[i], new_logic_cell, i);
710-
} else {
711-
/* ELSE - the B input does not exist, so this answer goes right through */
712-
add_input_pin_to_node(new_logic_cell, get_zero_pin(netlist), i);
713-
}
698+
remap_pin_to_new_node(node->input_pins[i], new_logic_cell, i);
714699
}
715700

716701
remap_pin_to_new_node(node->output_pins[0], new_logic_cell, 0);

0 commit comments

Comments
 (0)