Skip to content

Instantly share code, notes, and snippets.

@lethalbit

lethalbit/inverter_example.py Secret

Created Apr 1, 2021
Embed
What would you like to do?
nmigen -> openlane example
from nmigen.build import *
from nmigen.vendor.open_lane import *
class sky130_fd_sc_hd(OpenLANEPlatform):
openlane_root = environ['OPENLANE_ROOT']
pdk = "sky130A"
cell_library = "sky130_fd_sc_hd"
settings = {
"PL_TARGET_DENSITY": 0.75,
"FP_HORIZONTAL_HALO": 6,
"FP_VERTICAL_HALO": 6,
"FP_CORE_UTIL": 5,
}
connectors = []
resources = []
class inv(Elaboratable):
def __init__(self, width=8):
self.i = Signal(width)
self.o = Signal(width)
def elaborate(self, platform):
m = Module()
m.d.comb += self.o.eq(~self.i)
return m
def get_ports(self):
return [self.i, self.o]
if __name__ == "__main__":
platform = sky130_fd_sc_hd()
inverter = inv()
platform.build(inverter, name="inverter", ports=inverter.get_ports())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment