Go Back   Velocity Reviews > General Computer Discussion > Hardware
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 04-25-2009, 11:53 AM   #1
Question constants as of array of integers, for loops


I have been searching around for more than a day intensively but I was unable to find any answer. I am having a problem with constants substitution in VHDL and I have no idea why.

I have a package where I defined a constant as an array of integers with the index from ( 0 downto 0). The constant I am talking about is g_nr_of_ahb_masters and is the last one in the post below.

Code:
package utel_crc_ccu_config_pkg is constant g_nr_of_base_clks : integer := 1; subtype ccu_base_clk_cfg_cell_type is array_of_integer_type(g_nr_of_base_clks-1 downto 0); type ccu_base_clk_cfg_array_type is array (integer range <>) of ccu_base_clk_cfg_cell_type; constant g_base_clk_cfg_array : ccu_base_clk_cfg_array_type (0 to 2) := ( (0 => 3) , (0 => 0) , (0 => 0) ); ... constant g_nr_of_ahb_masters : ccu_base_clk_cfg_cell_type := g_base_clk_cfg_array(2);

As can be seen g_nr_of_ahb_masters(0) is equal with 0

The tricky part is that I am using this constant in a process statement where for loops are defined as shown below

Code:
mux_proc : process (ahb_master_auto_int, branch_clk_int, hclken_int, gated_clk_override_int) begin for i in 0 to g_nr_of_base_clks-1 loop if (g_nr_of_ahb_masters(i) > 0) then -- it goes here WHY?????? since g_nr_of_ahb_masters(0) is 0, isn't it end if; end loop; end process mux_proc;

When parsing this code it tries to go inside the "if" statement but it should avoid it.

If I replace g_nr_of_ahb_masters(i) with g_nr_of_ahb_masters(0) it does not go inside the "if" anymore.

What am I doing wrong?
Thank you in advance for any answers,
Octavian


octavsly
octavsly is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL and EDK: Custom IP core containing an array as a port using EDK allsey_1987 Hardware 0 10-27-2009 02:26 PM
Array Programme rits Software 2 03-04-2009 05:18 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46