Dear Alien007,
DRC can have many forms. The Nazca DRC is mostly aimed the netlist or logical connection level.
(For polygon level on the gds, DRC in Klayout can help out in a next step.)
Below an example of the Nazca DRC that defines xsections, layers, a building block, some interconnects and then connects them having different pin xsections and/or widths. This will trigger a DRC error. This will be displayed to stdout but a logfile can be added, as in this example, to store the DRC error messages.
import nazca as nd
nd.logfile(__file__) # create logfile that will list DRC errors
nd.pin2pin_drc_on() # switch on pin2pin connection drc
lay1 = nd.add_layer(name='lay1', layer=1)
lay2 = nd.add_layer(name='lay2', layer=2)
xs1 = nd.add_xsection(name='xs1')
nd.add_layer2xsection(xsection='xs1', layer='lay1')
ic1 = nd.interconnects.Interconnect(xs='xs1')
xs2 = nd.add_xsection(name='xs2')
nd.add_layer2xsection(xsection='xs2', layer='lay2')
ic2 = nd.interconnects.Interconnect(xs='xs2')
with nd.Cell(name='myBB') as bb:
nd.Polygon(points=[[0, -5], [0, 5], [10, 5], [10, -5]], layer='lay1').put(0)
nd.Pin(name='a0', xs='xs1').put(0, 0, 180)
nd.Pin(name='b0', xs='xs2').put(10, 0, 0)
nd.put_stub()
ic2.strt().put(0)
bb.put()
ic1.bend().put()
ic1.strt(width=0.5).put()
nd.export_plt()
DRC violations are added to the logfile and visualized in the layout. If you want to find out where in your script a DRC error was caused, you can ask Nazca to raise an exception on the specific error number by changing the third line in the above code to nd.pin2pin_drc_on(num=0)
(for error DRC-0). Use standard Python traceback to find where in your script the eroor originated.
Ronald