UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor bigposs
Visitor
4,525 Views
Registered: ‎04-06-2009

picoblaze works when loaded via jtag, doesn't work when loaded from SPI/PROM

Jump to solution

Hi All, I have a strange fault. I project works find when I download the .bit file via the jtag port. But if I turn the same .bit into and .mcs and load that into an SPI connected PROM the picoblase does funny things.

 

the line

ADD rcv_len,01

 

where I use

NAMEREG s8, rcv_len

 

produces a ramdon result???

 

running from the JTAG all is well, 1 is added and the code functions correctly. Running from the SPI/PROM, the result is a ramdon, i.e. the register is not incremented by 1

 

a bit more of the code where the line is below

 

;part of the code 

 

NAMEREG s8, rcv_len

CONSTANT maskFIFORXF, 02

 

wait_data: INPUT s0,FIFOCrSr

                 TEST s0,maskFIFORXF  --

                 JUMP c,wait_data

;

;data found

;

                 CALL readFifo ;data in s0

                 STORE s0, (rcv_len)

                 ADD rcv_len,01 ;inc the rec byte count ---------- THE FAULT LINE HERE

                 JUMP check_len

 

all other funtions in the FPGA are OK

 

Does the PROM file formatter remove any "features" if there were warnings in the syntheizes?

 

for the internal PicoBlaze RAM I get the following warnings

 

WARNING:PhysDesignRules:812 - Dangling pin <DIA0> on
   block:<XLXI_4/program/ram_1024_x_18>:<RAMB16BWE_RAMB16BWE>.

 

not sure if this is related

 

Regards Stepehn

0 Kudos
1 Solution

Accepted Solutions
Visitor bigposs
Visitor
4,998 Views
Registered: ‎04-06-2009

Re: picoblaze works when loaded via jtag, doesn't work when loaded from SPI/PROM

Jump to solution

Hi Ken, Thanks for your help. It was a startup issue. in the code, I added a startup delay, just a simple double loop

 

;Delay function, first CALL after power on

StartUpDelay: LOAD S1,00 ;loop 1

Loop0Again:   LOAD S0,00 ;loop 0

DelayLoop0: ADD s0, 01 ;add 1 to loop 0

JUMP nz, DelayLoop0 ;repeat until s0 wraps back to zero

LOAD S0,00 ;reset loop 0

ADD s1, 01 ;add 1 to loop 1

JUMP nz, Loop0Again ;repeat until s1 wraps back to zero

RETURN ;

 

Thanks Stephen 

0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
4,505 Views
Registered: ‎09-05-2007

Re: picoblaze works when loaded via jtag, doesn't work when loaded from SPI/PROM

Jump to solution

I think you are probably looking for a race condition that exists in your design immediately following configuration. When you configure the device via JTAG then the device goes through its start up procedure using the JTAG supplied clock. When the device configures itself in master mode then the start up procedure will be clocked by the local clock (or possibly a clock you provide if that is what you defined in your design). The different speed at which the device configures and transitions into full operation could be enough to cause different behaviour overall. It may even involve race conditions with external components as they too respond to power being applied to them and the signal connected to them (e.g. dual purpose pins on the FPGA could be waggling during the master mode configuration that remain static during the JTAG configuration).

 

It is not uncommon for the start of a PicoBlaze program (or any micro controller program) to include some form of time delay intended to allow “everything in a system to settle” before it tries to do anything. You should probably try something along these lines or try holding PicoBlaze in reset for a while after configuration using the reset control and some logic. Also look to initialise other circuits before PicoBlaze starts to interact with them or at least be sure you know what state they are in before you do.

 

By the way, that warning relates to the data input to the BRAM used as the program ROM. Since it is used as a ROM the data inputs are not used and they are defined as being tried to ‘0’. At a certain point the tools realise that this connection can be optimised but then later the tools issue a warning to say that the inputs are not driven. Anyway, you can ignore this one.

Ken Chapman
Principal Engineer, Xilinx UK
0 Kudos
Visitor bigposs
Visitor
4,999 Views
Registered: ‎04-06-2009

Re: picoblaze works when loaded via jtag, doesn't work when loaded from SPI/PROM

Jump to solution

Hi Ken, Thanks for your help. It was a startup issue. in the code, I added a startup delay, just a simple double loop

 

;Delay function, first CALL after power on

StartUpDelay: LOAD S1,00 ;loop 1

Loop0Again:   LOAD S0,00 ;loop 0

DelayLoop0: ADD s0, 01 ;add 1 to loop 0

JUMP nz, DelayLoop0 ;repeat until s0 wraps back to zero

LOAD S0,00 ;reset loop 0

ADD s1, 01 ;add 1 to loop 1

JUMP nz, Loop0Again ;repeat until s1 wraps back to zero

RETURN ;

 

Thanks Stephen 

0 Kudos