build/efinix/ifacewriter: Ident set_property in generate functions to make it more understandable (for the ones who like black magic... :)

This commit is contained in:
Florent Kermarrec 2023-11-17 12:06:24 +01:00
parent 16bbb8cdd2
commit 022776801a

View file

@ -415,22 +415,22 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
cmd.append('design.create_block("{}", block_type="{}", tx_mode="{}")'.format(name, block_type, tx_mode)) cmd.append('design.create_block("{}", block_type="{}", tx_mode="{}")'.format(name, block_type, tx_mode))
if self.platform.family == "Titanium": if self.platform.family == "Titanium":
cmd.append('design.set_property("{}", "TX_DELAY", "{}", "{}")'.format(name, delay, block_type)) cmd.append('design.set_property("{}", "TX_DELAY", "{}", "{}")'.format(name, delay, block_type))
cmd.append('design.set_property("{}", "TX_DIFF_TYPE", "LVDS", "{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "TX_DIFF_TYPE", "LVDS", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}", "TX_HALF_RATE", "{}", "{}")'.format(name, half_rate, block_type)) cmd.append('design.set_property("{}", "TX_HALF_RATE", "{}", "{}")'.format(name, half_rate, block_type))
cmd.append('design.set_property("{}", "TX_PRE_EMP", "MEDIUM_LOW", "{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "TX_PRE_EMP", "MEDIUM_LOW", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}", "TX_VOD", "TYPICAL", "{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "TX_VOD", "TYPICAL", "{}")'.format(name, block_type))
else: else:
cmd.append('design.set_property("{}","TX_OUTPUT_LOAD","3","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "TX_OUTPUT_LOAD", "3", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","TX_REDUCED_SWING","0","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "TX_REDUCED_SWING", "0", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","TX_SLOWCLK_DIV","1","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "TX_SLOWCLK_DIV", "1", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}", "TX_SER", "{}", "{}")'.format(name, size, block_type)) cmd.append('design.set_property("{}", "TX_SER", "{}", "{}")'.format(name, size, block_type))
cmd.append('design.set_property("{}", "TX_EN_SER", "{}", "{}")'.format(name, serdes, block_type)) cmd.append('design.set_property("{}", "TX_EN_SER", "{}", "{}")'.format(name, serdes, block_type))
cmd.append('design.set_property("{}", "TX_FASTCLK_PIN", "{}", "{}")'.format(name, fast_clk, block_type)) cmd.append('design.set_property("{}", "TX_FASTCLK_PIN", "{}", "{}")'.format(name, fast_clk, block_type))
cmd.append('design.set_property("{}", "TX_MODE", "{}", "{}")'.format(name, tx_mode, block_type)) cmd.append('design.set_property("{}", "TX_MODE", "{}", "{}")'.format(name, tx_mode, block_type))
cmd.append('design.set_property("{}", "TX_OE_PIN", "{}", "{}")'.format(name, oe_pin, block_type)) cmd.append('design.set_property("{}", "TX_OE_PIN", "{}", "{}")'.format(name, oe_pin, block_type))
cmd.append('design.set_property("{}", "TX_OUT_PIN", "{}", "{}")'.format(name, sig.name, block_type)) cmd.append('design.set_property("{}", "TX_OUT_PIN", "{}", "{}")'.format(name, sig.name, block_type))
cmd.append('design.set_property("{}", "TX_RST_PIN", "{}", "{}")'.format(name, rst_pin, block_type)) cmd.append('design.set_property("{}", "TX_RST_PIN", "{}", "{}")'.format(name, rst_pin, block_type))
cmd.append('design.set_property("{}", "TX_SLOWCLK_PIN", "{}", "{}")'.format(name, slow_clk, block_type)) cmd.append('design.set_property("{}", "TX_SLOWCLK_PIN", "{}", "{}")'.format(name, slow_clk, block_type))
else: else:
block_type = "LVDS_RX" block_type = "LVDS_RX"
@ -461,37 +461,37 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
cmd.append('design.create_block("{}", block_type="{}", rx_conn_type="{}")'.format(name, block_type, rx_mode)) cmd.append('design.create_block("{}", block_type="{}", rx_conn_type="{}")'.format(name, block_type, rx_mode))
if self.platform.family == "Titanium": if self.platform.family == "Titanium":
cmd.append('design.set_property("{}","GBUF","","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "GBUF", "", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","RX_DBG_PIN","","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "RX_DBG_PIN", "", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","RX_TERM_PIN","{}","{}")'.format(name, term, block_type)) cmd.append('design.set_property("{}", "RX_TERM_PIN", "{}", "{}")'.format(name, term, block_type))
cmd.append('design.set_property("{}","RX_VOC_DRIVER","0","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "RX_VOC_DRIVER", "0", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","RX_SLVS","0","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "RX_SLVS","0", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","RX_FIFO","0","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "RX_FIFO","0", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","RX_HALF_RATE","{}","{}")'.format(name, half_rate, block_type)) cmd.append('design.set_property("{}", "RX_HALF_RATE", "{}", "{}")'.format(name, half_rate, block_type))
cmd.append('design.set_property("{}","RX_ENA_PIN","{}","{}")'.format(name, ena, block_type)) cmd.append('design.set_property("{}", "RX_ENA_PIN", "{}", "{}")'.format(name, ena, block_type))
cmd.append('design.set_property("{}","RX_DELAY_MODE","{}","{}")'.format(name, rx_delay, block_type)) cmd.append('design.set_property("{}", "RX_DELAY_MODE", "{}", "{}")'.format(name, rx_delay, block_type))
cmd.append('design.set_property("{}","RX_DLY_ENA_PIN","{}","{}")'.format(name, delay_ena, block_type)) cmd.append('design.set_property("{}", "RX_DLY_ENA_PIN", "{}", "{}")'.format(name, delay_ena, block_type))
cmd.append('design.set_property("{}","RX_DLY_INC_PIN","{}","{}")'.format(name, delay_inc, block_type)) cmd.append('design.set_property("{}", "RX_DLY_INC_PIN", "{}", "{}")'.format(name, delay_inc, block_type))
cmd.append('design.set_property("{}","RX_DLY_RST_PIN","{}","{}")'.format(name, delay_rst, block_type)) cmd.append('design.set_property("{}", "RX_DLY_RST_PIN", "{}", "{}")'.format(name, delay_rst, block_type))
# Optional # Optional
#cmd.append('design.set_property("{}","RX_FIFOCLK_PIN","","{}")'.format(name, block_type)) #cmd.append('design.set_property("{}", "RX_FIFOCLK_PIN", "", "{}")'.format(name, block_type))
#cmd.append('design.set_property("{}","RX_FIFO_EMPTY_PIN","lvds_rx_inst1_RX_FIFO_EMPTY","{}")'.format(name, block_type)) #cmd.append('design.set_property("{}", "RX_FIFO_EMPTY_PIN", "lvds_rx_inst1_RX_FIFO_EMPTY", "{}")'.format(name, block_type))
#cmd.append('design.set_property("{}","RX_FIFO_RD_PIN","lvds_rx_inst1_RX_FIFO_RD","{}")'.format(name, block_type)) #cmd.append('design.set_property("{}", "RX_FIFO_RD_PIN", "lvds_rx_inst1_RX_FIFO_RD", "{}")'.format(name, block_type))
#cmd.append('design.set_property("{}","RX_LOCK_PIN","lvds_rx_inst1_RX_LOCK","{}")'.format(name, block_type)) #cmd.append('design.set_property("{}", "RX_LOCK_PIN", "lvds_rx_inst1_RX_LOCK", "{}")'.format(name, block_type))
else: else:
rx_delay = "0" rx_delay = "0"
cmd.append('design.set_property("{}","RX_EN_DELAY","{}","{}")'.format(name, rx_delay, block_type)) cmd.append('design.set_property("{}","RX_EN_DELAY","{}","{}")'.format(name, rx_delay, block_type))
if not (self.platform.family == "Trion" and serdes == 0): if not (self.platform.family == "Trion" and serdes == 0):
cmd.append('design.set_property("{}","RX_DESER","{}","{}")'.format(name, size, block_type)) cmd.append('design.set_property("{}","RX_DESER","{}","{}")'.format(name, size, block_type))
cmd.append('design.set_property("{}","RX_CONN_TYPE","{}","{}")'.format(name, rx_mode, block_type)) cmd.append('design.set_property("{}", "RX_CONN_TYPE", "{}", "{}")'.format(name, rx_mode, block_type))
cmd.append('design.set_property("{}","RX_DELAY","{}","{}")'.format(name, delay, block_type)) cmd.append('design.set_property("{}", "RX_DELAY", "{}", "{}")'.format(name, delay, block_type))
cmd.append('design.set_property("{}","RX_EN_DESER","{}","{}")'.format(name, serdes, block_type)) cmd.append('design.set_property("{}", "RX_EN_DESER", "{}", "{}")'.format(name, serdes, block_type))
cmd.append('design.set_property("{}","RX_FASTCLK_PIN","{}","{}")'.format(name, fast_clk, block_type)) cmd.append('design.set_property("{}", "RX_FASTCLK_PIN", "{}", "{}")'.format(name, fast_clk, block_type))
cmd.append('design.set_property("{}","RX_IN_PIN","{}","{}")'.format(name, sig.name, block_type)) cmd.append('design.set_property("{}", "RX_IN_PIN", "{}", "{}")'.format(name, sig.name, block_type))
cmd.append('design.set_property("{}","RX_SLOWCLK_PIN","{}","{}")'.format(name, slow_clk, block_type)) cmd.append('design.set_property("{}", "RX_SLOWCLK_PIN", "{}", "{}")'.format(name, slow_clk, block_type))
cmd.append('design.set_property("{}","RX_TERM","ON","{}")'.format(name, block_type)) cmd.append('design.set_property("{}", "RX_TERM", "ON", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}","RX_RST_PIN","{}","{}")'.format(name, rst_pin, block_type)) cmd.append('design.set_property("{}", "RX_RST_PIN", "{}", "{}")'.format(name, rst_pin, block_type))
cmd.append('design.assign_resource("{}", "{}", "{}")\n'.format(name, location, block_type)) cmd.append('design.assign_resource("{}", "{}", "{}")\n'.format(name, location, block_type))
@ -508,23 +508,23 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
cmd = [] cmd = []
cmd.append('design.create_block("{}", "{}")'.format(name, block_type)) cmd.append('design.create_block("{}", "{}")'.format(name, block_type))
cmd.append('design.set_property("{}", "CK_N_HI_PIN", "{}", "{}")'.format(name, pads.clkn_h.name, block_type)) cmd.append('design.set_property("{}", "CK_N_HI_PIN", "{}", "{}")'.format(name, pads.clkn_h.name, block_type))
cmd.append('design.set_property("{}", "CK_N_LO_PIN", "{}", "{}")'.format(name, pads.clkn_l.name, block_type)) cmd.append('design.set_property("{}", "CK_N_LO_PIN", "{}", "{}")'.format(name, pads.clkn_l.name, block_type))
cmd.append('design.set_property("{}", "CK_P_HI_PIN", "{}", "{}")'.format(name, pads.clkp_h.name, block_type)) cmd.append('design.set_property("{}", "CK_P_HI_PIN", "{}", "{}")'.format(name, pads.clkp_h.name, block_type))
cmd.append('design.set_property("{}", "CK_P_LO_PIN", "{}", "{}")'.format(name, pads.clkp_l.name, block_type)) cmd.append('design.set_property("{}", "CK_P_LO_PIN", "{}", "{}")'.format(name, pads.clkp_l.name, block_type))
cmd.append('design.set_property("{}", "CLK90_PIN", "{}", "{}")'.format(name, clk90_clk, block_type)) cmd.append('design.set_property("{}", "CLK90_PIN", "{}", "{}")'.format(name, clk90_clk, block_type))
cmd.append('design.set_property("{}", "CLKCAL_PIN", "{}", "{}")'.format(name, cal_clk, block_type)) cmd.append('design.set_property("{}", "CLKCAL_PIN", "{}", "{}")'.format(name, cal_clk, block_type))
cmd.append('design.set_property("{}", "CLK_PIN", "{}", "{}")'.format(name, ctl_clk, block_type)) cmd.append('design.set_property("{}", "CLK_PIN", "{}", "{}")'.format(name, ctl_clk, block_type))
cmd.append('design.set_property("{}", "CS_N_PIN", "{}", "{}")'.format(name, pads.csn.name, block_type)) cmd.append('design.set_property("{}", "CS_N_PIN", "{}", "{}")'.format(name, pads.csn.name, block_type))
cmd.append('design.set_property("{}", "DQ_IN_HI_PIN", "{}", "{}")'.format(name, pads.dq_i_h.name, block_type)) cmd.append('design.set_property("{}", "DQ_IN_HI_PIN", "{}", "{}")'.format(name, pads.dq_i_h.name, block_type))
cmd.append('design.set_property("{}", "DQ_IN_LO_PIN", "{}", "{}")'.format(name, pads.dq_i_l.name, block_type)) cmd.append('design.set_property("{}", "DQ_IN_LO_PIN", "{}", "{}")'.format(name, pads.dq_i_l.name, block_type))
cmd.append('design.set_property("{}", "DQ_OE_PIN", "{}", "{}")'.format(name, pads.dq_oe.name, block_type)) cmd.append('design.set_property("{}", "DQ_OE_PIN", "{}", "{}")'.format(name, pads.dq_oe.name, block_type))
cmd.append('design.set_property("{}", "DQ_OUT_HI_PIN", "{}", "{}")'.format(name, pads.dq_o_h.name, block_type)) cmd.append('design.set_property("{}", "DQ_OUT_HI_PIN", "{}", "{}")'.format(name, pads.dq_o_h.name, block_type))
cmd.append('design.set_property("{}", "DQ_OUT_LO_PIN", "{}", "{}")'.format(name, pads.dq_o_l.name, block_type)) cmd.append('design.set_property("{}", "DQ_OUT_LO_PIN", "{}", "{}")'.format(name, pads.dq_o_l.name, block_type))
cmd.append('design.set_property("{}", "RST_N_PIN", "{}", "{}")'.format(name, pads.rstn.name, block_type)) cmd.append('design.set_property("{}", "RST_N_PIN", "{}", "{}")'.format(name, pads.rstn.name, block_type))
cmd.append('design.set_property("{}", "RWDS_IN_HI_PIN", "{}", "{}")'.format(name, pads.rwds_i_h.name, block_type)) cmd.append('design.set_property("{}", "RWDS_IN_HI_PIN", "{}", "{}")'.format(name, pads.rwds_i_h.name, block_type))
cmd.append('design.set_property("{}", "RWDS_IN_LO_PIN", "{}", "{}")'.format(name, pads.rwds_i_l.name, block_type)) cmd.append('design.set_property("{}", "RWDS_IN_LO_PIN", "{}", "{}")'.format(name, pads.rwds_i_l.name, block_type))
cmd.append('design.set_property("{}", "RWDS_OE_PIN", "{}", "{}")'.format(name, pads.rwds_oe.name, block_type)) cmd.append('design.set_property("{}", "RWDS_OE_PIN", "{}", "{}")'.format(name, pads.rwds_oe.name, block_type))
cmd.append('design.set_property("{}", "RWDS_OUT_HI_PIN", "{}", "{}")'.format(name, pads.rwds_o_h.name, block_type)) cmd.append('design.set_property("{}", "RWDS_OUT_HI_PIN", "{}", "{}")'.format(name, pads.rwds_o_h.name, block_type))
cmd.append('design.set_property("{}", "RWDS_OUT_LO_PIN", "{}", "{}")'.format(name, pads.rwds_o_l.name, block_type)) cmd.append('design.set_property("{}", "RWDS_OUT_LO_PIN", "{}", "{}")'.format(name, pads.rwds_o_l.name, block_type))
@ -548,27 +548,27 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
cmd = [] cmd = []
cmd.append('design.create_block("{}", "SPI_FLASH")'.format(name)) cmd.append('design.create_block("{}", "SPI_FLASH")'.format(name))
cmd.append('design.set_property("{}", "MULT_CTRL_EN","0","SPI_FLASH")'.format(name)) cmd.append('design.set_property("{}", "MULT_CTRL_EN", "0", "SPI_FLASH")'.format(name))
cmd.append('design.set_property("{}", "REG_EN","0","SPI_FLASH")'.format(name)) cmd.append('design.set_property("{}", "REG_EN", "0", "SPI_FLASH")'.format(name))
cmd.append('design.set_property("{}", "CLK_PIN","","SPI_FLASH")'.format(name)) # only required when REG_EN==1 cmd.append('design.set_property("{}", "CLK_PIN", "", "SPI_FLASH")'.format(name)) # only required when REG_EN==1
cmd.append('design.set_property("{}", "RW_WIDTH","{}","SPI_FLASH")'.format(name, mode)) cmd.append('design.set_property("{}", "RW_WIDTH", "{}", "SPI_FLASH")'.format(name, mode))
cmd.append('design.set_property("{}", "CS_N_OUT_PIN","{}","SPI_FLASH")'.format(name, pads.cs_n.name)) cmd.append('design.set_property("{}", "CS_N_OUT_PIN", "{}", "SPI_FLASH")'.format(name, pads.cs_n.name))
cmd.append('design.set_property("{}", "SCLK_OUT_PIN","{}","SPI_FLASH")'.format(name, pads.clk.name)) cmd.append('design.set_property("{}", "SCLK_OUT_PIN", "{}", "SPI_FLASH")'.format(name, pads.clk.name))
cmd.append('design.set_property("{}", "MOSI_OUT_PIN","{}","SPI_FLASH")'.format(name, dq0)) cmd.append('design.set_property("{}", "MOSI_OUT_PIN", "{}", "SPI_FLASH")'.format(name, dq0))
cmd.append('design.set_property("{}", "MISO_IN_PIN","{}","SPI_FLASH")'.format(name, dq1)) cmd.append('design.set_property("{}", "MISO_IN_PIN", "{}", "SPI_FLASH")'.format(name, dq1))
cmd.append('design.set_property("{}", "WP_N_OUT_PIN","{}","SPI_FLASH")'.format(name, dq2)) cmd.append('design.set_property("{}", "WP_N_OUT_PIN", "{}", "SPI_FLASH")'.format(name, dq2))
cmd.append('design.set_property("{}", "HOLD_N_OUT_PIN","{}","SPI_FLASH")'.format(name, dq3)) cmd.append('design.set_property("{}", "HOLD_N_OUT_PIN", "{}", "SPI_FLASH")'.format(name, dq3))
if mode == "x4": if mode == "x4":
cmd.append('design.set_property("{}", "HOLD_N_IN_PIN","{}","SPI_FLASH")'.format(name, dq3_i)) cmd.append('design.set_property("{}", "HOLD_N_IN_PIN", "{}", "SPI_FLASH")'.format(name, dq3_i))
cmd.append('design.set_property("{}", "HOLD_N_OE_PIN","{}","SPI_FLASH")'.format(name, dq3_oe)) cmd.append('design.set_property("{}", "HOLD_N_OE_PIN", "{}", "SPI_FLASH")'.format(name, dq3_oe))
cmd.append('design.set_property("{}", "MISO_OUT_PIN","{}","SPI_FLASH")'.format(name, dq1_o)) cmd.append('design.set_property("{}", "MISO_OUT_PIN", "{}", "SPI_FLASH")'.format(name, dq1_o))
cmd.append('design.set_property("{}", "MISO_OE_PIN","{}","SPI_FLASH")'.format(name, dq1_oe)) cmd.append('design.set_property("{}", "MISO_OE_PIN", "{}", "SPI_FLASH")'.format(name, dq1_oe))
cmd.append('design.set_property("{}", "MOSI_IN_PIN","{}","SPI_FLASH")'.format(name, dq0_i)) cmd.append('design.set_property("{}", "MOSI_IN_PIN", "{}", "SPI_FLASH")'.format(name, dq0_i))
cmd.append('design.set_property("{}", "MOSI_OE_PIN","{}","SPI_FLASH")'.format(name, dq0_oe)) cmd.append('design.set_property("{}", "MOSI_OE_PIN", "{}", "SPI_FLASH")'.format(name, dq0_oe))
cmd.append('design.set_property("{}", "WP_N_IN_PIN","{}","SPI_FLASH")'.format(name, dq2_i)) cmd.append('design.set_property("{}", "WP_N_IN_PIN", "{}", "SPI_FLASH")'.format(name, dq2_i))
cmd.append('design.set_property("{}", "WP_N_OE_PIN","{}","SPI_FLASH")'.format(name, dq2_oe)) cmd.append('design.set_property("{}", "WP_N_OE_PIN", "{}", "SPI_FLASH")'.format(name, dq2_oe))
# mult ctrl en only # mult ctrl en only
#cmd.append('design.set_property("{}", "CS_N_OE_PIN","{}","SPI_FLASH")'.format(name, cs_n_oe)) #cmd.append('design.set_property("{}", "CS_N_OE_PIN","{}","SPI_FLASH")'.format(name, cs_n_oe))