soc/cores/jtag: Add p_INIT/p_init workaround on ECP5JTAG to support Diamond and Trellis toolchains without manual changes.
This commit is contained in:
parent
4368d5a9ed
commit
175e63ac4c
|
@ -373,13 +373,17 @@ class ECP5JTAG(LiteXModule):
|
||||||
i_JTDO1 = self.tdo, # FF(negedge TCK, JTDO1) if (IR==0x32 && FSM==Shift-DR)
|
i_JTDO1 = self.tdo, # FF(negedge TCK, JTDO1) if (IR==0x32 && FSM==Shift-DR)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# NextPnr/Diamond LUT4 p_INIT/p_init workaround.
|
||||||
|
from litex.build.lattice.diamond import LatticeDiamondToolchain
|
||||||
|
p_init_name = {False: "p_INIT", True: "p_init"}[isinstance(LiteXContext.toolchain, LatticeDiamondToolchain)]
|
||||||
|
|
||||||
# TDI/TCK are synchronous on JTAGG output (TDI being registered with TCK). Introduce a delay
|
# TDI/TCK are synchronous on JTAGG output (TDI being registered with TCK). Introduce a delay
|
||||||
# on TCK with multiple LUT4s to allow its use as the JTAG Clk.
|
# on TCK with multiple LUT4s to allow its use as the JTAG Clk.
|
||||||
for i in range(tck_delay_luts):
|
for i in range(tck_delay_luts):
|
||||||
new_tck = Signal()
|
new_tck = Signal()
|
||||||
self.specials += Instance("LUT4",
|
self.specials += Instance("LUT4",
|
||||||
attr = {"keep"},
|
attr = {"keep"},
|
||||||
p_INIT = 2,
|
**{f"p_{p_init_name}": 2}, # Use toolchain-specific INIT parameter name.
|
||||||
i_A = tck,
|
i_A = tck,
|
||||||
i_B = 0,
|
i_B = 0,
|
||||||
i_C = 0,
|
i_C = 0,
|
||||||
|
|
Loading…
Reference in New Issue