Skip to content

Commit

Permalink
build/efinix/ifacewriter.py: allows the use of ClockSignal for IN_CLK…
Browse files Browse the repository at this point in the history
…_PIN (gpio)
  • Loading branch information
trabucayre committed Sep 19, 2024
1 parent aca959b commit f1e1f35
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion litex/build/efinix/ifacewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,17 @@ def generate_gpio(self, block, verbose=True):
for i, pad in enumerate(block["location"]):
cmd += f'design.assign_pkg_pin("{name}[{i}]","{pad}")\n'
if "in_reg" in block:
in_clk_pin = block["in_clk_pin"]
if isinstance(in_clk_pin, ClockSignal):
# Try to find cd name
in_clk_pin_name = self.platform.clks.get(in_clk_pin.cd, None)
# If not found cd name has been updated with "_clk" as suffix.
if in_clk_pin_name is None:
in_clk_pin_name = self.platform.clks.get(in_clk_pin.cd + "_clk")
in_clk_pin = in_clk_pin_name

cmd += f'design.set_property("{name}","IN_REG","{block["in_reg"]}")\n'
cmd += f'design.set_property("{name}","IN_CLK_PIN","{block["in_clk_pin"]}")\n'
cmd += f'design.set_property("{name}","IN_CLK_PIN","{in_clk_pin}")\n'
if "in_delay" in block:
cmd += f'design.set_property("{name}","INDELAY","{block["in_delay"]}")\n'
if prop:
Expand Down

0 comments on commit f1e1f35

Please sign in to comment.