campo85
Newbie level 5
- Joined
- Apr 24, 2012
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,341
Hi all, I have a problem. I have coded a vhdl module with some generics to parameterized the design based on width bus. In the design I have a counter and I need to stop the counter when it has achieved the half value. So, I've declared a constant but Active HDL gives me an error. I declared the constant in this way :
the error is :
I've also tried to declare in this way :
But I get :
Can someone give me some tips ? Thanks for any reply.
Kind regards.
Code:
constant LENGTH_COUNTER : integer := integer(ceil(log2(real(WIDTH_MULTIPLIER))));
constant STOP_COUNTER : std_logic_vector(LENGTH_COUNTER downto 0) := (LENGTH_COUNTER => '1', others => '0');
signal counter : std_logic_vector( LENGTH_COUNTER downto 0);
the error is :
# Error: COMP96_0597: modular_exponetiantiation.vhd : (42, 72): Aggregate with multiple choices has a non-static or null choice. Use -relax to compile aggregates composed of one non-static or null choice and choice others.
I've also tried to declare in this way :
Code:
constant LENGTH_COUNTER : integer := integer(ceil(log2(real(WIDTH_MULTIPLIER))));
constant STOP_COUNTER : std_logic_vector(LENGTH_COUNTER downto 0) := (LENGTH_COUNTER => '1', LENGTH_COUNTER-1 downto 0 => '0');
signal counter : std_logic_vector( LENGTH_COUNTER downto 0);
But I get :
# Error: COMP96_0349: modular_exponetiantiation.vhd : (42, 72): Aggregate with multiple choices has a non-static or null choice.
# Error: COMP96_0349: modular_exponetiantiation.vhd : (42, 95): Aggregate with multiple choices has a non-static or null choice.
Can someone give me some tips ? Thanks for any reply.
Kind regards.