示例#1
0
class UnParameterized:
    x = pycde.Input(pycde.types.i1)
    y = pycde.Output(pycde.types.i1)

    @pycde.generator
    def construct(ports):
        ports.y = ports.x
示例#2
0
    class TestModule:
        x = pycde.Input(pycde.types.i1)
        y = pycde.Output(pycde.types.i1)

        @pycde.generator
        def construct(ports):
            ports.y = ports.x
示例#3
0
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
示例#4
0
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
示例#5
0
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}")