Skip to content

Commit ea75051

Browse files
committed
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-verilog-to-routing into pb_graph_bug_fixes
2 parents b55dc60 + a9ce736 commit ea75051

File tree

4 files changed

+24
-32
lines changed

4 files changed

+24
-32
lines changed

ODIN_II/SRC/BLIFElaborate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static void resolve_arithmetic_nodes(nnode_t* node, uintptr_t traverse_mark_numb
485485
if (!hard_multipliers)
486486
check_constant_multipication(node, traverse_mark_number, netlist);
487487
else
488-
check_multiplier_port_size(node, netlist);
488+
check_multiplier_port_size(node);
489489

490490
/* Adding to mult_list for future checking on hard blocks */
491491
mult_list = insert_in_vptr_list(mult_list, node);

ODIN_II/SRC/include/multipliers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extern void define_mult_function(nnode_t* node, FILE* out);
5656
extern void split_multiplier(nnode_t* node, int a0, int b0, int a1, int b1, netlist_t* netlist);
5757
extern void iterate_multipliers(netlist_t* netlist);
5858
extern bool check_constant_multipication(nnode_t* node, uintptr_t traverse_mark_number, netlist_t* netlist);
59-
extern void check_multiplier_port_size(nnode_t* node, netlist_t* netlist);
59+
extern void check_multiplier_port_size(nnode_t* node);
6060
extern bool is_ast_multiplier(ast_node_t* node);
6161
extern void clean_multipliers();
6262
extern void free_multipliers();

ODIN_II/SRC/multipliers.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,10 +1769,9 @@ bool is_ast_multiplier(ast_node_t* node) {
17691769
* we need to expand output pins with pad pins
17701770
*
17711771
* @param node pointer to the multiplication node
1772-
* @param netlist pointer to the current netlist file
17731772
* -----------------------------------------------------------------------
17741773
*/
1775-
void check_multiplier_port_size(nnode_t* node, netlist_t* netlist) {
1774+
void check_multiplier_port_size(nnode_t* node) {
17761775
/* Can only perform the optimisation if hard multipliers exist! */
17771776
if (hard_multipliers == NULL)
17781777
return;
@@ -1795,8 +1794,16 @@ void check_multiplier_port_size(nnode_t* node, netlist_t* netlist) {
17951794
for (int i = 0; i < node->num_output_pins; i++) {
17961795
if (i < sizeout)
17971796
node->output_pins[i] = old_output_pins[i];
1798-
else
1799-
add_output_pin_to_node(node, get_pad_pin(netlist), i);
1797+
else {
1798+
npin_t* new_pin = allocate_npin();
1799+
new_pin->name = append_string("", "%s~dummy_output~%d", node->name, 0);
1800+
nnet_t* new_net = allocate_nnet();
1801+
1802+
// hook the output pin into the node
1803+
add_output_pin_to_node(node, new_pin, i);
1804+
// hook up new pin 1 into the new net
1805+
add_driver_pin_to_net(new_net, new_pin);
1806+
}
18001807
}
18011808
// CLEAN UP
18021809
vtr::free(old_output_pins);

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)