Why is this not a locally static choice?

C

Charles M. Elias

In the following code fragment Active-HDL flagged the "case oe_l is" line as an
error because oe_l is not locally static. Why is this so? "numbuffs" is
not going to change during execution.

Best regards,

Charles

------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.all;
------------------------------------------------------------------------
entity BiDir is
generic( bufflength : natural := 8;
numbuffs : natural := 4 );
port ( oe_l : in std_logic_vector( 0 to numbuffs - 1 );
a : inout std_logic_vector( bufflength - 1 downto 0 );
b0 : inout std_logic_vector( bufflength - 1 downto 0 );
b1 : inout std_logic_vector( bufflength - 1 downto 0 );
b2 : inout std_logic_vector( bufflength - 1 downto 0 );
b3 : inout std_logic_vector( bufflength - 1 downto 0 );
dirab : in std_logic
);
end BiDir;
------------------------------------------------------------------------
architecture archBiDir of BiDir is

begin
pio : process( oe_l, dirab, a, b0, b1, b2, b3 )
begin
case oe_l is
when "0111" =>
if dirab = '1' then
a <= ( others => 'Z' );
b0 <= a;
else
...
 
E

Egbert Molenkamp

Since you have used a generic for numbuffs you can instantiate multiple
entities of BiDir with different values for the generic. Therefore it is not
'locally' static.

If you change the line:
oe_l : in std_logic_vector( 0 to numbuffs - 1 );
in
oe_l : in std_logic_vector( 0 to 3 );
it will work.

Notice also that the line:
case oe_l is
when "0111" =>
Would give an error if the generic numbuffs is not equal to 4.

Egbert Molenkamp
 
C

Charles M. Elias

Egbert Molenkamp said:
Since you have used a generic for numbuffs you can instantiate multiple
entities of BiDir with different values for the generic. Therefore it is not
'locally' static.

If you change the line:
oe_l : in std_logic_vector( 0 to numbuffs - 1 );
in
oe_l : in std_logic_vector( 0 to 3 );
it will work.

Notice also that the line:
case oe_l is
when "0111" =>
Would give an error if the generic numbuffs is not equal to 4.

Egbert Molenkamp

Egbert,

Thanks!

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top