LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Matrix multiplication - Linear Algebra Matrix Multiply

Solved!
Go to solution

All

I am trying out the matrix multiplication via Linear Algebra Matrix Multiply. Attaching the project where you should see the T_PZ.vi.All I am trying to do is to understand how this works. When I use the VI in FPGA simulation mode, I see weird results - not wrong but repeated numbers out of which a subset is the correct answer. image.png

 

I don't see very many examples on web either. Anybody?


Kudos are the best way to say thanks 🙂
0 Kudos
Message 1 of 10
(2,215 Views)

I would switch the FIFO Write Interface to use Handshaking (it is set to Timeout).  You can then use its output to handshake with the matrix function and remove the case structure.

 

Timeout is not used as much any more (though it is still the default setting).  That reminds me to put that request into the Idea Exchange.


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 2 of 10
(2,164 Views)

Thank you for your reply. Something like this?

 

Capture1.PNGCapture2.PNG 


Kudos are the best way to say thanks 🙂
0 Kudos
Message 3 of 10
(2,151 Views)

That's better.  Next would be to switch the Read FIFO to handshaking mode and read only when Output Valid is true.

 

Get number of elements to read is not being used correctly (see https://zone.ni.com/reference/en-XX/help/371599P-01/lvfpga/fpga_fifo_num_elem_read/).  If you use the handshaking, you do not need this function.  What do you want to do with the data afterwards?


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
Message 4 of 10
(2,142 Views)

I tried that its the same results as previous effort. But a noob question - wouldn't the extra elements point to me writing to FIFO when I shouldn't be writing? 

 

It almost seems like output valid is high for multiple cycles after i get the first valid output and it spews the same redundant result - confused as to why that will happen?


Kudos are the best way to say thanks 🙂
0 Kudos
Message 5 of 10
(2,137 Views)

That's because a valid and b valid keep getting true values coming in. 

 

Check out https://zone.ni.com/reference/en-XX/help/371599P-01/lvfpgaconcepts/fpga_handshaking/ to see more on how handshaking works in a more generic example. The issue you are facing is not specific to the matrix function. 


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
Message 6 of 10
(2,115 Views)
Solution
Accepted by topic author winterishere8

Thank you! 

 

I do understand the idea behind a and b being valid.

But outside of ready for a and ready for b I am not sure what other knobs I have to wire back?

 

I tried this, and it seems to work. 

 

Capture.PNG


Kudos are the best way to say thanks 🙂
0 Kudos
Message 7 of 10
(2,099 Views)

It doesn't make sense to wire "ready for a" into "a valid."

 

Ready for a (or b) gets wired back to the source, the function before the multiply.  Do you know what will replace the control?

 

 


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 8 of 10
(2,082 Views)

It'll be very similar to what i have on here. It'll be a matrix. In this case, I want to pass 2 vectors which grouped together constitute a matrix.


Kudos are the best way to say thanks 🙂
0 Kudos
Message 9 of 10
(2,077 Views)

winterishere8_0-1607612203420.png

 


Kudos are the best way to say thanks 🙂
0 Kudos
Message 10 of 10
(1,967 Views)