So, I recently inherited some VHDL code, and my first reaction was, "VHDL has structs, why do they use bit-vectors everywhere?" And then I realized this is because there does not seem to be any way to write anything like this:
entity Queue is
generic (
EL : type
);
port (
data_in : EL;
data_out : EL;
...
);
end entity Queue;
I really wish this were possible. Is there anything even remotely approximating it? Even if I have to retype the entity or component declarations, just some way to avoid retyping the architecture definition for every (modulo a generic width) type?
Yes, and implementing a Queue is one of the classic reasons to do it!
This has been in VHDL since VHDL-2008. Tool support is variable as of mid-2012. Talk about a slow-moving industry!