cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mdeepakm
Visitor
Visitor
767 Views
Registered: ‎09-30-2019

Driver for custom AXI IP - utils function missing

Hello,

  I created an IP (say 'myip') using HLS with AXI-stream input and output. After connecting the IP to Zynq and exporting the bitstream to SDK, header file xmyip.h got generated which had functions like "Xmyip_LookupConfig", "Xmyip_CfgInitialize" etc with which I was able to initialize my IP 'myip' and use the function "XAxiDma_SimpleTransfer" to send AXI-stream input data to/from PL/PS.

But if I create any custom-IP (not HLS, but using Create and Package New-IP under tools), in the same name ('myip'), headerfile myip.h (not xmyip.h like in case of HLS) got generated. And also it has the following functions only

#define MYIP2_mReadReg(BaseAddress, RegOffset) \
Xil_In32((BaseAddress) + (RegOffset))

#define MYIP2_mWriteReg(BaseAddress, RegOffset, Data) \
Xil_Out32((BaseAddress) + (RegOffset), (u32)(Data))

There are no util/wrapper functions ("Xmyip_LookupConfig", "Xmyip_CfgInitialize") like in the case of HLS IP to initialize my IP core. How do I proceed in this case?

Regards

0 Kudos
6 Replies
ibaie
Xilinx Employee
Xilinx Employee
703 Views
Registered: ‎10-06-2016

Hi @mdeepakm 

I'm not really familiar with HLS but as you already notice the default Vivado Custom IP wizard just provides a very basic driver code (as you already said just a C file and Header file). That means that you would need to write your own drivers, either completelly custom or based on our default drivers.

The HLS cores have DMA engines on it by default and that's why the tool provides a generic driver to handle transactions and initialize the code. In Vivado IP the IPs are much more divers and can go from simple register to really complex design, so there is no way to provide a generic driver code that suits all of them.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
mdeepakm
Visitor
Visitor
686 Views
Registered: ‎09-30-2019

Hello @ibaie ,

    Thank You for your reply. As the registers used for AXI stream are memory-mapped, I can find the related addresses and read/write to these using the generated functions from the header file for transferring the data. But what should I do to initialize the IP? Or how am I supposed to use the generated functions in the header file to initialize the IP? Can you please direct me to an example.

Regards

Deepak

0 Kudos
ibaie
Xilinx Employee
Xilinx Employee
647 Views
Registered: ‎10-06-2016

Hi @mdeepakm 

You AXI ports in the IP probably are either AXI4 or AXI-Lite (no AXI Stream), which are memory-mapped interfaces. The address of the IP can be found either in your Vivado design within the Address Editor or the xparameters.h file in your BSP which is auto-generated based on the Vivado design.

The IP does not have any initialization requirement, is up to your design. What I mean is that the memory mapped register are available from the beggining so you can do read/write operations. Then if you design your IP in a way that you need to write some register to start whaterver function you want to perform, then is completelly up to your design.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
stephenm
Moderator
Moderator
624 Views
Registered: ‎09-12-2007

The AR below is old, but is has the steps to create a driver:

https://www.xilinx.com/support/answers/64980.html

 

It discusses the HSI (which may not be relevant here) but the rest should help

0 Kudos
mdeepakm
Visitor
Visitor
603 Views
Registered: ‎09-30-2019

Hello @stephenm,

Thanks a lot for the reply. I generated the files already. The xparameters.h has only the following:

/******************************************************************/
/* Definitions for driver SYSDEF */
#define XPAR_SYSDEF_NUM_INSTANCES 1

/* Definitions for peripheral SYSDEF_0 */
#define XPAR_SYSDEF_0_DEVICE_ID 0

/******************************************************************/

I don't find the base address of my IP named "sysdef".

Regards
0 Kudos
stephenm
Moderator
Moderator
592 Views
Registered: ‎09-12-2007

the xparameters.h file is populated by the TCL file in the data folder of your IP.

Take the gpio for example:

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/gpio/data/gpio.tcl

For example, the ::hsi::utils::define_include_file.

do yu have something similar on your end?

Can you share your driver?

 

0 Kudos