> Antonio: What about the code for Sifive BSCAN tunnel JTAG access? Should it > be moved in a separate file or at least better confined / separated / > modularized?
Hello Antonio, In my opinion, the Si-Five BSCAN code clearly belongs to the transport-specific layers. I do not yet have a clear opinion whether it would be to make it a separate transport or share it with the standard JTAG DTM to a certain degree. More than the structure of the code, I am concerned about testing of this BSCAN logic. Since this is a proprietary mechanism, I am not sure if FPGA bitstreams with this feature are available. If anyone reading this knows or has some suggestions how to test it, please let us know. (On the other hand, testing of the standard JTAG DTM is easy - any compliant hardware can be used, or even the Spike RISC-V ISA simulator.) Regards, Jan ________________________________ From: Antonio Borneo <[email protected]> Sent: Friday, July 17, 2026 9:54 AM To: Jan Matyáš <[email protected]> Cc: Improper CatGirl <[email protected]>; [email protected] <[email protected]> Subject: Re: [RFC] riscv: decouple Debug Module logic from the JTAG DMI transport On Fri, Jul 17, 2026 at 8:04 AM Jan Matyáš <[email protected]> wrote: > > (Addition to what I posted, to avoid unclarity) > > Jan: (...) All other processing should go to the underlying > transport-specific layers. > > > In other words, I meant that the RISC-V code should be clearly separated into: > > A generic, transport-independent part. > Transport-specific parts (JTAG DTM, ARM ADI, ...). > > The API between those two should be DMI reads & writes (including the > possibility to create batches), as ImproperCatGirl suggests. What about the code for Sifive BSCAN tunnel JTAG access? Should it be moved in a separate file or at least better confined / separated / modularized? From what I understand BSCAN tunnel is a virtual JTAG behind the real JTAG port of the FPGA. In such a case it looks like the ARM "JTAG Access Port" that can be placed after the DAP (either JTAG or SWD DAP). My idea is that we should first extend OpenOCD to handle multiple adapters simultaneously, then the "virtual" JTAGs like ARM JTAG-AP and Sifive BSCAN would get a clean implementation as additional adapters that are accessed through the main adapter. Today the code for BSCAN tunnel is mixed with the code of DTM and core. If possible, I would like to have both DTM and BSCAN become independent code. Antonio
