I want to convert a real number to his bit representation, with the fields of sign, exponent and mantissa in a VHDL TB for testing purposses (as a STD_LOGIC_VECTOR of 32 bits). Is there anyway to convert a real number to this representation directly in VHDL?
I know that in C is possible use a struct to achieve it, but I don't know if it's possible in VHDL.
Thank you.
Edit:
I've found this solution:
https://www.edaplayground.com/x/gQiN
But the synthesizer throw this error:
[XSIM 43-4187] File "/proj/xbuilds/2021.2_INT_0504_1926/installs/all_platforms/Vivado/2021.2/data/vhdl/src/ieee_2008/float_pkg.vhdl" Line 45 : The "Vhdl 2008 Package Instantiation Declaration" is not supported yet for simulation.
Then, I think the best solution is build a VHDL function that convert a real number to their IEEE-754 bit representation.