From: Sebastien Bourdeauducq Date: Thu, 8 Dec 2011 17:56:14 +0000 (+0100) Subject: instances: signal override X-Git-Tag: 24jan2021_ls180~2099^2~1170 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed05ec5f6a2be6eeb332e9040b0a2124a8348e52;p=litex.git instances: signal override --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 254667aa..802e1cd2 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -157,8 +157,15 @@ class Instance: self.name = name else: self.name = of - self.outs = dict([(x[0], Signal(x[1], self.name + "_" + x[0])) for x in outs]) - self.ins = dict([(x[0], Signal(x[1], self.name + "_" + x[0])) for x in ins]) + def process_io(x): + if isinstance(x[1], Signal): + return x # override + elif isinstance(x[1], BV): + return (x[0], Signal(x[1], self.name + "_" + x[0])) + else: + raise TypeError + self.outs = dict(map(process_io, outs)) + self.ins = dict(map(process_io, ins)) self.parameters = parameters self.clkport = clkport self.rstport = rstport