Ejemplo n.º 1
0
    def mapToIR(self, ctx: EmitterContext):
        name = ctx.getName(self)
        fs = []
        for k, v in self._ios.items():
            f = v.mapToIOFieldIR(k, ctx)
            fs.append(f)

        typ = low_ir.BundleType(fs)
        port = low_ir.Port(name, low_ir.Output(), low_ir.BundleType(fs))
        ref = low_ir.Reference(name, typ)
        ctx.updateRef(self, ref)
        ctx.appendFinalPort(port)
        return ref
Ejemplo n.º 2
0
    def _mapToBundle(self, finalPorts):
        fs = []
        for i in finalPorts:
            if i.direction == low_ir.Input():
                fs.append(low_ir.Field(i.name, low_ir.Flip(), i.typ))
            else:
                fs.append(low_ir.Field(i.name, low_ir.Default(), i.typ))

        return low_ir.BundleType(fs)
Ejemplo n.º 3
0
 def mapToIR(self, ctx: EmitterContext):
     fs = []
     for k, v in self._kv.items():
         f = low_ir.Field(k, low_ir.Default(), v.mapToIR(ctx))
         fs.append(f)
     return low_ir.BundleType(fs)