- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello to everyone,
I fpga and vhdl begginer and I am currently working on university project which concerns some array calculations on Cyclone V fpga and VHDL and I have a problem. All custom made types are defined in package and also array dimensions are defined there too and this package is included in all .vhd files because these custom types are used as ports for some entities. The problem starts when I try to extract array dimensions out of package, as generic for top-level entity. I have found here some previous posts that I have modified into this: type myArray is array(natural range <>) of std_logic_vector; but this still does not work and later during instantiation of an component, quartus reports an error that unconstrained arrays are not allowed so it won't connect all necessary components. Can anyone help me to achieve all things related to generic parameters and how to avoid this problem? Regards, AlLink Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set the VHDL mode to 2008. Unconstrained array types (where the element type is unconstrained) are only supported from 2008.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help but code still cannot be compiled. I managed to avoid one constraint but I think that the other makes problem now, the one that concerns size of a std_logic_vector.
Idea was to have a variable length of an array and variable size of an vector, so is there any chance to solve this too?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
can you post the code? Unconstrained types are allowed, but signals must be constrained when they are declared.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In couple of following lines are given component declarations and "problematic" signal that port maps these components:
* this is custom type from package: type Vector_aray is array(natural range <>) of std_logic_vector; * this is first component: component Main is generic ( BITS : integer; CORE : integer ); port ( clock : in std_logic; in_data : in Vector_aray(CORE-1 downto 0); avg : in integer; out_data : out std_logic_vector ((BITS-1) downto 0) ); end component Main; * this is second component: component BLOCKS is generic ( BITS : integer; CORE : integer ); port ( clock : in std_logic; reset : in std_logic; data_in : in std_logic_vector ((BITS-1) downto 0); dout_line : out Vector_aray(CORE-1 downto 0) ); end component BLOCKS; * this is signal that connects stated arrays: signal sLine : Vector_aray(CORE-1 downto 0);- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the problem is you didnt constrain the 2nd dimension - the std_logic_vector
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page