Skip to content

Commit

Permalink
Merge pull request #2079 from VOGL-electronic/efinix_iface_fixups
Browse files Browse the repository at this point in the history
build: efinix: ifacewriter: some fixes
  • Loading branch information
enjoy-digital authored Sep 26, 2024
2 parents b135f71 + afcc477 commit c67dfa8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
12 changes: 7 additions & 5 deletions litex/build/efinix/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def __init__(self, platform, io, o1, o2, oe1, oe2, i1, i2, clk):
"out_reg" : "DDIO_RESYNC",
"out_clk_pin" : clk,
"oe_reg" : "REG",
"is_inclk_inverted" : False,
"in_clk_inv" : 0,
"out_clk_inv" : 0,
"drive_strength" : io_prop_dict.get("DRIVE_STRENGTH", "4")
}
platform.toolchain.ifacewriter.blocks.append(block)
Expand Down Expand Up @@ -333,7 +334,8 @@ def __init__(self, platform, io, o, oe, i, clk):
"out_reg" : "REG",
"out_clk_pin" : clk,
"oe_reg" : "REG",
"is_inclk_inverted" : False,
"in_clk_inv" : 0,
"out_clk_inv" : 0,
"drive_strength" : io_prop_dict.get("DRIVE_STRENGTH", "4")
}
platform.toolchain.ifacewriter.blocks.append(block)
Expand Down Expand Up @@ -365,7 +367,7 @@ def __init__(self, platform, i, o, clk):
"size" : 1,
"out_reg" : "REG",
"out_clk_pin" : clk,
"is_inclk_inverted" : False,
"out_clk_inv" : 0,
"drive_strength" : io_prop_dict.get("DRIVE_STRENGTH", "4")
}
platform.toolchain.ifacewriter.blocks.append(block)
Expand Down Expand Up @@ -399,7 +401,7 @@ def __init__(self, platform, i1, i2, o, clk):
"size" : 1,
"out_reg" : "DDIO_RESYNC",
"out_clk_pin" : clk,
"is_inclk_inverted" : False,
"out_clk_inv" : 0,
"drive_strength" : io_prop_dict.get("DRIVE_STRENGTH", "4")
}
platform.toolchain.ifacewriter.blocks.append(block)
Expand Down Expand Up @@ -460,7 +462,7 @@ def __init__(self, platform, i, o1, o2, clk):
"size" : 1,
"in_reg" : "DDIO_RESYNC",
"in_clk_pin" : clk,
"is_inclk_inverted" : False
"in_clk_inv" : 0
}
platform.toolchain.ifacewriter.blocks.append(block)
platform.toolchain.excluded_ios.append(platform.get_pin(i))
Expand Down
9 changes: 2 additions & 7 deletions litex/build/efinix/ifacewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,13 @@ def generate_gpio(self, block, verbose=True):
cmd += f'design.assign_pkg_pin("{name}[{i}]","{pad}")\n'

if "out_reg" in block:
cmd += f'design.set_property("{name}","oe_REG","{block["out_reg"]}")\n'

if "oe_reg" in block:
cmd += f'design.set_property("{name}","OUT_REG","{block["out_reg"]}")\n'
cmd += f'design.set_property("{name}","OUT_CLK_PIN","{block["out_clk_pin"]}")\n'
if "out_delay" in block:
cmd += f'design.set_property("{name}","OUTDELAY","{block["out_delay"]}")\n'

if "out_clk_inv" in block:
cmd += f'design.set_property("{name}","IS_OUTCLK_INVERTED","{block["out_clk_inv"]}")\n'
cmd += f'design.set_property("{name}","OE_CLK_PIN_INV","{block["out_clk_inv"]}")\n'

if "in_reg" in block:
cmd += f'design.set_property("{name}","IN_REG","{block["in_reg"]}")\n'
Expand All @@ -189,8 +185,6 @@ def generate_gpio(self, block, verbose=True):

if "oe_reg" in block:
cmd += f'design.set_property("{name}","OE_REG","{block["oe_reg"]}")\n'
if "oe_clk_pin" in block:
cmd += f'design.set_property("{name}","OE_CLK_PIN","{block["oe_clk_pin"]}")\n'

if "drive_strength" in block:
cmd += 'design.set_property("{}","DRIVE_STRENGTH","{}")\n'.format(name, block["drive_strength"])
Expand Down Expand Up @@ -225,6 +219,8 @@ def generate_gpio(self, block, verbose=True):
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 "in_clk_inv" in block:
cmd += f'design.set_property("{name}","IS_INCLK_INVERTED","{block["in_clk_inv"]}")\n'
if prop:
for p, val in prop:
cmd += 'design.set_property("{}","{}","{}")\n'.format(name, p, val)
Expand All @@ -248,7 +244,6 @@ def generate_gpio(self, block, verbose=True):

if "out_clk_inv" in block:
cmd += f'design.set_property("{name}","IS_OUTCLK_INVERTED","{block["out_clk_inv"]}")\n'
cmd += f'design.set_property("{name}","OE_CLK_PIN_INV","{block["out_clk_inv"]}")\n'

if "drive_strength" in block:
cmd += 'design.set_property("{}","DRIVE_STRENGTH","{}")\n'.format(name, block["drive_strength"])
Expand Down

0 comments on commit c67dfa8

Please sign in to comment.