Skip to content

Commit 7caec7b

Browse files
committed
[Yosys+Odin]: creating extra pins to extend the mult output port
Signed-off-by: Seyed Alireza Damghani <[email protected]>
1 parent 3d100b1 commit 7caec7b

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
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);

0 commit comments

Comments
 (0)