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: 
Adventurer
Adventurer
7,373 Views
Registered: ‎12-18-2012

BRAM interfaces for custom ip I/O made in HLS

I have an IP with array inputs and outputs made with HLS to use beside a Microblaze in the IP integrator. After some help through the forum I thought it is best for my design have BRAM interfaces for I/O of the HLS IP and communicate to with the Microblaze .

 

What I am not sure I understand is how would this be implemented in the IP integrator and how it would be programmed in sdk for the Custom ip to receive the correct inputs and read the correct outputs.

 

Would sth like this makes sense: The custom IP memory I/O interface is connected to one port of a dual port BRAM block

and the other port of the BRAM block connected to an AXI BRAM controller which enables the communication with the microblaze:

 

Screenshot from 2013-10-17 15:53:31.png

 

If that is correct how would that be programmed in SDK for the system to work correctly?

 

Thanks!

0 Kudos
5 Replies
Scholar pedro_uno
Scholar
7,366 Views
Registered: ‎02-12-2013

Re: BRAM interfaces for custom ip I/O made in HLS

Hello,

 

It is my understanding that you picture is correct.  Any HLS block with an array pointer interface will expect to control one port of a Block RAM.  The other port of the BRAM is connected to the AXI bus.

 

You only need the base address of the AXI BRAM Controller to write to it.  There are no SDK drivers. You can find that base address by looking in the Address Tab that comes up with the IP Integrator.

 

The Start and Done control and status lines of the HLS block are connected directly to the AXI bus and you get little bare metal drivers for bit twiddling them.

 

Here is some code I used to talk to my HLS block mem_negate.cpp.  It just negates all the values of a block ram over a programmabe number of locations.

   

printf("Testing mem_negate\n");

   

// Initialize the block pointer.

XMem_negate mem_negate;

XMem_negate_Initialize(&mem_negate, 0);

 

   

// Write the input data to the memory.

int32_t num_locs = 1000;

for(i=0;i<num_locs;i++) BRAM3_Start[i] = i;

 

// Write the num_locs parameter.

XMem_negate_SetNum_locs_v(&mem_negate, num_locs);

 

// Start the block.

XMem_negate_Start(&mem_negate);

 

// Wait for the vlock to complete.

while( !XMem_negate_IsIdle(&mem_negate) ) printf("waiting for mem_negate\n");

   

// Verify the results.

error = 0;

for(i=0;i<num_locs;i++) if(BRAM3_Start[i] != -i){   

    printf("ERROR: %d    %d\n", (int)(BRAM3_Start[i]), -i);

    error = 1;

}

if(error) printf("ERROR: mem_negate\n");

 

Please let us know if you get your BRAM to HLS interface working.  I think there may be a IP Integrator bug that makes my design fail.

 

  Pete

 

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
Adventurer
Adventurer
7,362 Views
Registered: ‎12-18-2012

Re: BRAM interfaces for custom ip I/O made in HLS

Thanks for the reply

 

So you just use this base address to define the BRAM3_Start array just like a pointer i presume, correct?

 

I will try and let you know about the results

 

Cheers George

 

0 Kudos
Scholar pedro_uno
Scholar
7,357 Views
Registered: ‎02-12-2013

Re: BRAM interfaces for custom ip I/O made in HLS

Yes, like this.  I attach the whole program in case that helps.  I started that project using the memory tester template because it disables the data cache.  I wanted to make sure that accesses actually went to the BRAM.

 

int main()

{

   

signedint i, error;   

int32_t* BRAM3_Start  = (int32_t *)0x40003000; // This is my data interface to the HLS block.

uint32_t  BRAM_Length = 0x00001000/4;

----------------------------------------
DSP in hardware and software
-----------------------------------------
Adventurer
Adventurer
7,344 Views
Registered: ‎12-18-2012

Re: BRAM interfaces for custom ip I/O made in HLS

My design does fail but in implementation.  For some reason there are unconnected pins. As a results the implementation just ignores whole pieces of the logic and is incorrect.

 

I then realized that the controller had a fixed address width of 14 bit for 32 bit data. while BRAM generator have 32 bit address and I cannot change this...

 

If there is any suggestions would be appreciated cuase i really do not understand.

 

0 Kudos
Highlighted
Observer zasxcd
Observer
1,390 Views
Registered: ‎05-28-2017

Re: BRAM interfaces for custom ip I/O made in HLS

@pedro_uno Hi. Is your memnegate design working?

0 Kudos