From 10ab1b76c0fd97c5163a29d1c3fa4ebaec074966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Wed, 25 Sep 2024 10:59:39 +0200 Subject: [PATCH 1/4] efinix: ifacewriter: fix `out_reg` in GPIO INOUT block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix `out_reg` in GPIO INOUT block. Signed-off-by: Fin Maaß --- litex/build/efinix/ifacewriter.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/litex/build/efinix/ifacewriter.py b/litex/build/efinix/ifacewriter.py index 6a53c8ccb3..f4c36fe080 100644 --- a/litex/build/efinix/ifacewriter.py +++ b/litex/build/efinix/ifacewriter.py @@ -166,9 +166,6 @@ 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: From 2c3536720cea43665f5ba89d7492cee651edabf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Wed, 25 Sep 2024 11:00:50 +0200 Subject: [PATCH 2/4] efinix: ifacewriter: add `in_clk_inv` for GPIO INPUT block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add `in_clk_inv` for GPIO INPUT block. Signed-off-by: Fin Maaß --- litex/build/efinix/ifacewriter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litex/build/efinix/ifacewriter.py b/litex/build/efinix/ifacewriter.py index f4c36fe080..a14d6e7532 100644 --- a/litex/build/efinix/ifacewriter.py +++ b/litex/build/efinix/ifacewriter.py @@ -222,6 +222,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) From a605e758730d8b4e26278807b80d182b469c38ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Wed, 25 Sep 2024 11:04:59 +0200 Subject: [PATCH 3/4] efinix: ifacewriter: remove deprecated GPIO properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit removes `OE_CLK_PIN_INV` and `OE_CLK_PIN` as they got deprecated in efinity 2023.1. Signed-off-by: Fin Maaß --- litex/build/efinix/ifacewriter.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/litex/build/efinix/ifacewriter.py b/litex/build/efinix/ifacewriter.py index a14d6e7532..ffae3b2d94 100644 --- a/litex/build/efinix/ifacewriter.py +++ b/litex/build/efinix/ifacewriter.py @@ -173,7 +173,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 "in_reg" in block: cmd += f'design.set_property("{name}","IN_REG","{block["in_reg"]}")\n' @@ -186,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"]) @@ -247,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"]) From afcc477c4efc2460c75c00351163c9e3a102b153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Wed, 25 Sep 2024 11:10:18 +0200 Subject: [PATCH 4/4] efinix: common: replace `is_inclk_inverted` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit replace `is_inclk_inverted` with `in_clk_inv` and `out_clk_inv`. This way thwe right prop is set in the ifacewriter.py. Signed-off-by: Fin Maaß --- litex/build/efinix/common.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/litex/build/efinix/common.py b/litex/build/efinix/common.py index f43afb0c6a..28aa62c747 100644 --- a/litex/build/efinix/common.py +++ b/litex/build/efinix/common.py @@ -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) @@ -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) @@ -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) @@ -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) @@ -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))