1
0
mirror of https://github.com/bmartini/zynq-axis.git synced 2024-09-05 19:19:27 +08:00

73 Commits

Author SHA1 Message Date
Berin Martini
a53998a69d Replace axis_memory_offset function with mem_alloc_state
The functionality of the axis_memory_offset function can be replicated by using
mem_alloc_state while at the same times provides a more powerful interface to
the memory allocation system.

The 1st argument passed to the new mem_alloc_state functions is a pointer to a
void pointer (start) whose value will be overwritten to be the start pointer of
the CMA memory area. The 2nd argument is a pointer to a unsigned int whose
values will be overwritten to be the current 'offset' from that start pointer
and thus represents how many bytes has been allocated.
2015-10-29 14:42:25 +00:00
Berin Martini
586efff1a9 White space correction for interface.c 2015-10-29 02:12:29 +00:00
Berin Martini
dafc85637a New function in library 'axis_memory_offset'
This function takes as argument an offset indexed from zero and returns a usage
pointer corresponding to the offset from the start of the CMA region. Thus an
argument offset of zero would give the pointer to the start of the CMA region.
2015-10-29 02:12:29 +00:00
Berin Martini
a0c2bde576 Increase the CMA region to 126MB from 63MB
This gives more room to play with in the FPGA project.
2015-10-29 00:58:33 +00:00
Berin Martini
0ab669e7c0 Remove assert for AXIS port max number
It is possible to have more then 4 AXIS modules if 2 or more are connected to
the same AXI Interconnect.
2015-09-24 20:05:15 +00:00
Berin Martini
0bb945c62d Add doc on building u-boot, kernel and devicetree
Some bare bones instructions on how to compile the above list of components.
2015-09-23 01:22:45 -04:00
Berin Martini
01a04802cf Update CC variable in app & lib Makefiles
This change prepends the CROSS_COMPILE environmental variable to the compilers
definition. Thus adding the possibility of cross compiling when the cross
compiling tool chain has been setup correctly.
2015-02-12 01:52:10 -05:00
Berin Martini
a1394df70a Add Acknowledgements in README 2015-02-11 15:54:38 -05:00
Berin Martini
55319e7d19 Associate axi_clk to AXI bus interfaces
By explicitly pairing the clock running the interface with the interface
in Vivado it allows for better timing analysis and remove some 'CRITICAL
WARNINGS'.
2015-02-09 14:21:20 -05:00
Berin Martini
1074aa90fb Add 'Creating Devicetree' section to README.md
A working devicetree is a necessary component to the AXIS system.
2015-02-01 18:09:26 -05:00
Berin Martini
95313c98f7 Memory alignment does not need to be PAGE aligned
The memory is addressable using the AXIS ports in 64 bit (8 byte) chunks. Thus
when allocating memory from CMA region, the start address needs to be 64 bit
aligned, not page aligned. This change will thus reduce the 'padding' at the
end of arrays and thus RAM.
2015-01-30 15:53:28 -05:00
Berin Martini
9d1c2b3538 Remove hdl/system(_wrapper).v from Xilinx project
These files are re-generated every time the project is synthesized and thus do
not need to be kept in the repo.
2015-01-17 16:16:43 -05:00
Berin Martini
7c4d49a809 Add device tree example for a Zynq AXIS project
This devicetree code is an altered version of the
'arch/arm/boot/dts/zynq-7000.dtsi' file found in the linux-xlnx Xilinx
repo, master branch commit (da2d296bb6b89f7bc7644f6b552b9766ac1c17d5).

The only thing that was added was the following axis node:-

