kostbill
Full Member level 1
Hello. I am a newbie in FPGA and VHDL in general.
I am using microblaze in a spartan3e. I want to implement a peripheral with OPB (I am using OPB because I want to use DMA also). The microblaze will have a floating point unit. I don't know yet how efficient this is.
The peripheral will take a serial format (I2S) as an input from an external audio IC. The I2S will give me the values I need in a 16 bit signed number format.
I want to implement in the peripheral the functionality of converting this 16 bit signed value to a 32 bit floating point number.
So, my questions are these:
1. The "to_float" conversion will work on synthesis and will work on the FPGA? If not, can you guide me to a common way, used to do these things?
2. After the conversion, I will have a 32 bit number. Now, the way I understand it, I will have to pass the value to the OPB FIFO. But the FIFO can accept values declared as float? Or should I do something else? For example, is there a way to keep the same bits but make the floating point number appear as a "std_logic_vector(31 downto 0)" ? If I try to do it in the way of assigning each bit of my float in the std_logic_vector, will it work?
3. So, when this number finally goes into the memory, I will take it in C and write a simple union with a 32 bit integer and a float and read the float. Do you know if this works in the Xilinx compiler? If no, do you have any ideas that can help me?
Thank you very much for any help.
Bill.
I am using microblaze in a spartan3e. I want to implement a peripheral with OPB (I am using OPB because I want to use DMA also). The microblaze will have a floating point unit. I don't know yet how efficient this is.
The peripheral will take a serial format (I2S) as an input from an external audio IC. The I2S will give me the values I need in a 16 bit signed number format.
I want to implement in the peripheral the functionality of converting this 16 bit signed value to a 32 bit floating point number.
So, my questions are these:
1. The "to_float" conversion will work on synthesis and will work on the FPGA? If not, can you guide me to a common way, used to do these things?
2. After the conversion, I will have a 32 bit number. Now, the way I understand it, I will have to pass the value to the OPB FIFO. But the FIFO can accept values declared as float? Or should I do something else? For example, is there a way to keep the same bits but make the floating point number appear as a "std_logic_vector(31 downto 0)" ? If I try to do it in the way of assigning each bit of my float in the std_logic_vector, will it work?
3. So, when this number finally goes into the memory, I will take it in C and write a simple union with a 32 bit integer and a float and read the float. Do you know if this works in the Xilinx compiler? If no, do you have any ideas that can help me?
Thank you very much for any help.
Bill.