class UnParameterized: x = pycde.Input(pycde.types.i1) y = pycde.Output(pycde.types.i1) @pycde.generator def construct(ports): ports.y = ports.x
class TestModule: x = pycde.Input(pycde.types.i1) y = pycde.Output(pycde.types.i1) @pycde.generator def construct(ports): ports.y = ports.x
class UnParameterized: x = pycde.Input(pycde.types.i1) y = pycde.Output(pycde.types.i1) @pycde.generator def construct(mod): Nothing().name = "nothing_inst" mod.y = mod.x
class UnParameterized: clk = pycde.Clock() x = pycde.Input(pycde.types.i1) y = pycde.Output(pycde.types.i1) @pycde.generator def construct(mod): Nothing().name = "nothing_inst" mod.y = Delay(clk=mod.clk, x=mod.x).y
class Delay: clk = pycde.Clock() x = pycde.Input(pycde.types.i1) y = pycde.Output(pycde.types.i1) @pycde.generator def construct(mod): r = mod.x.reg(mod.clk, appid=AppID("reg", 0)) mod.y = r # CHECK: r appid: reg[0] print(f"r appid: {r.appid}") r.appid = AppID("reg", 4) # CHECK: r appid: reg[4] print(f"r appid: {r.appid}")