```
axis: axis@43C00000 {
	compatible = "xlnx,axis-1.00";
	reg = < 0x43C00000 0x10000 >;
	xlnx,num-mem = <0x1>;
	xlnx,num-reg = <0x20>;
	xlnx,s-axi-min-size = <0x1ff>;
	xlnx,slv-awidth = <0x20>;
	xlnx,slv-dwidth = <0x20>;
};
```
2015-01-12 14:56:33 -05:00
Berin Martini
89d9632652 Change devicetree AXIS node name
The udev rule now identifies the Linux kernel module via a different
devicetree name, one that is more in keeping with the project.
2015-01-12 14:50:35 -05:00
Berin Martini
5d08213087 Fix markdown typo in README.md 2015-01-12 10:46:13 -05:00
Berin Martini
4e1d4af8eb Add README.md to the project 2015-01-11 16:11:39 -05:00
Berin Martini
7636ed6277 Bug fix: axis_addr testbench
Had not updated it to remove the address ID tag.
2015-01-11 13:12:20 -05:00
Berin Martini
0ff47fafb6 Bug fix: axis_write testbench
Had not updated it to remove the address ID tag.
2015-01-11 13:10:29 -05:00
Berin Martini
65d8079cda Terminate axi_rresp & axi_rlast in axis.v
Since these signals are never used, they do not need to be propagated
past the axis.v module.
2015-01-11 13:04:29 -05:00
Berin Martini
48a322ba60 Bug fix: axis_read testbench
Had not updated it to remove the address ID tag.
2015-01-11 12:54:29 -05:00
Berin Martini
c8c10e7a47 Add License information
The code in the repo have a mixture of different licenses. The
LICENSE.md file explains what code has which license.
2015-01-10 13:30:43 -05:00
Berin Martini
7f189376a6 Merge branch 'library-updates'
Extend the interface library to properly handle the DMA memory exposed by the
axis driver.
2015-01-09 17:26:02 -05:00
Berin Martini
66f4315fdd Add some more configuration bus functions
Similar functions could be constructed using calls to the already existing
functions, however, it seems more efficient to add them to the library in case
the application cannot optimizes external library calls.
2015-01-09 17:17:34 -05:00
Berin Martini
76e102294b Add function to help configure the axis ports
This frees the application writer from having to know low level details like
the physical memory address of arrays etc.
2015-01-09 17:15:12 -05:00
Berin Martini
05579b59d0 Read uio driver sys file to determine mem address
The uio driver exports files to the /sys directory, one of which gives the RAM
memory offset for the *mem* CMA array. This will be needed when giving address
to the axis ports, it is thus read from the file during the init function call.
2015-01-09 16:49:20 -05:00
Berin Martini
891d4a4276 Add app that tests the library memory allocation 2015-01-09 14:07:16 -05:00
Berin Martini
00541db077 Add function to library to allocate CMA memory
Arrays that will be used to pass data between the host and fpga need to be page
aligned and be slices of the DMA array the driver has reserved. These new
functions allocate slices from the DMA array and ensures that the starting
address is page aligned.
2015-01-09 13:44:46 -05:00
Berin Martini
2f10fb29d2 Memory map CMA array from driver
The driver sets ups a DMA contiguous array that will be used as a memory area
to share data between the PS and PL. The library memory maps this DMA array to
make it available to the host applications. The array is cache coherent and
thus data written or read from it bypass the CPU cache and read/write directly
from main memory. This ensures that the data is always the same between the
host and fpga but at a cost of long data accesses from the host CPU.
2015-01-09 13:07:51 -05:00
Berin Martini
80d401db54 Merge branch 'connect-axis-to-hp0'
Add a High Performance port (HP0) to the zedboard_axis project and
connect a AXIS module that can read and write to the main memory using
HP0. Add two small applications that test writing and reading from
memory.
2015-01-08 14:53:14 -05:00
Berin Martini
3e54a8038e Update read-memory application
Now setup to read from memory what was written by the write-memory app.
2015-01-08 14:46:19 -05:00
Berin Martini
a2d60896a8 Add program for writing to memory using axis port
The application takes one argument, the number (or length) of data to be
written to the memory.

