Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHere is an excerpt from the package:
-- Constants defining the maximum resolutions constant MAX_INPUT_HORIZ_RESOLUTION : positive := 320; constant MAX_INPUT_VERT_RESOLUTION : positive := 240; constant MAX_OUTPUT_HORIZ_RESOLUTION : positive := 640; constant MAX_OUTPUT_VERT_RESOLUTION : positive := 480; constant MAX_HORIZ_RESOLUTION : positive := Maximum(MAX_INPUT_HORIZ_RESOLUTION, MAX_OUTPUT_HORIZ_RESOLUTION); constant MAX_VERT_RESOLUTION : positive := Maximum(MAX_INPUT_VERT_RESOLUTION, MAX_OUTPUT_VERT_RESOLUTION); -- Ensure that horizontal and vertical coordinates are capable of representing the width -- and height as well as internal coordinates, with a signed representation. constant HORIZ_COORD_BITS : positive := (Min_Bits(MAX_HORIZ_RESOLUTION) + 1); constant VERT_COORD_BITS : positive := (Min_Bits(MAX_VERT_RESOLUTION) + 1); -- Number of fractional bits used in coordinate representation constant COORD_FRACTION_BITS : positive := 2; -- Type definitions for raw coordinates and a point in Cartesian space subtype Horiz_Coord is sfixed((HORIZ_COORD_BITS - 1) downto -COORD_FRACTION_BITS); subtype Vert_Coord is sfixed((VERT_COORD_BITS - 1) downto -COORD_FRACTION_BITS); type Point is record x : Horiz_Coord; y : Vert_Coord; end record; Do you think I can change this to work as an array of record types? Even when the custom types are used to define ports on components?