Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface BSCAN2 with VexRiscv's JTAG #370

Closed
ztachip opened this issue Oct 9, 2023 · 3 comments
Closed

Interface BSCAN2 with VexRiscv's JTAG #370

ztachip opened this issue Oct 9, 2023 · 3 comments

Comments

@ztachip
Copy link

ztachip commented Oct 9, 2023

Hi
I am trying to use Xilinx BSCAN2 for JTAG debugging but I try to instantiate BSCAN2 outside of VexRiscv and just route the JTAG signals to VexRiscv (based on Briey.scala design with JTAG).
The reason is that I try to keep my project easy to port between different FPGA by isolating the portable HDL codes from the components that are specific to FPGA silicon. That's why I look for way to do JTAG over BSAN2 but without referencing VexRiscv's jtagCtrl.fromXilinxBscane2 function since I would like to keep the soft-CPU to be the portable component.
But so far openocd fails to communicate with VexRiscv this way.
Should this work or there are some logic to apply to BSAN2's signals before they can be routed to VexRiscv.
Thanks

@Dolu1990
Copy link
Member

Hi

Have you seen this doc ? :
https://github.com/SpinalHDL/VexRiscv/tree/master/doc/nativeJtag
Which bscane2 id did you used ?

@ztachip
Copy link
Author

ztachip commented Oct 11, 2023 via email

@Dolu1990
Copy link
Member

Dolu1990 commented Oct 13, 2023

Ahh i would say you would have two ways,
Either you expose the jtag instruction interface (bscane like) which can be then bridged to something else. And in the case you want to bridge it from a true 4 pins jtag, you just need to create a little jtag tap which "behave like the bscane2"

Something like :

       val jtag = slave(new Jtag())
        val jtagClockDomain = ClockDomain(jtag.tck) on new Area
          val tap = new JtagTap(jtag, 6)
          val idcodeArea = tap.idcode(B(p.tapId, 32 bits))(5)
          val wrapper = tap.map(debug.jtagInstruction, instructionId = 8)
        }
        

Either you expose the native vex debug interface, which is a small memory bus, and then you provide the bridge from what ever -> to it.

@ztachip ztachip closed this as completed Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants