Does anyone have examples of using OpenDB python b...
# openlane
t
Does anyone have examples of using OpenDB python bindings to place some cells on the grid ?
a
Check https://github.com/efabless/openlane/blob/develop/scripts/contextualize.py#L118 for the general structure. (e.g.,
setLocation
and
setPlacementStatus("PLACED")
). You probably also want to check
OpenDB/build/src/swig/python/opendbpy.py
for a list of functions that you can use. One last useful source is this: https://github.com/The-OpenROAD-Project/DAC-2020-Tutorial/tree/master/7_opendb_python_api
t
Ah thanks, that's what I eventually came up with. I was just wondering if there was some helper or something to place at a given row/site, rather than manual location, but seems not.
a
Hmm; perhaps the following could help?
Copy code
class dbRow(object):
Copy code
class dbSite(object):
Copy code
def getRows(self):
        return _opendbpy.dbBlock_getRows(self)
t
Yeah, I did find the rows and that's what I'm using to align. I thought maybe there was a "addInst" on the row object or something that would automatically put the cell with the right orientation and aligned with the spacing etc ... but after checking the sources, doesn't look like ti. So it ends up being something like :
Copy code
x,y = row.getOrigin()
x += row.getSpacing() * 7

mymux = odb.dbInst_create(blk, mux, "TestMux")
mymux.setOrient(row.getOrient())
mymux.setLocation(x, y)
mymux.setPlacementStatus('FIRM')
When looking at the output of routing (
runs/xxx/results/routing/design.def
) the routed net are more like wires (zero width) than actual metal planes. What is the step that convert them into real physical wires ?
a
They are only represented as routes; the default width is inherited from the tech LEF.