soc/cores/cpu: Implement add_jtag method
Implement add_jtag method for naxriscv, vexiiriscv and vexriscv_smp, which is the de facto way to add JTAG ports to pads on other CPUs. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
This commit is contained in:
parent
63d72a87e6
commit
a8b3f36592
|
@ -462,6 +462,14 @@ class NaxRiscv(CPU):
|
|||
|
||||
self.soc_bus = soc.bus # FIXME: Save SoC Bus instance to retrieve the final mem layout on finalization.
|
||||
|
||||
def add_jtag(self, pads):
|
||||
self.comb += [
|
||||
self.jtag_tms.eq(pads.tms),
|
||||
self.jtag_clk.eq(pads.tck),
|
||||
self.jtag_tdi.eq(pads.tdi),
|
||||
pads.tdo.eq(self.jtag_tdo),
|
||||
]
|
||||
|
||||
def add_memory_buses(self, address_width, data_width):
|
||||
NaxRiscv.litedram_width = data_width
|
||||
nax_data_width = 64
|
||||
|
|
|
@ -527,6 +527,14 @@ class VexiiRiscv(CPU):
|
|||
i_mBus_rlast = mbus.r.last,
|
||||
)
|
||||
|
||||
def add_jtag(self, pads):
|
||||
self.comb += [
|
||||
self.jtag_tms.eq(pads.tms),
|
||||
self.jtag_clk.eq(pads.tck),
|
||||
self.jtag_tdi.eq(pads.tdi),
|
||||
pads.tdo.eq(self.jtag_tdo),
|
||||
]
|
||||
|
||||
def do_finalize(self):
|
||||
assert hasattr(self, "reset_address")
|
||||
|
||||
|
|
|
@ -463,6 +463,14 @@ class VexRiscvSMP(CPU):
|
|||
add_synthesis_define(cluster_filename)
|
||||
platform.add_source(cluster_filename, "verilog")
|
||||
|
||||
def add_jtag(self, pads):
|
||||
self.comb += [
|
||||
self.jtag_tms.eq(pads.tms),
|
||||
self.jtag_clk.eq(pads.tck),
|
||||
self.jtag_tdi.eq(pads.tdi),
|
||||
pads.tdo.eq(self.jtag_tdo),
|
||||
]
|
||||
|
||||
def add_soc_components(self, soc):
|
||||
if self.variant == "linux":
|
||||
# Set UART/Timer0 CSRs to the ones used by OpenSBI.
|
||||
|
|
Loading…
Reference in New Issue