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
Newbie amnl
Newbie
1,524 Views
Registered: ‎01-12-2012

Program general purpose IP Core with MicroBlaze using custom instructions or extensions

Hello to everybody.

 

I''m developing a general purpose image processing IPCore. The idea is to embbed an standard MicroBlaze SoC with this custom core using AXI4 buses. One of the problems I have is how to "program" it. Let me explain: The core has a instruction decoder for my "custom" extensions. For instance:

 

vector_addition $vector[0], $vector[1], $vector[2]      // (i.e. v2 = v0+v1)

 

and many more like that. So, I want to add it from the MicroBlaze program to this decoder, employing the processor for loops, non-vector operations, etc, like that:

 

for (i=0; i<15;i++)                     // to be executed in the MB

     vector_add(v0, v1, v2)        // to be executed in my IPCore

 

The core only need the instruction itself, in machine code

 

opcode              = vector_add  = 0x12h

register_src_1 = v0 = 0x00h

register_src_2 = v1 = 0x01h

register_dst      = v2 = 0x02h

------------------------------------------

machine code = 0x7606E600h  (or whatever)

 

Once sending it through the AXI4 bus to the core, it is able to request all data from memory with dedicated buses and to handle everything. The big cuestion is: how can I translate the previous instruction to its hexadecimal representation? Some options that come to mind are

 

  • Interpreted code (translate to machine code at runtime in the MB) --> very slow, even using some kind of inline macro
  • Compile the custom sections with an external custom compiler, load the binary from the external memory and move it to the peripheral with some instruction like 'execute_this_block(what_block_pointer)' --> hard to read/understand source code, poor SDK integration, too many sections if code is very segmented
  • JIT compilation --> to complex just for this?
  • Extending the mb compiler --> a nightmare!
  • A custom processor/controller to handle everything: loops, pointers, memory allocation, variables... --> too much work

 

I hope I explained it correctly... Thanks in advance!

0 Kudos