From: Nina Engelhardt Date: Sat, 3 Aug 2013 08:51:04 +0000 (+0200) Subject: fhdl/edif: add support for inout signals X-Git-Tag: 24jan2021_ls180~2099^2~487 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7372c7a97c721b2e13956371606278c6d82a8e0c;p=litex.git fhdl/edif: add support for inout signals --- diff --git a/migen/fhdl/edif.py b/migen/fhdl/edif.py index dd63f87e..4a1eb0c2 100644 --- a/migen/fhdl/edif.py +++ b/migen/fhdl/edif.py @@ -113,6 +113,8 @@ def _generate_cells(f): port_list.append(_Port(port.name, "INPUT")) elif isinstance(port, Instance.Output): port_list.append(_Port(port.name, "OUTPUT")) + elif isinstance(port, Instance.InOut): + port_list.append(_Port(port.name, "INOUT")) elif isinstance(port, Instance.Parameter): pass else: @@ -136,6 +138,8 @@ def _generate_instances(f,ns): pass elif isinstance(prop, Instance.Output): pass + elif isinstance(prop, Instance.InOut): + pass elif isinstance(prop, Instance.Parameter): props.append(_Property(name=prop.name, value=prop.value)) else: @@ -147,9 +151,10 @@ def _generate_instances(f,ns): def _generate_ios(f, ios, ns): outs = list_special_ios(f, False, True, False) + inouts = list_special_ios(f, False, False, True) r = [] for io in ios: - direction = "OUTPUT" if io in outs else "INPUT" + direction = "OUTPUT" if io in outs else "INOUT" if io in inouts else "INPUT" r.append(_Port(name=ns.get_name(io), direction=direction)) return r @@ -159,7 +164,7 @@ def _generate_connections(f, ios, ns): if isinstance(special, Instance): instname = ns.get_name(special) for port in special.items: - if isinstance(port, Instance.Input) or isinstance(port, Instance.Output): + if isinstance(port, Instance.Input) or isinstance(port, Instance.Output) or isinstance(port, Instance.InOut): s = ns.get_name(port.expr) if s not in r: r[s] = []