Skip to content

Commit

Permalink
Traverse ip:xpm_cdc_gen to get decouple pin. RapidWright integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Ruiz committed Feb 3, 2022
1 parent acd2977 commit d92bb0c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pynq_composable/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ def _dfx_get_oposite_port(port: str) -> str:


def _get_dfxdecoupler_decouple_gpio_pin(signame: str,
tree: ElementTree) -> Union[int, None]:
tree: ElementTree,
module: ElementTree.Element=None) -> Union[int, None]:
"""Find the gpio pins that controls the DFX decoupler pin"""

search_term = "MODULES/*PORTS/*/[@SIGNAME=\'" + signame + "\']....."
node = tree.findall(search_term)
for m in node:
if m.get('VLNV') == 'xilinx.com:ip:xlslice:1.0':
if 'xilinx.com:ip:xlslice' in m.get('VLNV'):

din_from = int(m.find("./PARAMETERS/*[@NAME='DIN_FROM']")
.get('VALUE'))
Expand All @@ -87,6 +88,9 @@ def _get_dfxdecoupler_decouple_gpio_pin(signame: str,
raise ValueError("{} cannot be more than 1-bit wide"
.format(signame))
return din_to
elif 'xilinx.com:ip:xpm_cdc_gen' in m.get('VLNV') and m != module:
return _get_dfxdecoupler_decouple_gpio_pin(
m.find("./PORTS/*[@NAME='src_in']").get('SIGNAME'), tree, m)
return None


Expand Down

0 comments on commit d92bb0c

Please sign in to comment.