From 78c35365e8a07b3ea3ca0e2f22ace761a238ea5f Mon Sep 17 00:00:00 2001 From: Franck Jullien Date: Mon, 4 Apr 2022 17:47:55 +0200 Subject: [PATCH 1/2] efinix:ifacewriter: add in_reg and out_reg to gpio block --- litex/build/efinix/ifacewriter.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/litex/build/efinix/ifacewriter.py b/litex/build/efinix/ifacewriter.py index 7949759e0..6a3682122 100644 --- a/litex/build/efinix/ifacewriter.py +++ b/litex/build/efinix/ifacewriter.py @@ -164,6 +164,25 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True) cmd += f'design.create_inout_gpio("{name}",{block["size"]-1},0)\n' for i, pad in enumerate(block["location"]): cmd += f'design.assign_pkg_pin("{name}[{i}]","{pad}")\n' + + if "out_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 "in_reg" in block: + 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' + if "in_delay" in block: + cmd += f'design.set_property("{name}","INDELAY","{block["in_delay"]}")\n' + + if "oe_reg" in block: + if block["oe_reg"] == True: + 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 prop: for p, val in prop: cmd += 'design.set_property("{}","{}","{}")\n'.format(name, p, val) @@ -181,6 +200,8 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True) if "in_reg" in block: 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' + if "in_delay" in block: + cmd += f'design.set_property("{name}","INDELAY","{block["in_delay"]}")\n' if prop: for p, val in prop: cmd += 'design.set_property("{}","{}","{}")\n'.format(name, p, val) @@ -199,6 +220,8 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True) if "out_reg" in block: cmd += 'design.set_property("{}","OUT_REG","{}")\n'.format(name, block["out_reg"]) cmd += 'design.set_property("{}","OUT_CLK_PIN","{}")\n'.format(name, block["out_clk_pin"]) + if "out_delay" in block: + cmd += 'design.set_property("{}","OUTDELAY","{}")\n'.format(name, block["out_delay"]) if "drive_strength" in block: cmd += 'design.set_property("{}","DRIVE_STRENGTH","4")\n'.format(name, block["drive_strength"]) From 66e49249ccafe222500d89b3f088de284ec67651 Mon Sep 17 00:00:00 2001 From: Franck Jullien Date: Thu, 14 Apr 2022 10:34:06 +0200 Subject: [PATCH 2/2] efinix:ifacewriter: add out_clk_inv and in_clk_inv to gpio block --- litex/build/efinix/ifacewriter.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/litex/build/efinix/ifacewriter.py b/litex/build/efinix/ifacewriter.py index 6a3682122..bfbb6f32c 100644 --- a/litex/build/efinix/ifacewriter.py +++ b/litex/build/efinix/ifacewriter.py @@ -171,15 +171,21 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True) 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' cmd += f'design.set_property("{name}","IN_CLK_PIN","{block["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 "oe_reg" in block: - if block["oe_reg"] == True: - cmd += f'design.set_property("{name}","OE_REG","{block["oe_reg"]}")\n' + 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' @@ -223,6 +229,10 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True) if "out_delay" in block: cmd += 'design.set_property("{}","OUTDELAY","{}")\n'.format(name, block["out_delay"]) + 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","4")\n'.format(name, block["drive_strength"])