1
\$\begingroup\$

In Xilinx Vivado IP integrator, I want to create a custom building block. The block need to be able to access the memory space (possibly external RAM) by itself.

The target function of the block can be described in the following steps:

  • I give the AXI-MM slave block two adresses:
    • 0x????_???0: a base memory address, e.g. "0x0000_ABC0".
    • 0x????_???4: an offset memory address, e.g. "0x0000_000D".
  • The block should will now automatically determine the resulting memory address ("0x0000_ABCD") and fetch the data from that memory location, e.g. "0x0000_0100". This data read represents a new memory address.
  • The block should now fetch data from that memory location (e.g. "0x0000_0005") and write it to AXI_MM address 0x????_???8.

p.s. I'm using 0x????_???x, as the AXI-MM base address depends on the settings in the IP configurator and on possible other connected blocks.

I haven't found any description of how a custom block should read from the memory. How should I approach this problem?

I'm using Digilent Zybo Zynq-7000 ARM/FPGA SoC Trainer Board.

\$\endgroup\$
  • \$\begingroup\$ Duplicate of stackoverflow.com/questions/49079314/… \$\endgroup\$ – Brian Drummond Mar 4 '18 at 18:59
  • 1
    \$\begingroup\$ Humm, Had not seen that. Cross-posting to get rid of negative voting is a big No! No! \$\endgroup\$ – Oldfart Mar 4 '18 at 19:05
  • \$\begingroup\$ @oldfart Crossposting can also happen, if no answers are achieved at a different Q&A site. Hanlons razor teaches us to never assume malevolence if actions can be explained sufficiently by stupidity or ignorance. \$\endgroup\$ – Ariser Mar 4 '18 at 20:47
  • 1
    \$\begingroup\$ Instead of crossposting you should have flagged your message to be moved from stackoverflow to EE.SE. \$\endgroup\$ – Ariser Mar 4 '18 at 20:48
0
\$\begingroup\$

As you mention AXI: you have to write an AXI master module which outputs read and write request following the AXI protocol. Then you have to write code to accept the return data be it read return or write acknowledges.

Vivado has some basic IP to do basic reads and writes for you. If you need something beyond that you have to write it yourself. I have written a lot of AXI components. The AXI protocol seems very simple but is devilish complex to get right.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your response. I want to know that should the ip connect to Zynq PS' slave port though interconnect or is another ip required like DMA? Also how can i create a transaction? Must i use signals like rdatam[AXI_DATA_MSB:0]? [ infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0431c/… ] \$\endgroup\$ – leventofset Mar 4 '18 at 18:50
  • \$\begingroup\$ It has been a while since I looked at Zynq but I think, yes you need to write an AXI state machine which is connected to the PS port and reads and writes memory. For the names of your signals read the Vivado manuals about how to write AXI IP. \$\endgroup\$ – Oldfart Mar 4 '18 at 19:03
0
\$\begingroup\$

See the Xilinx AXI Reference guide and the AMBA AXI protocol reference.

In particular, see section A3.2: "Basic read and write transactions" which details how the valid/ready handshake protocol works, and details the channel protocols for reading and writing.

You need to write an axi master which creates AXI write/read requests on the AXI bus and processes the response. You can use the DMA core to generate these requests for you, but in my experience the DMA core command interface is practically the same as the AXI address bus.

For an example AXI master, you can use Vivado to create an example AXI master IP. See this guide for details.

In short, you open create an empty vivado project and run the "Create and Package IP wizard" (page 27)

To run the Create and Package New IP wizard, from the Tools menu, select Create and Package New IP.

Then select "Create a new AXI4 Peripheral" and see page 39 for how to parameterise your new peripheral. You want to add an AXI Memory-Mapped Master interface. Once you've gone through this wizard, vivado should generate example code for your AXI peripheral and you can edit it as you please.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your response. I understood that i need a master interface. The part that i don’t understand is how i can start a trascation, which signals should i use. \$\endgroup\$ – leventofset Mar 13 '18 at 8:04
  • \$\begingroup\$ @leventofset you need to familiarise yourself with the AXI-MM protocol. (see the reference guides at the top of my answer). The protocol is made up of address, data, and response channels. You initialise a transaction by driving the valid on the address channel with the rest of the signals driven according to your transaction requirements. The example code should show an example of this. \$\endgroup\$ – stanri Mar 13 '18 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.