Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Type Cast SGL

I am using a DMA to pass data up and down between my FPGA and my RT (cRIO).  I made the DMA data type a U64.  My intent was to use 16 bits for a command ID, another 16 bits for a signal ID, and then make the lower 32 bits the data.  My data is supposed to be passed around as a SGL and then converted into the Fixed-Point inside of the FPGA (which I was told was more efficient).  The problem I have ran into is that I have no way to type cast the SGL into a U32 to then be joined with my message.

 

I did manage to make an IP node based on the example given here.  But that just seems like a kludge to me.  There has got be be a better way.  Anybody know of a better way?  All I really want is to reinterpret the bits as a U32.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 1 of 7
(6,191 Views)

I've only done this with the VHDL provided by Dragis here: http://forums.ni.com/t5/LabVIEW/Flatten-floating-point-on-FPGA-for-multichannel-DMA/m-p/2576179#M776...

While it's slightly different HDL, it's the exact same thing you're trying to avoid here...

 

To the best of my knowledge, it's not a language feature available on the palettes anywhere. I also don't see it on the idea exchange yet.

Cheers!

TJ G
0 Kudos
Message 2 of 7
(6,189 Views)

@T-REX$ wrote:

I also don't see it on the idea exchange yet.


It is now.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(6,182 Views)

I needed U32 to typecset to SGL type DMA channel.

I had to created this IP code:

https://decibel.ni.com/content/docs/DOC-26569

 

you needed same only in opposite way

 

I am working for your Idea

0 Kudos
Message 4 of 7
(5,959 Views)

Yeah, we did find that one as well.  We went with the code by Dragis since it was written to be a little more generic.  Still not happy that we have to go with an IP node for something that should take 0 gates.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(5,958 Views)

Hi, Having the same issue, I've found this archived note ( Using Fixed-Point Data Types with Integer-Based IP in LabVIEW FPGA 8.5.x and 8.6.x ). 

 

I think this may less kludge.

0 Kudos
Message 6 of 7
(4,634 Views)

@El-MDA wrote:

Hi, Having the same issue, I've found this archived note ( Using Fixed-Point Data Types with Integer-Based IP in LabVIEW FPGA 8.5.x and 8.6.x ). 

 

I think this may less kludge.


 

The problem with that is that you have to coerce the SGL to a FXP.  I wanted to put my SGL directly into my message, which was a U64 sent over a DMA FIFO.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(4,612 Views)