change_pin
ECO command. Modify pin connection of instances by inserting gates, changing connection to other signal (LLM: change pin insert gate)
Two types of usages.
Usage1: change_pin($pin_name, $net);
Change pin's connection to a net
$pin_name: In the format of "instance/pin", can be more than one pins separated by ",",
"instance1/pinA,instance2/pinB", E.G. "U123/A", "U123/A,U345/B"
Hierarchical naming style is supported as well, "u_abc/U123/A"
The pins have to be input in this mode.
$net: The net name the pin connects to.
Hierarchical naming style is supported, "u_abc/net123"
When the pin and the net are in different hierarchies, ports are added automatically
E.G.
# The tool creates 4 ports across the hierarchies to connect the net to the pin.
change_pin("u_abc/u_cde/U200/A", "u_xyz/u_stv/net300");
# The tool gets the net tie to Y pin of U300 and do the the same as the previous example.
change_pin("u_abc/u_cde/U200/A", "u_xyz/u_stv/U300/Y");
Usage2:my $inst = change_pin($pin_name, $leaf_cell, $new_instance, $connection);
Insert a new leaf cell to drive the pin
$inst: Return new instance name if new gate is created in the command.
$pin_name: In the format of "instance/pin", E.G. U123/A Hierarchical naming is supported, u_abc/U123/A
The pin can be output in this mode. The tool gets the net the pin drives,
and change the command to
change_net($thenet, $leaf_cell, $new_instance, $connection);
$leaf_cell: The leaf cell name to drive the $pin_name
$new_instance: The instance name for the new inserted leaf cell.
The option is optional, the tool assigns one if it's empty
If use '.', the instance is added to the same hierarchy as the $pin_name
$connection: The pins connection for the new cell.
Supported formats, 1. Detail format: ".A(net0),.B(net1),.C(net2)"
2. Simple format: Connect to the pins in alphabetical sequence "net1,net0,net2"
3. Mixed format: "u_abc/U123/Y,.B(net1),net2"
4. Special character '-' is used to connect up the original connection
5. Advanced nesting format:
change_pin("U189/A", "AOI21X2", "", "U190/Y,,BUFX6(BUFX6(BUFX6(n412)))");
Note: All strings should be quoted by ' or " to avoid syntax error or undesired effects.
Examples:
#1. U123 has input pins A,B,C, U234 has input pins A0,A1,B
# Change A pin of U123 to net12345
change_pin("U123/A", "net12345");
#2. Change A pin of U123 to $net which is defined in the ECO script.
change_pin("U123/B", $net);
#3. Change A pin of U123 to net12345
change_pin("U123/A,U234/B", "net12345");
#4. Insert "NAND2X2 eco12345_U0(.A(net1234),.B(net5678));"
# to drive U123/A
change_pin("U123/A", "NAND2X2", "eco12345_U0", "net1234,net5678");
#5. Same as above, with more detail of pin connections
change_pin("U123/A", "NAND2X2", "eco12345_U0", ".A(net1234),.B(net5678)");
#6.Insert a buffer to U123 A pin
change_pin("U123/A", "BUFX4", "", "-");
#7. Insert NAND2X1 to drive CK pin and new A connects to the original net
change_pin("abc_reg_1_/CK", "NAND2X1", "", ".A(-),.B(1'b1)");
#8. Do hierarchical connection
change_pin("u_abc/u_cde/U200/A", "u_xyz/u_stv/U300/Y");
#9. Nested connection
change_pin("qcif/num2/u_spare1/B", "AOI21X2", "eco_inst_on_top1", \
"NAND2X2(gte_344/u_smod/U100/Y, gte_344/n114), gte_343/U111, BUFX6(BUFX6(n105))");