Writing to a peripheral in Vivado and then outputting to a LED

337 views Asked by At

I want to create a basic project in Vivado that takes a value that i input to a client, which is sent to a server I made (in C), and then the server writes that value to a peripheral in Vivado, and then that data in the peripheral is sent to an output pin that assigns to LED's, making the LED light up.

Basically I want to go from client-->server-->peripheral-->LED lights up

For example, in the client (a GUI) I want to give it a value such as 0011, which is received by the server. Then the server writes that value to the peripheral which will then make, in this case, LED0 & LED1 not light, but LED2 & LED3 will light.

I know how to make an AXI4 peripheral in Vivado, and the client-server (TCP/IP) has been made. My question is what code/design block I would need to then take the data written to the peripheral and assign it to the LED's?

Should I make the peripheral a Master or Slave? Overall confused how should i proceed from here. I am using a Red Pitaya (Xilinx Zynq 7010 SoC) connected by an Ethernet cable to my computer.

Also, I thought of running the program on the Red Pitaya by loading the bitstream on to it (using WinSCP) by running the command

cat FILE_NAME.bit > /dev/xdevcfg

in PuTTY (connected to the Pitaya by IP address), then running the server on the pitaya, and then sending the signal from the client for the server to receive. Is that the correct way of approaching it?

If my logic is off in anyway please let me know

1

There are 1 answers

4
Oldfart On BEST ANSWER

I am somewhat thrown by your statements.

  • First you say "I know how to make an AXI4 peripheral in Vivado"

  • Next I read: "Should I make the peripheral a Master or Slave?"

Maybe I am wrong but to me it says you don't really know what you are doing.

Simplest is to:

  1. Instance a zynq system.
  2. Add the IP with the name "AXI GPIO". (Which, by the way, is an AXI slave.)
  3. Run the auto connection.
  4. Assign the right I/O pins to the GPIO port. (check your development system manual)
  5. Build the system.

By the way you find the address of the peripheral in the address tab and it normally is 0x0080000000.

You wrote that you made a server (TCP/IP). "All" it has to do is write the received value to a register in the GPIO block. (Here I assume Xilinx has a document which describes how the GPIO block works and has example GPIO drivers.)