cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chaplin_del
Xilinx Employee
Xilinx Employee
36,327 Views
Registered: ‎08-07-2007

PicoBlaze loader FAQ- tips tricks, and future features

Hello All,
 
If you are not aware, a few years ago I developed a JTAG interface for uploading new code to PicoBlaze - the Picoblaze "JTAG Loader".  Thankyou all for your emails over the past years, it seems to be useful to a lot of people :-)
 
A few FAQ that have been asked over the years, which should help out.
 
Q: How do I get the PicoBlaze JTAG Loader?
A: The PicoBlaze JTAG loader is now a part of the PicoBlaze distribution.  Please navigate to www.xilinx.com/picoblaze and download "PicoBlaze for Spartan-3, Virtex-4, Virtex-II and Virtex-II Pro FPGAs", and check out the JTAG_loader_quick_guide.pdf in the JTAG_loader directory.
 
Q: Does the loader work with the USB programming cable
A: The loader can be used with the USB programming cable, however, the steps are slightly different - we use iMPACT to "play" the XSVF file (Thanks to Ken Chapman  for the instructions below):
 
Use the existing procedure to create the XSVF file for your board.
kcpsm3 %1
hex2svfsetup.exe                 
hex2svf %1.hex %1.svf
svf2xsvf -d -i %1.svf -o %1.xsvf
Note that 'hex2svfsetup' is only required the first time.

Open iMPACT in the normal way and select to configure using Boundary Scan mode.
Ideally, select the option 'Enter a Boundary-Scan Chain' which will then allow you to
see and select the 'xsvf' file which you have in your working directory. If you can do
this then jump over the next section between the **** lines.
*******
If you already have the device chain for your board defined and shown as a graphic, you
first need to remove these devices. Simply LEFT click on each device symbol to highlight
it and then press the Delete key on your keyboard. Repeat this until the complete chain
is removed and the screen only has the message 'Right click to Add Device or Initialise
JTAG chain'.
Then RIGHT click and select the option 'Add Xilinx Device...'
This will allow you to see and select the 'xsvf' file which you have in your working
directory.
*******
The graphic should then show a simple TDI to TDO chain consisting of one 'unknown' device
of type XSVF.
Right click on the symbol to 'Execute XSVF/SVF' and the PicoBlaze program should be updated.
Hint - It is a good idea to save this as a project (File - Save Project As...) so that you can
avoid the set up each time.
Note that iMPACT dynamically reads the XSVF file each time the 'Execute XSVF/SVF' is performed.
Therefore it is useful to leave iMPACT open to allow more rapid iterations to be achieved.

Q: Can I have the source code to hex2svf, hex2svfsetup?
A: Unfortunately these are currently not available.  However, on the next version of the tools when I write them, I plan to release the code with the tool.
 
Q: Does the tool support multiple PicoBlaze devices in the same device?
A: No, only one PicoBlaze is supported at the moment.  However, I welcome your feedback on this!
 
 
I welcome your feedback about the tool, and any feature requests that you have for the next version.  Although I cannot promise a specific feature, I welcome your comments.
 
Regards
 
Kris Chaplin
Xilinx UK
0 Kudos
Reply
14 Replies
unicorn70
Explorer
Explorer
36,228 Views
Registered: ‎08-14-2007

Hi Kris Chaplin,

Thank you very much for your JTAG Loader.
It really makes the software coding easier.

In regards to the questions 3, I really hope an open source version of the tools can be provided.
0 Kudos
Reply
chaplin_del
Xilinx Employee
Xilinx Employee
36,222 Views
Registered: ‎08-07-2007

Absolutely.  I plan to write the next version in either TCL or Perl, and so the user will have full access to the source.
Kris Chaplin
Xilinx UK
0 Kudos
Reply
rnodder
Visitor
Visitor
35,090 Views
Registered: ‎01-14-2008

Hi,

Regarding the previous post about JTAG_loader and a USB port, it is also possible to run everything from the batch file, as follows


if exist .\hex2svf.cnf goto one
  echo Need to set up jtag chain first
  hex2svfsetup.exe
  echo jtag chain set up
  pause
