I'm trying to create a record that can hold data of different types, would that be possible in some way using VDHL 2008's generic typing feature? I'm not trying to synthesize that code.
My test setup looks like this:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
entity dynrec is
end entity dynrec;
architecture dyn of dynrec is
type dynrec is record -- this is a test record
datatype : type; -- type of the data field
data : datatype;
someval : natural;
end record dynrec;
signal testsig1, testsig2 : dynrec;
begin -- architecture dyn
testsig1 <= (datatype => real, data => 5.0, someval => 12);
testsig2 <= (datatype => std_logic, data => '1', someval => 12);
end architecture dyn;
You see, what I'm trying to do is have a record that can hold different types of data depending on one of it's fields. However, it fails at compile time with the following error:
# ** Error: dynrec.vhd(13): near "type": expecting STRING or IDENTIFIER or << or '('
# C:/Programme/Mentor/Modelsim10.0b/win32/vcom failed.
is there a way to make something like this work?
I'm using mentorgraphics modelsim 10.0b, and I compiled using vcom dynrec.vhd -2008
.