I’m sorry, I can find the following way of writing in the examples I used on the Internet #pragma HLS INTERFACE s_axilite port=a
But in my rough understanding, this can only accept numbers, my main question is, I want the matrix to be the input, how should I write it? Sorry, I can’t find the answer from your teaching
You can’t (easily) use AXI lite. With AXI lite you have to write all the data you want to transfer to registers. Depending on the size of your array, you may reach a limit for the number or registers you can have. This is also slow and inefficient and should not be used for transferring arrays.
AXI lite is generally only used for reading/writing control and status data.
The easiest way to implement your design (in my opinion) is to change the a,b, and c ports to AXI STREAM, then add a DMA to manage the data transfer.
Thank you for your reply, we based on the teaching of your reply,
It is found that the “AXI4-Stream Data FIFO” link will conflict with the input and output interface we designed (sda), so we refer to another link
, there is no “AXI4-Stream Data FIFO” in this teaching, which can make “sda” connect to the input and output of DMA smoothly (Fig.1), but according to this teaching to the end we have the following two serious warnings (Fig.2).
You have a data width mismatch between your IP and the DMA. It looks like you set the DMA width to 32 bits but the output from your IP is 16 bits. You can change the width of the DMA, or use an AXI interconnect to convert from 16-bit to 32-bit. Changing the width in the DMA is simpler.
You can find the settings for this in the “DMA read and write channels” in the DMA tutorial
Regarding the issue of TLAST, we have tried to use your code, but it seems that the code is only applicable to .cpp files, but our design is .c files, and it seems that it cannot be written in c language.
Regarding the problem of data width mismatch, we have tried a lot of setting adjustments (Fig.1), but still can’t solve our problem, can you please clarify?
According to the provided link teaching, the current pre-problem of the TLAST program is still stuck (Fig. 1), and three Errors are attached, hoping to help answer
Error: [HLS 207-3337] type ‘hls::stream<ap_axis<32, 2, 5, 6>>’ (aka 'stream<hls::axis<ap_int<32>, 2, 5, 6>> ’ ) does not provide a subscript operator (Fig. 2) (Fig. 3)
I’m really embarrassed to ask so much, but I really want to understand this,
I’m not quite sure why they don’t work, aren’t they simply “equals”?
In addition, what is the tmp of “ap_axis<32,2,5,6> tmp;” in the program? I look like it is our input data, how did it actually introduce it?
But we have really tried many times about the writing method of read&write, but the Errors have not changed so far. Do you have more relevant information for reference? I have tried everything that I can find and it does not match us. Do you have more suggestions?
Our input is a 1x28 vector, and the output is a 4x4 matrix. Is there a way to pass it in smoothly? We have really tried many methods.
p.s. The program in the figure wants to split the input into two matrices [1x16] [1x12].
If you use ap_axis<32, 2, 5, 6>, this is a 32-bit number with 2 integer bits. , and 30 fractional bits. If you then convert this number to a float, you will lose something in the conversion. If you then do your calculation, and take the result (float) and convert back to the fixed point, you will lose something again.
You probably have other issues with you code, but rather than debug this whole application (or optimize it for HLS) I suggest you start with a simple example, get the interfaces correct and make sure you understand them, and the add your code to the body of the example.