soc/cores/jtag: Switch to stream.ClockDomainCrossing and use common_rst.

This commit is contained in:
Florent Kermarrec 2023-12-13 09:16:55 +01:00
parent 94eca8628c
commit f2c5ff376c
1 changed files with 10 additions and 6 deletions

View File

@ -448,12 +448,16 @@ class JTAGPHY(LiteXModule):
# JTAG clock domain crossing ---------------------------------------------------------------
if clock_domain != "jtag":
tx_cdc = stream.AsyncFIFO([("data", data_width)], 4)
tx_cdc = ClockDomainsRenamer({"write": clock_domain, "read": "jtag"})(tx_cdc)
rx_cdc = stream.AsyncFIFO([("data", data_width)], 4)
rx_cdc = ClockDomainsRenamer({"write": "jtag", "read": clock_domain})(rx_cdc)
self.tx_cdc = tx_cdc
self.rx_cdc = rx_cdc
self.tx_cdc = tx_cdc = stream.ClockDomainCrossing([("data", data_width)],
cd_from = clock_domain,
cd_to = "jtag",
with_common_rst = True
)
self.rx_cdc = rx_cdc = stream.ClockDomainCrossing([("data", data_width)],
cd_from = "jtag",
cd_to = clock_domain,
with_common_rst = True
)
self.comb += [
sink.connect(tx_cdc.sink),
rx_cdc.source.connect(source)