cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
namabo
Adventurer
Adventurer
793 Views
Registered: ‎07-27-2018

HLS AXI-Master to read XADC AXI4_Lite_Slave (offset does not work)

Jump to solution

Hi everybody,

I'm implementing a simple example in HLS in order to read data from XADC Wizard IP.

Basically I wrote a function in HLS with an AXI Master interface, then in block design I connected it to the XADC Slave port by mean of the AXi Interconnect, block. The base address fro the XADC is 0x0000 0000. My purpose is to read the varoius registers given by the XADC block.

The problem: in the AXI transactino in the simulation I always read address 0x0000 0200, even if I set a different offset in the C code of HLS module.

Below the HLS module C code:

#define VPVN 0x20C
void XADC_Ctrl(char *ptrXADCBaseAddr, unsigned int *data_read)
{
#pragma HLS INTERFACE m_axi port=ptrXADCBaseAddr offset=off depth=1024
#pragma HLS INTERFACE port=one_acquire ap_none

*data_read = (unsigned int) *( ptrXADCBaseAddr + VPVN );

}

 

xadc_hls_control.png

I have no idea, it seems my VPVN offset is always overwritten.

Any suggestion is well accepted.

Thank you

0 Kudos
1 Solution

Accepted Solutions
namabo
Adventurer
Adventurer
765 Views
Registered: ‎07-27-2018

I solved it inserting offset=slave, and accessing the pointer like vector:

void Epy_XADC_Ctrl(unsigned char *ptrXADCBaseAddr,unsigned int *data_read)
{
#pragma HLS INTERFACE m_axi depth=1024 port=ptrXADCBaseAddr offset=slave
#pragma HLS INTERFACE port=one_acquire ap_none


*data_read = (unsigned int) ptrXADCBaseAddr[VPVN];

}

 

View solution in original post

0 Kudos
1 Reply
namabo
Adventurer
Adventurer
766 Views
Registered: ‎07-27-2018

I solved it inserting offset=slave, and accessing the pointer like vector:

void Epy_XADC_Ctrl(unsigned char *ptrXADCBaseAddr,unsigned int *data_read)
{
#pragma HLS INTERFACE m_axi depth=1024 port=ptrXADCBaseAddr offset=slave
#pragma HLS INTERFACE port=one_acquire ap_none


*data_read = (unsigned int) ptrXADCBaseAddr[VPVN];

}

 

View solution in original post

0 Kudos