dan-fritchman / Hdl21

Hardware Description Library
BSD 3-Clause "New" or "Revised" License
60 stars 13 forks source link

Sky130 `compile` rejecting non-PDK primitives #131

Closed dan-fritchman closed 1 year ago

dan-fritchman commented 1 year ago

Appears we had a change in behavior in the Sky130 PDK compiler, if fed circuits with Primitives it doesn't map to its own.
(E.g. Vdc, Idc.)

Something like:

class Sky130Walker(h.HierarchyWalker):
    ... 
    def visit_primitive_call(self, call: h.PrimitiveCall) -> h.Instantiable:
        if call.prim is Mos:
            ... # do stuff 

        elif call.prim is PhysicalResistor or call.prim is ThreeTerminalResistor:
            ... # do other stuff 

        # ... more branches like that 

        else: # <= What it does now
            raise RuntimeError(f"{call.prim} is not legitimate primitive")

        # => What it used to do - Return everything else as-is
        return call

@ThomasPluck - that on purpose?

ThomasPluck commented 1 year ago

Nope, will open up a quick PR to fix this.