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: 
Newbie khc9355
Newbie
1,867 Views
Registered: ‎12-20-2017

How to use Microblaze to read data from a custom IP

Hi everyone,

 

I'm working on a project, in which we need to use the microblaze read the data from a VHDL block made by ourselves.

 

What I did is: I went to a file named xxxxx_S00_AXI.vhd and found a process that working on assigning different value to "reg_data_out", and replace the first variable by what I want to sent to microblaze.

 

Microblaze does get something from The VHDL block, but not what we expected : whenever microblaze wants to get data, the VHDL block will give it. For example, variable 'output_data' is what we wanna send to microblaze. And usually it is "00000000", we it is triggered by some other blocks, it will become "1100xxxx" (xxxx part depends on the input data), and this is what we want to send to the microblaze instead of '00000000'. What I think the axi will do is there should be a 'valid bit' for the VHDL to tell the microblaze when the data are ready, however I did not find it, and microblaze keeps reading "00000000" when it reaches the command for reading.

 

Though I made some 'while loops' as the 'handshaking protocols' to stop the microblaze from reading the meaningless data from the VHDL, we still get error from it. 

 

The interface on VHDL block is a slave one, and the microblaze gets the master one.

 

Did I miss something in the documents? or is it the correct way to replace the variable in 'xxxxx_S00_AXI.vhd' to sent the data to microblaze? I'm really confused by it..

 

Best,

hoak

 

0 Kudos
8 Replies
Scholar hbucher
Scholar
1,856 Views
Registered: ‎03-22-2016

Re: How to use Microblaze to read data from a custom IP

@khc9355  When you say that the vhdl is a "slave", are you saying that your VHDL IP implements an AXI-full slave interface? Memory mapped or streaming?

Can you share a screenshot of your design?

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Xilinx Employee
Xilinx Employee
1,831 Views
Registered: ‎08-01-2008

Re: How to use Microblaze to read data from a custom IP

You can refer these links for example
http://www.fpgadeveloper.com/2014/08/creating-a-custom-ip-block-in-vivado.html
https://www.dc.uba.ar/materias/CoDisenio/2013/c2/descargas/lab3.pdf
http://islab.soe.uoguelph.ca/sareibi/TEACHING_dr/XILINX_TUTORIALS_dr/EDK_dr/TutorialEDK-Nexys3-AddIP.pdf
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Scholar hbucher
Scholar
1,826 Views
Registered: ‎03-22-2016

Re: How to use Microblaze to read data from a custom IP

@khc9355 @balkris

In addition to the videos below, on this one I teach how to modify an AXI lite default component and inject your logic.

http://www.vitorian.com/x1/archives/594

Yours, truly

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
Xilinx Employee
Xilinx Employee
1,790 Views
Registered: ‎02-01-2008

Re: How to use Microblaze to read data from a custom IP

It should be as simple as replacing the slv_reg0 with your 'custom_signal' in the reg_data_out read mux.

 

But, make sure that you have routed custom_signal out of xxxx_S00_AXI.vhd and through custom_core.vhd with the correct directions.

 

You could try to repackage the IP, and while in the packager vivado project, synthesis your IP, open synthesis, and press 'F4' to review the schematic and make sure the mux is receiving the signal that you expect.

Newbie khc9355
Newbie
1,779 Views
Registered: ‎12-20-2017

Re: How to use Microblaze to read data from a custom IP

Hi,

 

Thanks for your time!

 

Yes, I believe it is a slave interface, memory mapped.

123.PNG

0 Kudos
Newbie khc9355
Newbie
1,777 Views
Registered: ‎12-20-2017

Re: How to use Microblaze to read data from a custom IP

Hi,

I could get correct data from my IP by replacing slv_reg0 by my signal, but it just keep reading the it.

The function I'm looking for is like when you write data into the custom Ip by microblaze, there is a signal called 'axi_awready', and I could use this to decide when should I read from the interface to avoid reading a data twice or get meaningless data.

Best,
0 Kudos
Newbie khc9355
Newbie
1,776 Views
Registered: ‎12-20-2017

Re: How to use Microblaze to read data from a custom IP

Thanks! I will have a look at those docs!
0 Kudos
Xilinx Employee
Xilinx Employee
1,766 Views
Registered: ‎02-01-2008

Re: How to use Microblaze to read data from a custom IP

The axi interface will only use the read data when rvalid AND rready is high. So depending on pipelining and such, you could get early knowledge that a read access is starting by looking for arvalid. Once you capture your custom signal in FFs before the read mux, then allow the core to create rvalid.

 

BUT: make sure that you only have rvalid AND rready high for one clock cycle. If rvalid AND rready are high for multiple clock cycles, then it will confuse the axi infrastructure because it will think there is already data available for the next address transaction.

0 Kudos