:one
hex2svf %1.hex %1.svf
svf2xsvf -d -i %1.svf -o %1.xsvf
@echo setMode -bscan                            > impact_batch_commands.cmd
@echo setCable -port usb21 -baud -1             >> impact_batch_commands.cmd
@echo addDevice -position 1 -file .\%1.xsvf    >> impact_batch_commands.cmd
@echo play                                     >> impact_batch_commands.cmd
@echo quit                                     >> impact_batch_commands.cmd
impact -batch impact_batch_commands.cmd


Obviously the setCable command can be adjusted to suit the programming hardware in use

Regards,

Rob
0 Kudos
Reply
trevor3
Visitor
Visitor
35,015 Views
Registered: ‎11-07-2007

How about a trick to get the picoblaze JTAG loader working for Virtex-4?
0 Kudos
Reply
trevor3
Visitor
Visitor
34,994 Views
Registered: ‎11-07-2007

Never mind i figured it out
0 Kudos
Reply
martinthompson
Explorer
Explorer
34,957 Views
Registered: ‎08-14-2007

Please - do tell the rest of us!

Cheers,
Martin
Martin Thompson
martin.j.thompson@trw.com
http://www.conekt.co.uk/capabilities/electronic-hardware
0 Kudos
Reply
prdorrell
Adventurer
Adventurer
34,466 Views
Registered: ‎03-05-2008

Just when you thought this thread was dead ... 
 
I wish Trevor3 had shared the secret of his success with applying the JTAG Load to the Virtex-4. I'm trying to do the same and failing! Perhaps one of you could comment on what I've done so far and give me a few hints on how to finish the job.
 
1) I'd got the whole JTAG Loading process working fine with a Spartan 3 board. 
 
2) I tried recompiling the design for the Virtex-4 and got an error message. This is because the ROM _form.vhd (and hence my program.vhd) file had the following lines:
 
  v2_bscan: BSCAN_VIRTEX2
  port map(   TDO1 => tdo1,
         TDO2 => tdo2,
            UPDATE => update,
             SHIFT => shift,
             RESET => reset,
               TDI => tdi,
              SEL1 => sel1,
             DRCK1 => drck1,
              SEL2 => sel2,
             DRCK2 => drck2,
      CAPTURE => capture);
So I changed this (with help of the ISE template tool) to ...
 
   BSCAN_VIRTEX4_inst : BSCAN_VIRTEX4
   generic map (
      JTAG_CHAIN => 1) -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
   port map (
      CAPTURE => capture, -- CAPTURE output from TAP controller
      DRCK => drck1,       -- Data register output for USER functions
      RESET => reset,     -- Reset output from TAP controller
      SEL => sel1,         -- USER active output
      SHIFT => shift,     -- SHIFT output from TAP controller
      TDI => tdi,         -- TDI output from TAP controller
      UPDATE => update,   -- UPDATE output from TAP controller
      TDO => tdo1          -- Data input for USER function
   );

... and the ISE tool synthesised without complaining. I downloaded this design to a Virtex-4 board and could see evidence of the software working (flashing leds .. what else!)

3) I used the jtag_loader.bat program to download a new version of the software (slower led flashing) but couldn't see any difference in behaviour ... i.e. it hadn't worked. 

4) At this point I remembered that the hex2svfsetup should be run at least once on the new board. The problem is that hex2svfsetup doesn't allow you to select any FPGA later than a Spartan 3.

5) I abandoned this approach and used Ken Chapman's DATA2MEM approach. This inserts new machine code into the bit file. This worked ... but is still a bit slow because the the whole FPGA is reconfigured every time.

Can anyone suggest how I can get the JTAG loading to work on a Virtex-4?

cheers,

Paul

 

 

 

 

 

 

 

 

 

 


0 Kudos
Reply
rfeneberg
Newbie
Newbie
34,323 Views
Registered: ‎03-19-2008

Hello,
 
this is my version for Virtex 5 in conjunction with the USB cable.
 
I modified the file JTAG_Loader_ROM_form.vhd to JTAG_Loader_V5_ROM_form.vhd (see attachment).
 
