https://open-source-silicon.dev logo
#openlane
Title
# openlane
t

tnt

08/07/2020, 8:22 AM
Does anyone have examples of using OpenDB python bindings to place some cells on the grid ?
a

Ahmed Ghazy

08/07/2020, 9:56 AM
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

tnt

08/07/2020, 10:07 AM
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

Ahmed Ghazy

08/07/2020, 10:09 AM
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

tnt

08/07/2020, 10:23 AM
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

Ahmed Ghazy

08/07/2020, 3:23 PM
They are only represented as routes; the default width is inherited from the tech LEF.