legendbb
Member level 1
I was working on some library component.
To make the module generic, signals and ports have variable size, defined by generic at preprocessing time.
It assume it's OK if I have the math inside STD_LOGIC_VECTOR((cSOME_GENERIC - A + B - C) DOWNTO 0);
But the code looks messy, I try to redefine the size derivation as another generic to clean up (ie. (cDERIVED_GENERIC : integer := A+B+C). But it doesn't seem to work.
What's the right technique for doing this in VHDL?
Regards,
To make the module generic, signals and ports have variable size, defined by generic at preprocessing time.
It assume it's OK if I have the math inside STD_LOGIC_VECTOR((cSOME_GENERIC - A + B - C) DOWNTO 0);
But the code looks messy, I try to redefine the size derivation as another generic to clean up (ie. (cDERIVED_GENERIC : integer := A+B+C). But it doesn't seem to work.
What's the right technique for doing this in VHDL?
Regards,