def mapToIR(self, ctx: EmitterContext): # Define Wire name = ctx.getName(self) typ = self.typ.mapToIR(ctx) wire = low_ir.DefWire(name, typ) ctx.appendFinalStatement(wire, self.scopeId) ref = low_ir.Reference(name, typ) ctx.updateRef(self, ref) # Connect Elements for i, node in enumerate(self.lst): for idx, elem in self.subIdxs(low_ir.SubIndex(ref, i, typ.typ), node, ctx): con = low_ir.Connect(idx, elem) ctx.appendFinalStatement(con, self.scopeId) return ref
def _unsafeConnect(lref, rref, ctx, scopeId): c = low_ir.Connect(lref, rref) ctx.appendFinalStatement(c, scopeId)