cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
spenser309
Observer
Observer
5,913 Views
Registered: ‎06-16-2009

microblaze "get" instruction causes hang.

I'm using EDK 13.1 to design a fsl coprocessor.  To proof the FSL link, I am trying to simply use the autogenerated summation design.  When I run the autogenerated selftest code with the debugger in SDK.  I noticed that when a "get" instruction is executed the PC jumps back an instruction causing a tight loop of the previous instruction and get instructions to be executed.  In the ISA, I see no mention that the "get" instruction should be able to alter the PC value and am completely stumped as to why this would occur.  

 

I noticed upon subsequent evaluation that the first interation of the for loop which contains the "get" instruction is executed correctly but subsequent interations generate the issue described above.

 

Additionally,  the MSR[FSL] bit is zero during the exection.  The correct behaviour accoring to the MB reference manual.

 

Essentially, this causes a hang on these two instructions therefore not allowing anymore code to execute.  Has anyone else noticed this issue with there FSL peripherals in the newest version of EDK?

 

I can provide any and all additional information that may be needed.

 

Spenser 

0 Kudos
7 Replies
goran
Xilinx Employee
Xilinx Employee
5,902 Views
Registered: ‎08-06-2007

Hi,

 

"get" instruction can't modify the PC address so it will not change the PC.

How does the instruction sequence look? Have you disassembled the code?

 

Göran

0 Kudos
spenser309
Observer
Observer
5,885 Views
Registered: ‎06-16-2009

So, I changed the buffer size in the FSL link to see if that was part of the issue.  Now the put instruction is showing the same behaviour as the get instruction.  A video of the situaion is attached.  Let me know if I should convert it to another format.

 

Spenser

0 Kudos
goran
Xilinx Employee
Xilinx Employee
5,863 Views
Registered: ‎08-06-2007

Hi,

 

I can't see the video.

 

It would be more helpful if you show a simulation waveform on MicroBlaze execution where the "get" instruction is doing something weird. Just add all "Trace_*****" signals on MicroBlaze to the waveform.

 

Also if you can show us the .mhs file so I can check if there is something missing.

 

Göran

0 Kudos
spenser309
Observer
Observer
5,841 Views
Registered: ‎06-16-2009

http://www.youtube.com/watch?v=hvQi9ITgYos

 

I uploaded the video to youtube.  Click the link above to view. 

 

You have asked for a trace and I can use chipscope to generate it for you; however, what would you like me to trigger on.

 

The MHS is attached.

 

Spenser

0 Kudos
goran
Xilinx Employee
Xilinx Employee
5,796 Views
Registered: ‎08-06-2007

Hi,

 

1. You are tapping the FSL connection in .mhs for connecting the chipscope.
    Have you looked at the hdl/system.vhd to see if all signals gets connected correct? (Both for chipscope and for the FSL connection)

 

2. When tracing MicroBlaze executions, there are a number of trace signals to use.
    If you have room, take all TRACE_ signals on MicroBlaze, otherwise these are the most important ones:

   Trace_Valid_Instr

   Trace_PC

   Trace_Instruction

   Trace_Reg_Write

   Trace_New_Reg_Value

 

   You can find more information on these in the MicroBlaze reference guide.

 

   Trigger when MicroBlaze is executing the put and/or get instruction.

 

3. Your setting on MicroBlaze can be more optimized.
     C_USE_BARREL = 1 will improve performance since C program tends to use shifting a lot.

 

 

Göran

0 Kudos
spenser309
Observer
Observer
5,738 Views
Registered: ‎06-16-2009

Sorry, I haven't responded sooner.  Got side tracked on another project.  I looked for thoose signals but they are not available in Chipscope. 

 

I then looked into doing a full blown simulation but my project uses SRAM and is such unable to be simulated. Let me know if there is anything else I can provide that may help in debugging this.

0 Kudos
goran
Xilinx Employee
Xilinx Employee
5,735 Views
Registered: ‎08-06-2007

Hi,

 

If you add chipscope to the .mhs file using XPS, all MicroBlaze trace signals are available to connect to Chipscope.

 

This is how I usually do (using 13.1):

 

In the system.mhs file:

On MicroBlaze core I add this:

 

 PORT Trace_Instruction = Trace_Instruction
 PORT Trace_Valid_Instr = Trace_Valid_Instr
 PORT Trace_PC = Trace_PC
 PORT Trace_Reg_Write = Trace_Reg_Write
 PORT Trace_Reg_Addr = Trace_Reg_Addr
 PORT Trace_MSR_Reg = Trace_MSR_Reg
 PORT Trace_New_Reg_Value = Trace_New_Reg_Value 
 PORT Trace_Exception_Taken = Trace_Exception_Taken
 PORT Trace_Exception_Kind = Trace_Exception_Kind
 PORT Trace_Jump_Taken = Trace_Jump_Taken
 PORT Trace_Data_Address = Trace_Data_Address
 PORT Trace_Data_Read = Trace_Data_Read
 PORT Trace_Data_Write = Trace_Data_Write
 PORT Trace_Data_Write_Value = Trace_Data_Write_Value
 PORT Trace_Data_Byte_Enable = Trace_Data_Byte_Enable
 PORT Trace_MB_Halted = Trace_MB_Halted

  

 

At the end of the .mhs file I add this:

 

 

BEGIN chipscope_ila

 PARAMETER INSTANCE = chipscope_ila_0

 PARAMETER HW_VER = 1.04.a

 PARAMETER C_TRIG0_UNITS = 4

 PARAMETER C_TRIG0_TRIGGER_IN_WIDTH = 197

 PARAMETER C_NUM_DATA_SAMPLES = 4096

 PARAMETER C_TRIG0_UNIT_COUNTER_WIDTH = 10

 PARAMETER C_TRIG0_UNIT_MATCH_TYPE = extended

 PORT chipscope_ila_control = chipscope_ila_0_icon_control

 PORT TRIG0 = microblaze_0_interrupt & Trace_Instruction & Trace_Valid_Instr & Trace_PC & Trace_Reg_Write & Trace_Reg_Addr & Trace_MSR_Reg & Trace_New_Reg_Value & Trace_Exception_Taken & Trace_Exception_Kind & Trace_Jump_Taken &  Trace_Data_Address &  Trace_Data_Read & Trace_Data_Write & Trace_Data_Write_Value & Trace_Data_Byte_Enable & Trace_MB_Halted

 PORT CLK = clk_100_0000MHzMMCM0

END


BEGIN chipscope_icon

 PARAMETER INSTANCE = chipscope_icon_0

 PARAMETER HW_VER = 1.05.a

 PARAMETER C_NUM_CONTROL_PORTS = 1

 PORT control0 = chipscope_ila_0_icon_control

END

 

 

After the bitfile is generated, the tool will generate a chipscope .cdc file which makes it much easier to setup the chipscope analyzer waveform. It's located at implementation/<ila name in mhs>_wrapper/<ila name in .mhs>.cdc

In the example above it will be implementation/chipscope_ila_0_wrapper/chipscope_ila_0.cdc

 

Göran

0 Kudos