def process_pin(self, inst, pin_name, net_name): # Geometry discovery ox, oy = inst.getOrigin() pg = self.find_pin_geometry(inst, pin_name) rl, ry = self.find_rails(net_name) # Find wires net = self.block.findNet(net_name) sw = net.getSWires()[0] # Create rail odb.dbSBox_create(sw, self.met[2], ox + pg.xMin(), rl, ox + pg.xMax(), oy + pg.yMin(), "STRIPE") # Create vias x = ox + (pg.xMin() + pg.xMax()) // 2 for y in ry: for v in self.via: odb.dbSBox_create(sw, v, x, y, "STRIPE")
def block_placement(self, test_num, flag): if ((flag and test_num == 1) or (not flag and test_num >= 1)): if (flag): print("here") placeInst(self.block.findInst('i1'), 0, 3000) placeInst(self.block.findInst('i2'), -1000, 0) placeInst(self.block.findInst('i3'), 2000, -1000) if ((flag and test_num == 2) or (not flag and test_num >= 2)): placeBPin( self.block.findBTerm('OUT').getBPins()[0], self.lib.getTech().findLayer('L1'), 2500, -1000, 2550, -950) if ((flag and test_num == 3) or (not flag and test_num >= 3)): odb.dbObstruction_create(self.block, self.lib.getTech().findLayer('L1'), -1500, 0, -1580, 50) if ((flag and test_num == 4) or (not flag and test_num >= 4)): n_s = odb.dbNet_create(self.block, 'n_s') swire = odb.dbSWire_create(n_s, 'NONE') odb.dbSBox_create(swire, self.lib.getTech().findLayer('L1'), 0, 4000, 100, 4100, 'NONE') if ((flag and test_num == 5) or (not flag and test_num >= 5)): pass
layer, box["net"], reorient=pad_pin_orient)) prev_layer = layer connections_count += 1 # ROUTING print("creating", len(wire_boxes), "wires") for box in wire_boxes: net_name = box["net"] print(net_name, ": drawing a special wire on layer", box["layer"].getName()) rect = gridify(box["rect"]) if isRoutingLayer(box["layer"]): odb.dbSBox_create(SPECIAL_NETS[net_name]["wire"], box["layer"], *rect.ll(), *rect.ur(), "COREWIRE", odb.dbSBox.UNDEFINED) else: odb.dbSBox_create(SPECIAL_NETS[net_name]["wire"], box["layer"], (rect.xMin() + rect.xMax()) // 2, (rect.yMin() + rect.yMax()) // 2, "COREWIRE") SPECIAL_NETS[net_name]["covered"] = True uncovered_nets = [ net_name for net_name in SPECIAL_NETS if not SPECIAL_NETS[net_name]["covered"] ] if len(uncovered_nets) > 0: print("No routes created on the following nets:") print(uncovered_nets)
SRAMPower(block_design).process_all() odb.write_def(block_design, output_def_file_name) import sys sys.exit(0) import opendbpy as odb db_design = odb.dbDatabase.create() odb.read_lef(db_design, 'test_pwr2/tmp/floorplan/merged_unpadded.lef') odb.read_def(db_design, 'test_pwr2/tmp/floorplan/pdn.def') chip_design = db_design.getChip() block_design = chip_design.getBlock() top_design_name = block_design.getName() vias = [ block_design.findVia(n) for n in ['via_1600x480', 'via2_1600x480', 'via3_1600x480'] ] met = [v.getTopLayer() for v in vias] net = block_design.findNet('VPWR') w = net.getSWires()[0] odb.dbSBox_create(w, met[2], 833230, 15300, 834830, 104310, "STRIPE") odb.write_def('/tmp/x.def')