Altera_Forum
Honored Contributor
14 years agohow to declare dynamic port size depending on generic
Hi, Can anyone tell me how to declare a port with its size determine by a generic in VHDL?
For example: ENTITY tone_det IS generic(FRAME_SIZE: integer := 63; .....); PORT( OUTPUT : std_logic_vector (5 downto 0); ......); END tone_det; ------------------------------------------------------ Here, the OUTPUT has a fixed size of 5 because 2^6-1=63. 63 is the frame size...but how to declare this dynamically? so everytime I change my generic (in a higher level design file), this OUTPUT size will be changed accordingly? For example, if generic is defined as 127, then the bus width should be 6 Thanks