[Libre-soc-dev] [Libre-soc-bugs] [Bug 503] New: Create new repo for gdb-adaptor program

Luke Kenneth Casson Leighton lkcl at lkcl.net
Sat Sep 26 11:43:49 BST 2020


On Sat, Sep 26, 2020 at 12:58 AM Staf Verhaegen <staf at fibraservi.eu> wrote:

> Why not use the openocd svf command to play a svf file ?
> That's how I test svf files on a FPGA implementation of my retro-uc.
> See attached script as example.

ah - it might have been stripped by the mailing list (not approved
file extension type).  is there another location online or can you
cut/paste the contents here?

i found an example online, and adapted it:

STATE RESET IDLE;
TIR 0 ;
HIR 5 TDI (1f) SMASK (1f) ;
HDR 1 TDI (00) SMASK (01) ;
TDR 0 ;
//Loading device with 'idcode' instruction.
SIR 4 TDI (1) SMASK (f) ;
SDR 32 TDI (00000000) SMASK (ffffffff) TDO (00000c7f) MASK (ffffffff) ;
//SDR 32 TDI (00000000) SMASK (ffffffff) TDO (000018ff) MASK (ffffffff) ;

if setting TDO (000018ff) then openocd debug output is this:

SDR 32 TDI (00000000) SMASK (ffffffff) TDO (000018ff) MASK (ffffffff) ;
Error: tdo check error at line 8
Error:     READ = 0x0000018ff
Error:     WANT = 0x0000031fe
Error:     MASK = 0x1fffffffe

oink?? mask is shifted by 1 bit (extended to 33 bits?) and likewise
"WANT" has been shifted by 1 bit?  i didn't ask openocd to do that.

ah!  apparently according to this link that's exactly what i did
https://www.maximintegrated.com/en/design/technical-documents/app-notes/3/3339.html

"HDR 1" apparently adds extra bits to shift registers.

ok am good.  will try writing some SVF files to access the DMI
interface, set the DMI address to get the PC for example.

l.



More information about the Libre-soc-dev mailing list