From fcc4a75295f77ceb5468cb2a6f5574e479e48a55 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Tue, 11 Sep 2018 13:28:28 -0700 Subject: [PATCH] Create VCG using nets as nodes rather than pins. --- compiler/base/hierarchy_layout.py | 98 ++++++++++++++++++++-------- compiler/tests/20_sram_1bank_test.py | 4 +- 2 files changed, 72 insertions(+), 30 deletions(-) diff --git a/compiler/base/hierarchy_layout.py b/compiler/base/hierarchy_layout.py index 3ac5ea63..331e1195 100644 --- a/compiler/base/hierarchy_layout.py +++ b/compiler/base/hierarchy_layout.py @@ -602,6 +602,7 @@ class layout(lef.lef): """ Connect a mapping of pin -> name for a bus. This could be replaced with a channel router in the future. + NOTE: This has only really been tested with point-to-point connections (not multiple pins on a net). """ (horizontal_layer, via_layer, vertical_layer)=layer_stack if horizontal: @@ -720,6 +721,7 @@ class layout(lef.lef): try to minimize the number of tracks -- instead, it picks an order to avoid the vertical conflicts between pins. """ + local_debug = True def remove_net_from_graph(pin, g): # Remove the pin from the keys @@ -732,6 +734,29 @@ class layout(lef.lef): g[other_pin]=conflicts return g + def vcg_pins_overlap(pins1, pins2, vertical): + # Check all the pin pairs on two nets and return a pin + # overlap if any pin overlaps vertically + for pin1 in pins1: + for pin2 in pins2: + if vcg_pin_overlap(pin1, pin2, vertical): + return True + + return False + + def vcg_pin_overlap(pin1, pin2, vertical): + # Check for vertical overlap of the two pins + + # Pin 1 must be in the "LEFT" set and overlap the right + x_overlap = pin1.lx() < pin2.lx() and abs(pin1.center().x-pin2.center().x) pin2.by() and abs(pin1.center().y-pin2.center().y)