mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
mibuild: support pin names in IO extensions
This commit is contained in:
parent
452c60e0c3
commit
cea1551ae0
1 changed files with 12 additions and 5 deletions
|
@ -68,10 +68,16 @@ class ConnectorManager:
|
||||||
for connector in connectors:
|
for connector in connectors:
|
||||||
cit = iter(connector)
|
cit = iter(connector)
|
||||||
conn_name = next(cit)
|
conn_name = next(cit)
|
||||||
pin_list = []
|
if isinstance(connector[1], str):
|
||||||
for pins in cit:
|
pin_list = []
|
||||||
pin_list += pins.split()
|
for pins in cit:
|
||||||
pin_list = [None if pin == "None" else pin for pin in pin_list]
|
pin_list += pins.split()
|
||||||
|
pin_list = [None if pin == "None" else pin for pin in pin_list]
|
||||||
|
elif isinstance(connector[1], dict):
|
||||||
|
pin_list = connector[1]
|
||||||
|
else:
|
||||||
|
raise ValueError("Unsupported pin list type {} for connector"
|
||||||
|
" {}".format(type(connector[1]), conn_name))
|
||||||
if conn_name in self.connector_table:
|
if conn_name in self.connector_table:
|
||||||
raise ValueError("Connector specified more than once: "+conn_name)
|
raise ValueError("Connector specified more than once: "+conn_name)
|
||||||
self.connector_table[conn_name] = pin_list
|
self.connector_table[conn_name] = pin_list
|
||||||
|
@ -81,7 +87,8 @@ class ConnectorManager:
|
||||||
for identifier in identifiers:
|
for identifier in identifiers:
|
||||||
if ":" in identifier:
|
if ":" in identifier:
|
||||||
conn, pn = identifier.split(":")
|
conn, pn = identifier.split(":")
|
||||||
pn = int(pn)
|
if pn.isdigit():
|
||||||
|
pn = int(pn)
|
||||||
r.append(self.connector_table[conn][pn])
|
r.append(self.connector_table[conn][pn])
|
||||||
else:
|
else:
|
||||||
r.append(identifier)
|
r.append(identifier)
|
||||||
|
|
Loading…
Reference in a new issue