- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all
My design requires a parameter defined at compilation time that can range from 1 to 128 bytes. It isn't possible to create a generic based on another generic like this: generic (es_size : natural range 1 to 128 := 2;
es_info : bidim_array_t(es_size-1 downto 0) := (x"00",x"00"));
) Where bidim_array_t is defined inside a package: type bidim_array_t is array(natural range <>) of std_logic_vector(7 downto 0); With this code Quartus reports the following error: ***generic "es_size" cannot be used in its own interface list*** Removing the es_size and fixating the size of es_info to 128 could be one solution but I would like to know if there is anything more elegant to do in this case. Thank you Best regards Thiago
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Hi all My design requires a parameter defined at compilation time that can range from 1 to 128 bytes. It isn't possible to create a generic based on another generic like this: generic (
es_size : natural range 1 to 128 := 2;
es_info : bidim_array_t(es_size-1 downto 0) := (x"00",x"00"));
) Where bidim_array_t is defined inside a package: type bidim_array_t is array(natural range <>) of std_logic_vector(7 downto 0); With this code Quartus reports the following error: ***generic "es_size" cannot be used in its own interface list*** Removing the es_size and fixating the size of es_info to 128 could be one solution but I would like to know if there is anything more elegant to do in this case. Thank you Best regards Thiago --- Quote End --- I think generic should be a constant so that compiler knows what to do. Your second declaration of bidim_array should be an input

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