I adopted the file hex2svf.cnf to Virtex5's JTAG port:
 
// Initialise SVF file
TRST OFF;
ENDIR IDLE;
ENDDR IDLE;
STATE RESET IDLE;
// set up the chain to bypass the unused JTAG devices
// 0 Devices the before PicoBlaze FPGA
// 0 Devices after PicoBlaze FPGA
// *** Device number 1 is the FPGA with PicoBlaze II ***
TDR 0 TDI() SMASK ();
TIR 0 TDI() SMASK ();
HDR 0 TDI() SMASK ();
HIR 0 TDI() SMASK ();
// Put FPGA into USER1 mode 
SIR 10 TDI (3c2) SMASK (3ff);

For SW download I use this 'load.bat' file (see posting above in thins thread):

if exist .\hex2svf.cnf goto one
  echo Need to set up jtag chain first
  hex2svfsetup.exe
  echo jtag chain set up
  pause
:one
hex2svf %1.hex %1.svf
svf2xsvf -d -i %1.svf -o %1.xsvf
@echo setMode -bscan                            > impact_batch_commands.cmd
@echo setCable -port usb21 -baud -1             >> impact_batch_commands.cmd
@echo addDevice -position 1 -file .\%1.xsvf    >> impact_batch_commands.cmd
@echo play                                     >> impact_batch_commands.cmd
@echo quit                                     >> impact_batch_commands.cmd
impact -batch impact_batch_commands.cmd

The hex2svf.cnf should also work for virtex4 becaus V4 and V5 have both a boundary scan instruction register with of 10 bits and USER1 register address is in both devices 0x3C2
(SIR 10 TDI (3c2) SMASK (3ff);)

All Information without warranty...

Regards,
Robert



Message Edited by rfeneberg on 03-19-2008 05:23 AM
0 Kudos
Reply
c_francof
Visitor
Visitor
33,678 Views
Registered: ‎04-27-2008

hi everyone and thanks for your time.

im using pblaze in Spartan 3E but i cant use the Jtag loader as chaplin explained on Q.Does the loader work with the USB programming cable ?

 

i generated the  'xsvf' file ok, but when i program it nothing happens my kit keep doing the same (last program)and i don't know the error anyone can help??    should i change the program name .psm ? i dont know help please.

 

Christian

0 Kudos
Reply
mkabatek
Newbie
Newbie
10,818 Views
Registered: ‎10-13-2008

Very useful tools!!! Works great with my digilent Spartan3E starter ... I have been able to implement the picoblaze, and update the code! SWEET! ... although i think the assembly -> conversion to xsvf could be a little less clunky ... maybe I can write something =)

 

thanks

0 Kudos
Reply
ganaylor
Observer
Observer
10,358 Views
Registered: ‎03-28-2008

Just to remind you that if you don't have easy access to the JTag, but do have access to a serial port as part of the application, then it is possible to re-program the memory on the fly (and without having to use a special RAM module) as indicated in http://forums.xilinx.com/xlnx/board/message?board.id=PicoBlaze&thread.id=11 . If the link back to step 0 is always made possible in the downloaded program on receipt of an appropriate command, then it can be re-programmed at any time after initial setup, even in the field. Of course the hardware will have to allow re-programming of the RAM on the second port using decoded address and data ports from the picoblaze.
0 Kudos
Reply
kmkhare
Visitor
Visitor
8,138 Views
Registered: ‎02-02-2010

Hi Christain,

     Did you find the solution of your problem?, I am also having the same problem that after executing all the steps...new code does not execute.

KM  

0 Kudos
Reply
5,704 Views
Registered: ‎12-22-2013

Sir, 
Can u please tell me the difference between pico blaze and microblaze microcontroller in fpga?

0 Kudos
Reply
chapman
Xilinx Employee
Xilinx Employee
5,697 Views
Registered: ‎09-05-2007

Well I'll tell you the obvious difference. PicoBlaze is 8-bits and MicroBlaze is 32 bits.

Ken Chapman
Principal Engineer, Xilinx UK
0 Kudos
Reply