Skip to content

Commit

Permalink
resize -buffer_inputs/-buffer_outputs conserve pin locations
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcherry56 committed Nov 27, 2019
1 parent 9f8e0fc commit 368bad3
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/dbSta/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,8 @@ dbNetwork::disconnectPin(Pin *pin)
if (iterm)
dbITerm::disconnect(iterm);
else if (bterm)
// dbNet::disconnect(bterm) does not exist.
// It should. -cherry
dbBTerm::destroy(bterm);
}

Expand Down
18 changes: 12 additions & 6 deletions src/resizer/src/Resizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,12 @@ Resizer::bufferInput(Pin *top_pin,
NetPinIterator *pin_iter(db_network_->pinIterator(input_net));
while (pin_iter->hasNext()) {
Pin *pin = pin_iter->next();
Port *pin_port = db_network_->port(pin);
sta_->disconnectPin(pin);
sta_->connectPin(db_network_->instance(pin), pin_port, buffer_out);
if (pin != top_pin) {
// Leave input port pin connected to input_net.
sta_->disconnectPin(pin);
Port *pin_port = db_network_->port(pin);
sta_->connectPin(db_network_->instance(pin), pin_port, buffer_out);
}
}
sta_->connectPin(buffer, input, input_net);
sta_->connectPin(buffer, output, buffer_out);
Expand Down Expand Up @@ -344,9 +347,12 @@ Resizer::bufferOutput(Pin *top_pin,
NetPinIterator *pin_iter(network->pinIterator(output_net));
while (pin_iter->hasNext()) {
Pin *pin = pin_iter->next();
Port *pin_port = network->port(pin);
sta_->disconnectPin(pin);
sta_->connectPin(network->instance(pin), pin_port, buffer_in);
if (pin != top_pin) {
// Leave output port pin connected to output_net.
sta_->disconnectPin(pin);
Port *pin_port = network->port(pin);
sta_->connectPin(network->instance(pin), pin_port, buffer_in);
}
}
sta_->connectPin(buffer, input, buffer_in);
sta_->connectPin(buffer, output, output_net);
Expand Down
39 changes: 39 additions & 0 deletions src/resizer/test/rebuffer_ports1.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
VERSION 5.5 ;
NAMESCASESENSITIVE ON ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
DESIGN top ;
UNITS DISTANCE MICRONS 1000 ;
DIEAREA ( -1000 -1000 ) ( 1000 1000 ) ;
COMPONENTS 5 ;
- r1 snl_ffqx1 ;
- r2 snl_ffqx1 ;
- r3 snl_ffqx1 ;
- u1 snl_bufx1 ;
- u2 snl_and02x1 ;
END COMPONENTS
PINS 6 ;
- in1 + NET in1 + DIRECTION INPUT + USE SIGNAL + FIXED ( -1000 -1000 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- in2 + NET in2 + DIRECTION INPUT + USE SIGNAL + FIXED ( 333 -1000 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- clk1 + NET clk1 + DIRECTION INPUT + USE SIGNAL + FIXED ( 1000 -334 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- clk2 + NET clk2 + DIRECTION INPUT + USE SIGNAL + FIXED ( 1000 999 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- clk3 + NET clk3 + DIRECTION INPUT + USE SIGNAL + FIXED ( -332 1000 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- out + NET out + DIRECTION OUTPUT + USE SIGNAL + FIXED ( -1000 335 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
END PINS
SPECIALNETS 2 ;
- VSS ( * VSS ) + USE GROUND ;
- VDD ( * VDD ) + USE POWER ;
END SPECIALNETS
NETS 10 ;
- in1 ( r1 D ) + USE SIGNAL ;
- in2 ( r2 D ) + USE SIGNAL ;
- clk1 ( r1 CP ) + USE SIGNAL ;
- clk2 ( r2 CP ) + USE SIGNAL ;
- clk3 ( r3 CP ) + USE SIGNAL ;
- out ( r3 Q ) + USE SIGNAL ;
- r1q ( r1 Q ) ( u2 A ) + USE SIGNAL ;
- r2q ( r2 Q ) ( u1 A ) + USE SIGNAL ;
- u1z ( u1 Z ) ( u2 B ) + USE SIGNAL ;
- u2z ( u2 Z ) ( r3 D ) + USE SIGNAL ;
END NETS
END DESIGN
22 changes: 11 additions & 11 deletions src/resizer/test/rebuffer_ports1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Notice 0: Created 2 technology layers
Notice 0: Created 6 library cells
Notice 0: Finished LEF file: liberty1.lef
Notice 0:
Reading DEF file: reg1.def
Reading DEF file: rebuffer_ports1.def
Notice 0: Design: top
Notice 0: Created 6 pins.
Notice 0: Created 5 components and 24 component-terminals.
Notice 0: Created 2 special nets and 10 connections.
Notice 0: Created 10 nets and 14 connections.
Notice 0: Finished DEF file: reg1.def
Notice 0: Finished DEF file: rebuffer_ports1.def
Inserted 2 input buffers.
Inserted 1 output buffers.
VERSION 5.5 ;
Expand All @@ -25,17 +25,17 @@ COMPONENTS 8 ;
- r3 snl_ffqx1 ;
- u1 snl_bufx1 ;
- u2 snl_and02x1 ;
- buffer1 snl_bufx2 + PLACED ( 0 0 ) N ;
- buffer2 snl_bufx2 + PLACED ( 0 0 ) N ;
- buffer3 snl_bufx2 + PLACED ( 0 0 ) N ;
- buffer1 snl_bufx2 + PLACED ( -1000 -1000 ) N ;
- buffer2 snl_bufx2 + PLACED ( 333 -1000 ) N ;
- buffer3 snl_bufx2 + PLACED ( -1000 335 ) N ;
END COMPONENTS
PINS 6 ;
- in1 + NET net1 + DIRECTION INPUT + USE SIGNAL ;
- in2 + NET net2 + DIRECTION INPUT + USE SIGNAL ;
- clk1 + NET clk1 + DIRECTION INPUT + USE SIGNAL ;
- clk2 + NET clk2 + DIRECTION INPUT + USE SIGNAL ;
- clk3 + NET clk3 + DIRECTION INPUT + USE SIGNAL ;
- out + NET net3 + DIRECTION OUTPUT + USE SIGNAL ;
- in1 + NET in1 + DIRECTION INPUT + USE SIGNAL + FIXED ( -1000 -1000 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- in2 + NET in2 + DIRECTION INPUT + USE SIGNAL + FIXED ( 333 -1000 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- clk1 + NET clk1 + DIRECTION INPUT + USE SIGNAL + FIXED ( 1000 -334 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- clk2 + NET clk2 + DIRECTION INPUT + USE SIGNAL + FIXED ( 1000 999 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- clk3 + NET clk3 + DIRECTION INPUT + USE SIGNAL + FIXED ( -332 1000 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
- out + NET out + DIRECTION OUTPUT + USE SIGNAL + FIXED ( -1000 335 ) N + LAYER M1 ( 0 0 ) ( 0 0 ) ;
END PINS
SPECIALNETS 2 ;
- VSS ( * VSS ) + USE GROUND ;
Expand Down
2 changes: 1 addition & 1 deletion src/resizer/test/rebuffer_ports1.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source "helpers.tcl"
read_liberty liberty1.lib
read_lef liberty1.lef
read_def reg1.def
read_def rebuffer_ports1.def
create_clock -period 1 {clk1 clk2 clk3}

set buffer_cell [get_lib_cell liberty1/snl_bufx2]
Expand Down

0 comments on commit 368bad3

Please sign in to comment.