The physical address in main memory that is going to be written to is the
address of the CMA memory region on my currently running system.
2015-01-08 14:46:19 -05:00
Berin Martini
76537507eb Bug fix: AXI transaction ID usage and generation
Because the axis modules are minimalist, it assumes that all
transactions are performed without error and that transaction processing
is performed in-order. Thus the transaction IDs can safely be set to
zero. Doing so also fixes a bug in the write path that had prevented
multiple burst of data being sent. This was due to the fact that the
write data burst ID needs to have the same ID as the write address. But
the write address module was incrementing the ID while the write data ID
was not being set at all.
2015-01-08 11:39:07 -05:00
Berin Martini
9ee0ce64ee Indicates burst size in bytes of each transfer
This signal encoding is determined using the axi data width parameter as
per Section 4.3 of the AXI Protocol Specification (v1.0).
2015-01-08 10:58:20 -05:00
Berin Martini
852e507af2 Bug fix: axis burst size wr/rd values
By setting the values as larger then they should be the data was over
writing itself in memory.
2015-01-07 14:13:29 -05:00
Berin Martini
19390ccca8 Bug fix: axis port list variable sizes
There was a miss-match that was giving warnings but as the variables
were not used there were no errors.
2015-01-07 12:53:31 -05:00
Berin Martini
d1db9ce3b3 Parametrize address step size in axis_addr
Had been assuming that the AXI word width was 256 bits and thus the
address would step 32 bytes * burst_length.
2015-01-07 11:43:56 -05:00
Berin Martini
f435570745 Connect axis read to cfg reg
This *should* allow for the axis port to read data the the memory and
transmit the read value to the host via the cfg bus.
2015-01-06 17:13:34 -05:00
Berin Martini
7e6ecfbb22 Auto assign address to HP0
Done in the "Address Editor" tab via the Block Design.
2015-01-06 16:14:53 -05:00
Berin Martini
c31b303289 Add app to read raw /dev/mem for debugging
This allows for direct access by the host to the same memory region as the AXIS
ports are accessing. Should be useful for debugging.
2015-01-05 18:05:31 -05:00
Berin Martini
624e40c03e Connect axis wr port to cfg registers
For debug purposes the axis is connected to the cfg registers so data
patterns can be written to the system memory.
2015-01-04 19:36:02 -05:00
Berin Martini
04f7ccd2a2 Instantiate axis module & attache to HP0
Setup as a simple loopback system.
2015-01-03 05:21:13 -05:00
Berin Martini
e881359f25 Connect HP0 to zedboard top file
Currently not doing anything.
2015-01-02 20:23:57 -05:00
Berin Martini
72bb1b73c6 Add High Performance port to zedboard_axis project
Make this port external to the design and thus accessible to the project
top file.
2015-01-02 17:32:39 -05:00
Berin Martini
d9d8540a6c Add axis and related modules
The axis module instantiates the AXI read and write path modules. It
performs a simple stream over the AXI port interface with no error
checking. It is configured by first addressing the module and then
sending a physical memory address and the number of streaming words to
be written.

The streaming interface is not exactly like the Xilinx stream interface
in that the data is always valid when the valid flag is high, the ready
flag being low does not invalidate the data but is used to signal up
stream to stop sending data. Down stream has a buffer able to absorb to
incoming valid data until such time as up stream stop sending.
2015-01-02 17:32:39 -05:00
Berin Martini
3370f1bd32 Add bash script to run testbenchs
This script copies all Verilog file from the hdl directories into a
'sim' directory. It then uses the Icarus Verilog simulator to run the
desired modules testbench.
2015-01-02 17:32:39 -05:00
Berin Martini
ac07bb9114 Add synchronous FIFO & testbench
A simple FIFO, with synchronous clock for both the pop and push ports.
2015-01-02 17:32:39 -05:00
Berin Martini
8a62d2ba82 Bug fix: axi4lite_cfg port list definition 2015-01-02 17:31:35 -05:00
Berin Martini
8082ee8df7 Tab completion script for zynq-axis repo scripts
Move the "util/zynq-axis-completion.bash" file into your home directory
and save it as a 'dot' file. Then add the code snippet in the header of
the file into your dot bashrc file.
2015-01-02 13:03:51 -05:00
Berin Martini
8c202b969e Merge branch 'hardware-project'
Add a Zedboard hardware project that implements a register loopback that
can be used to test the current driver and library.
2015-01-01 21:47:44 -05:00
Berin Martini
c9bef3cda3 Add module to decode AXI4 Lite bus
The module copies the protocol responses/handling from a Xilinx example.
As such it works but to my eye does not look very efficient.
2015-01-01 21:42:38 -05:00