From 23ec53545b0730d0b0dfe2b9bace89fb2e89c341 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 6 Oct 2023 14:05:56 +0200 Subject: [PATCH] Enable EFB and EFBB cells --- techlibs/lattice/cells_bb_xo2.v | 163 ++++++++++++++++++++++++ techlibs/lattice/cells_bb_xo3.v | 163 ++++++++++++++++++++++++ techlibs/lattice/cells_bb_xo3d.v | 212 +++++++++++++++++++++++++++++++ techlibs/lattice/cells_xtra.py | 6 +- 4 files changed, 541 insertions(+), 3 deletions(-) diff --git a/techlibs/lattice/cells_bb_xo2.v b/techlibs/lattice/cells_bb_xo2.v index fdf8331b731..f7122fe3cfc 100644 --- a/techlibs/lattice/cells_bb_xo2.v +++ b/techlibs/lattice/cells_bb_xo2.v @@ -564,6 +564,169 @@ module OSCH (...); output SEDSTDBY; endmodule +(* blackbox *) +module EFB (...); + parameter EFB_I2C1= "DISABLED"; + parameter EFB_I2C2= "DISABLED"; + parameter EFB_SPI = "DISABLED"; + parameter EFB_TC = "DISABLED"; + parameter EFB_TC_PORTMODE = "NO_WB"; + parameter EFB_UFM = "DISABLED"; + parameter EFB_WB_CLK_FREQ = "50.0"; + parameter DEV_DENSITY = "1200L"; + parameter UFM_INIT_PAGES = 0; + parameter UFM_INIT_START_PAGE = 0; + parameter UFM_INIT_ALL_ZEROS = "ENABLED"; + parameter UFM_INIT_FILE_NAME = "NONE"; + parameter UFM_INIT_FILE_FORMAT = "HEX"; + parameter I2C1_ADDRESSING = "7BIT"; + parameter I2C2_ADDRESSING = "7BIT"; + parameter I2C1_SLAVE_ADDR = "0b1000001"; + parameter I2C2_SLAVE_ADDR = "0b1000010"; + parameter I2C1_BUS_PERF = "100kHz"; + parameter I2C2_BUS_PERF = "100kHz"; + parameter I2C1_CLK_DIVIDER = 1; + parameter I2C2_CLK_DIVIDER = 1; + parameter I2C1_GEN_CALL = "DISABLED"; + parameter I2C2_GEN_CALL = "DISABLED"; + parameter I2C1_WAKEUP = "DISABLED"; + parameter I2C2_WAKEUP = "DISABLED"; + parameter SPI_MODE = "SLAVE"; + parameter SPI_CLK_DIVIDER = 1; + parameter SPI_LSB_FIRST = "DISABLED"; + parameter SPI_CLK_INV = "DISABLED"; + parameter SPI_PHASE_ADJ = "DISABLED"; + parameter SPI_SLAVE_HANDSHAKE = "DISABLED"; + parameter SPI_INTR_TXRDY = "DISABLED"; + parameter SPI_INTR_RXRDY = "DISABLED"; + parameter SPI_INTR_TXOVR = "DISABLED"; + parameter SPI_INTR_RXOVR = "DISABLED"; + parameter SPI_WAKEUP = "DISABLED"; + parameter TC_MODE = "CTCM"; + parameter TC_SCLK_SEL = "PCLOCK"; + parameter TC_CCLK_SEL = 1; + parameter GSR = "ENABLED"; + parameter TC_TOP_SET = 65535; + parameter TC_OCR_SET = 32767; + parameter TC_OC_MODE = "TOGGLE"; + parameter TC_RESETN = "ENABLED"; + parameter TC_TOP_SEL = "ON"; + parameter TC_OV_INT = "OFF"; + parameter TC_OCR_INT = "OFF"; + parameter TC_ICR_INT = "OFF"; + parameter TC_OVERFLOW = "ENABLED"; + parameter TC_ICAPTURE = "DISABLED"; + input WBCLKI; + input WBRSTI; + input WBCYCI; + input WBSTBI; + input WBWEI; + input WBADRI7; + input WBADRI6; + input WBADRI5; + input WBADRI4; + input WBADRI3; + input WBADRI2; + input WBADRI1; + input WBADRI0; + input WBDATI7; + input WBDATI6; + input WBDATI5; + input WBDATI4; + input WBDATI3; + input WBDATI2; + input WBDATI1; + input WBDATI0; + input PLL0DATI7; + input PLL0DATI6; + input PLL0DATI5; + input PLL0DATI4; + input PLL0DATI3; + input PLL0DATI2; + input PLL0DATI1; + input PLL0DATI0; + input PLL0ACKI; + input PLL1DATI7; + input PLL1DATI6; + input PLL1DATI5; + input PLL1DATI4; + input PLL1DATI3; + input PLL1DATI2; + input PLL1DATI1; + input PLL1DATI0; + input PLL1ACKI; + input I2C1SCLI; + input I2C1SDAI; + input I2C2SCLI; + input I2C2SDAI; + input SPISCKI; + input SPIMISOI; + input SPIMOSII; + input SPISCSN; + input TCCLKI; + input TCRSTN; + input TCIC; + input UFMSN; + output WBDATO7; + output WBDATO6; + output WBDATO5; + output WBDATO4; + output WBDATO3; + output WBDATO2; + output WBDATO1; + output WBDATO0; + output WBACKO; + output PLLCLKO; + output PLLRSTO; + output PLL0STBO; + output PLL1STBO; + output PLLWEO; + output PLLADRO4; + output PLLADRO3; + output PLLADRO2; + output PLLADRO1; + output PLLADRO0; + output PLLDATO7; + output PLLDATO6; + output PLLDATO5; + output PLLDATO4; + output PLLDATO3; + output PLLDATO2; + output PLLDATO1; + output PLLDATO0; + output I2C1SCLO; + output I2C1SCLOEN; + output I2C1SDAO; + output I2C1SDAOEN; + output I2C2SCLO; + output I2C2SCLOEN; + output I2C2SDAO; + output I2C2SDAOEN; + output I2C1IRQO; + output I2C2IRQO; + output SPISCKO; + output SPISCKEN; + output SPIMISOO; + output SPIMISOEN; + output SPIMOSIO; + output SPIMOSIEN; + output SPIMCSN0; + output SPIMCSN1; + output SPIMCSN2; + output SPIMCSN3; + output SPIMCSN4; + output SPIMCSN5; + output SPIMCSN6; + output SPIMCSN7; + output SPICSNEN; + output SPIIRQO; + output TCINT; + output TCOC; + output WBCUFMIRQ; + output CFGWAKE; + output CFGSTDBY; +endmodule + (* blackbox *) (* keep *) module TSALL (...); input TSALL; diff --git a/techlibs/lattice/cells_bb_xo3.v b/techlibs/lattice/cells_bb_xo3.v index fdf8331b731..f7122fe3cfc 100644 --- a/techlibs/lattice/cells_bb_xo3.v +++ b/techlibs/lattice/cells_bb_xo3.v @@ -564,6 +564,169 @@ module OSCH (...); output SEDSTDBY; endmodule +(* blackbox *) +module EFB (...); + parameter EFB_I2C1= "DISABLED"; + parameter EFB_I2C2= "DISABLED"; + parameter EFB_SPI = "DISABLED"; + parameter EFB_TC = "DISABLED"; + parameter EFB_TC_PORTMODE = "NO_WB"; + parameter EFB_UFM = "DISABLED"; + parameter EFB_WB_CLK_FREQ = "50.0"; + parameter DEV_DENSITY = "1200L"; + parameter UFM_INIT_PAGES = 0; + parameter UFM_INIT_START_PAGE = 0; + parameter UFM_INIT_ALL_ZEROS = "ENABLED"; + parameter UFM_INIT_FILE_NAME = "NONE"; + parameter UFM_INIT_FILE_FORMAT = "HEX"; + parameter I2C1_ADDRESSING = "7BIT"; + parameter I2C2_ADDRESSING = "7BIT"; + parameter I2C1_SLAVE_ADDR = "0b1000001"; + parameter I2C2_SLAVE_ADDR = "0b1000010"; + parameter I2C1_BUS_PERF = "100kHz"; + parameter I2C2_BUS_PERF = "100kHz"; + parameter I2C1_CLK_DIVIDER = 1; + parameter I2C2_CLK_DIVIDER = 1; + parameter I2C1_GEN_CALL = "DISABLED"; + parameter I2C2_GEN_CALL = "DISABLED"; + parameter I2C1_WAKEUP = "DISABLED"; + parameter I2C2_WAKEUP = "DISABLED"; + parameter SPI_MODE = "SLAVE"; + parameter SPI_CLK_DIVIDER = 1; + parameter SPI_LSB_FIRST = "DISABLED"; + parameter SPI_CLK_INV = "DISABLED"; + parameter SPI_PHASE_ADJ = "DISABLED"; + parameter SPI_SLAVE_HANDSHAKE = "DISABLED"; + parameter SPI_INTR_TXRDY = "DISABLED"; + parameter SPI_INTR_RXRDY = "DISABLED"; + parameter SPI_INTR_TXOVR = "DISABLED"; + parameter SPI_INTR_RXOVR = "DISABLED"; + parameter SPI_WAKEUP = "DISABLED"; + parameter TC_MODE = "CTCM"; + parameter TC_SCLK_SEL = "PCLOCK"; + parameter TC_CCLK_SEL = 1; + parameter GSR = "ENABLED"; + parameter TC_TOP_SET = 65535; + parameter TC_OCR_SET = 32767; + parameter TC_OC_MODE = "TOGGLE"; + parameter TC_RESETN = "ENABLED"; + parameter TC_TOP_SEL = "ON"; + parameter TC_OV_INT = "OFF"; + parameter TC_OCR_INT = "OFF"; + parameter TC_ICR_INT = "OFF"; + parameter TC_OVERFLOW = "ENABLED"; + parameter TC_ICAPTURE = "DISABLED"; + input WBCLKI; + input WBRSTI; + input WBCYCI; + input WBSTBI; + input WBWEI; + input WBADRI7; + input WBADRI6; + input WBADRI5; + input WBADRI4; + input WBADRI3; + input WBADRI2; + input WBADRI1; + input WBADRI0; + input WBDATI7; + input WBDATI6; + input WBDATI5; + input WBDATI4; + input WBDATI3; + input WBDATI2; + input WBDATI1; + input WBDATI0; + input PLL0DATI7; + input PLL0DATI6; + input PLL0DATI5; + input PLL0DATI4; + input PLL0DATI3; + input PLL0DATI2; + input PLL0DATI1; + input PLL0DATI0; + input PLL0ACKI; + input PLL1DATI7; + input PLL1DATI6; + input PLL1DATI5; + input PLL1DATI4; + input PLL1DATI3; + input PLL1DATI2; + input PLL1DATI1; + input PLL1DATI0; + input PLL1ACKI; + input I2C1SCLI; + input I2C1SDAI; + input I2C2SCLI; + input I2C2SDAI; + input SPISCKI; + input SPIMISOI; + input SPIMOSII; + input SPISCSN; + input TCCLKI; + input TCRSTN; + input TCIC; + input UFMSN; + output WBDATO7; + output WBDATO6; + output WBDATO5; + output WBDATO4; + output WBDATO3; + output WBDATO2; + output WBDATO1; + output WBDATO0; + output WBACKO; + output PLLCLKO; + output PLLRSTO; + output PLL0STBO; + output PLL1STBO; + output PLLWEO; + output PLLADRO4; + output PLLADRO3; + output PLLADRO2; + output PLLADRO1; + output PLLADRO0; + output PLLDATO7; + output PLLDATO6; + output PLLDATO5; + output PLLDATO4; + output PLLDATO3; + output PLLDATO2; + output PLLDATO1; + output PLLDATO0; + output I2C1SCLO; + output I2C1SCLOEN; + output I2C1SDAO; + output I2C1SDAOEN; + output I2C2SCLO; + output I2C2SCLOEN; + output I2C2SDAO; + output I2C2SDAOEN; + output I2C1IRQO; + output I2C2IRQO; + output SPISCKO; + output SPISCKEN; + output SPIMISOO; + output SPIMISOEN; + output SPIMOSIO; + output SPIMOSIEN; + output SPIMCSN0; + output SPIMCSN1; + output SPIMCSN2; + output SPIMCSN3; + output SPIMCSN4; + output SPIMCSN5; + output SPIMCSN6; + output SPIMCSN7; + output SPICSNEN; + output SPIIRQO; + output TCINT; + output TCOC; + output WBCUFMIRQ; + output CFGWAKE; + output CFGSTDBY; +endmodule + (* blackbox *) (* keep *) module TSALL (...); input TSALL; diff --git a/techlibs/lattice/cells_bb_xo3d.v b/techlibs/lattice/cells_bb_xo3d.v index 84d7d960198..626473f79bb 100644 --- a/techlibs/lattice/cells_bb_xo3d.v +++ b/techlibs/lattice/cells_bb_xo3d.v @@ -565,6 +565,218 @@ module OSCJ (...); output OSCESB; endmodule +(* blackbox *) +module EFBB (...); + parameter EFB_I2C1= "DISABLED"; + parameter EFB_I2C2= "DISABLED"; + parameter EFB_SPI = "DISABLED"; + parameter EFB_TC = "DISABLED"; + parameter EFB_TC_PORTMODE = "NO_WB"; + parameter EFB_UFM_BOOT = "INT_SINGLE_BOOT_CFG0"; + parameter EFB_UFM = "DISABLED"; + parameter EFB_UFM0 = "DISABLED"; + parameter EFB_UFM1 = "DISABLED"; + parameter EFB_UFM2 = "DISABLED"; + parameter EFB_UFM3 = "DISABLED"; + parameter EFB_CFG0 = "DISABLED"; + parameter EFB_CFG1 = "DISABLED"; + parameter EFB_WB_CLK_FREQ = "50.0"; + parameter DEV_DENSITY = "9400L"; + parameter UFM0_INIT_PAGES = 0; + parameter UFM0_INIT_START_PAGE = 0; + parameter UFM0_INIT_ALL_ZEROS = "ENABLED"; + parameter UFM0_INIT_FILE_NAME = "NONE"; + parameter UFM0_INIT_FILE_FORMAT = "HEX"; + parameter UFM1_INIT_PAGES = 0; + parameter UFM1_INIT_START_PAGE = 0; + parameter UFM1_INIT_ALL_ZEROS = "ENABLED"; + parameter UFM1_INIT_FILE_NAME = "NONE"; + parameter UFM1_INIT_FILE_FORMAT = "HEX"; + parameter UFM2_INIT_PAGES = 0; + parameter UFM2_INIT_START_PAGE = 0; + parameter UFM2_INIT_ALL_ZEROS = "ENABLED"; + parameter UFM2_INIT_FILE_NAME = "NONE"; + parameter UFM2_INIT_FILE_FORMAT = "HEX"; + parameter UFM3_INIT_PAGES = 0; + parameter UFM3_INIT_START_PAGE = 0; + parameter UFM3_INIT_ALL_ZEROS = "ENABLED"; + parameter UFM3_INIT_FILE_NAME = "NONE"; + parameter UFM3_INIT_FILE_FORMAT = "HEX"; + parameter CFG0_INIT_PAGES = 0; + parameter CFG0_INIT_START_PAGE = 0; + parameter CFG0_INIT_ALL_ZEROS = "ENABLED"; + parameter CFG0_INIT_FILE_NAME = "NONE"; + parameter CFG0_INIT_FILE_FORMAT = "HEX"; + parameter CFG1_INIT_PAGES = 0; + parameter CFG1_INIT_START_PAGE = 0; + parameter CFG1_INIT_ALL_ZEROS = "ENABLED"; + parameter CFG1_INIT_FILE_NAME = "NONE"; + parameter CFG1_INIT_FILE_FORMAT = "HEX"; + parameter I2C1_ADDRESSING = "7BIT"; + parameter I2C2_ADDRESSING = "7BIT"; + parameter I2C1_SLAVE_ADDR = "0b1000001"; + parameter I2C2_SLAVE_ADDR = "0b1000010"; + parameter I2C1_BUS_PERF = "100kHz"; + parameter I2C2_BUS_PERF = "100kHz"; + parameter I2C1_CLK_DIVIDER = 1; + parameter I2C2_CLK_DIVIDER = 1; + parameter I2C1_GEN_CALL = "DISABLED"; + parameter I2C2_GEN_CALL = "DISABLED"; + parameter I2C1_WAKEUP = "DISABLED"; + parameter I2C2_WAKEUP = "DISABLED"; + parameter SPI_MODE = "SLAVE"; + parameter SPI_CLK_DIVIDER = 1; + parameter SPI_LSB_FIRST = "DISABLED"; + parameter SPI_CLK_INV = "DISABLED"; + parameter SPI_PHASE_ADJ = "DISABLED"; + parameter SPI_SLAVE_HANDSHAKE = "DISABLED"; + parameter SPI_INTR_TXRDY = "DISABLED"; + parameter SPI_INTR_RXRDY = "DISABLED"; + parameter SPI_INTR_TXOVR = "DISABLED"; + parameter SPI_INTR_RXOVR = "DISABLED"; + parameter SPI_WAKEUP = "DISABLED"; + parameter TC_MODE = "CTCM"; + parameter TC_SCLK_SEL = "PCLOCK"; + parameter TC_CCLK_SEL = 1; + parameter GSR = "ENABLED"; + parameter TC_TOP_SET = 65535; + parameter TC_OCR_SET = 32767; + parameter TC_OC_MODE = "TOGGLE"; + parameter TC_RESETN = "ENABLED"; + parameter TC_TOP_SEL = "ON"; + parameter TC_OV_INT = "OFF"; + parameter TC_OCR_INT = "OFF"; + parameter TC_ICR_INT = "OFF"; + parameter TC_OVERFLOW = "ENABLED"; + parameter TC_ICAPTURE = "DISABLED"; + parameter EFB_TAMPER_TYPE_PASSWORD = "DISABLED"; + parameter EFB_TAMPER_TYPE_LOCKED_FLASH_SRAM = "DISABLED"; + parameter EFB_TAMPER_TYPE_MANUFACTURE_MODE = "DISABLED"; + parameter EFB_TAMPER_SRC_JTAG= "DISABLED"; + parameter EFB_TAMPER_SRC_SSPI = "DISABLED"; + parameter EFB_TAMPER_SRC_SI2C = "DISABLED"; + parameter EFB_TAMPER_SRC_WB = "DISABLED"; + parameter EFB_TAMPER_PORT_LOCK = "DISABLED"; + parameter EFB_TAMPER_DETECTION_RESPONSE = "DISABLED"; + input WBCLKI; + input WBRSTI; + input WBCYCI; + input WBSTBI; + input WBWEI; + input WBADRI7; + input WBADRI6; + input WBADRI5; + input WBADRI4; + input WBADRI3; + input WBADRI2; + input WBADRI1; + input WBADRI0; + input WBDATI7; + input WBDATI6; + input WBDATI5; + input WBDATI4; + input WBDATI3; + input WBDATI2; + input WBDATI1; + input WBDATI0; + input PLL0DATI7; + input PLL0DATI6; + input PLL0DATI5; + input PLL0DATI4; + input PLL0DATI3; + input PLL0DATI2; + input PLL0DATI1; + input PLL0DATI0; + input PLL0ACKI; + input PLL1DATI7; + input PLL1DATI6; + input PLL1DATI5; + input PLL1DATI4; + input PLL1DATI3; + input PLL1DATI2; + input PLL1DATI1; + input PLL1DATI0; + input PLL1ACKI; + input I2C1SCLI; + input I2C1SDAI; + input I2C2SCLI; + input I2C2SDAI; + input SPISCKI; + input SPIMISOI; + input SPIMOSII; + input SPISCSN; + input TCCLKI; + input TCRSTN; + input TCIC; + input UFMSN; + input TAMPERDETEN; + input TAMPERLOCKSRC; + input TAMPERDETCLK; + output WBDATO7; + output WBDATO6; + output WBDATO5; + output WBDATO4; + output WBDATO3; + output WBDATO2; + output WBDATO1; + output WBDATO0; + output WBACKO; + output PLLCLKO; + output PLLRSTO; + output PLL0STBO; + output PLL1STBO; + output PLLWEO; + output PLLADRO4; + output PLLADRO3; + output PLLADRO2; + output PLLADRO1; + output PLLADRO0; + output PLLDATO7; + output PLLDATO6; + output PLLDATO5; + output PLLDATO4; + output PLLDATO3; + output PLLDATO2; + output PLLDATO1; + output PLLDATO0; + output I2C1SCLO; + output I2C1SCLOEN; + output I2C1SDAO; + output I2C1SDAOEN; + output I2C2SCLO; + output I2C2SCLOEN; + output I2C2SDAO; + output I2C2SDAOEN; + output I2C1IRQO; + output I2C2IRQO; + output SPISCKO; + output SPISCKEN; + output SPIMISOO; + output SPIMISOEN; + output SPIMOSIO; + output SPIMOSIEN; + output SPIMCSN0; + output SPIMCSN1; + output SPIMCSN2; + output SPIMCSN3; + output SPIMCSN4; + output SPIMCSN5; + output SPIMCSN6; + output SPIMCSN7; + output SPICSNEN; + output SPIIRQO; + output TCINT; + output TCOC; + output WBCUFMIRQ; + output CFGWAKE; + output CFGSTDBY; + output TAMPERDET; + output TAMPERTYPE0; + output TAMPERTYPE1; + output TAMPERSRC0; + output TAMPERSRC1; +endmodule + (* blackbox *) (* keep *) module TSALL (...); input TSALL; diff --git a/techlibs/lattice/cells_xtra.py b/techlibs/lattice/cells_xtra.py index c17281cc753..6157f64ed1d 100644 --- a/techlibs/lattice/cells_xtra.py +++ b/techlibs/lattice/cells_xtra.py @@ -350,7 +350,7 @@ class State(Enum): Cell("EHXPLLJ"), #Cell("PLLREFCS"), Cell("OSCH"), - #Cell("EFB"), + Cell("EFB"), Cell("TSALL", True), ]), ("cells_bb_xo3.v", "machxo3lf", [ @@ -526,7 +526,7 @@ class State(Enum): Cell("EHXPLLJ"), #Cell("PLLREFCS"), Cell("OSCH"), - #Cell("EFB"), + Cell("EFB"), Cell("TSALL", True), ]), ("cells_bb_xo3d.v", "machxo3d", [ @@ -703,7 +703,7 @@ class State(Enum): Cell("EHXPLLJ"), #Cell("PLLREFCS"), Cell("OSCJ"), - #Cell("EFBB"), + Cell("EFBB"), Cell("TSALL", True), #Cell("ESBA"), #Cell("BCSLEWRATEA"),