warning: vcom-1186

J

JK

Hi,

I was trying example of Peter Ashenden VHDL book:

library IEEE;
use IEEE.std_logic_1164.ALL;
use IEEE.numeric_std.ALL;

entity full_adder is
port (
a, b, c_in : in bit;
c_out, sum : out bit
);
end entity full_adder;

architecture truth_table of full_adder is
begin

with bit_vector'(a, b, c_in) select
(c_out, sum) <= bit_vector'("00") when "000",
bit_vector'("01") when "001",
bit_vector'("01") when "010",
bit_vector'("10") when "011",
bit_vector'("01") when "100",
bit_vector'("10") when "101",
bit_vector'("10") when "110",
bit_vector'("11") when "111";

end architecture truth_table;

vcom -2002 -explicit -work practice full_adder.vhd
#Model Technology Modelsim SE vcom 6.3 Compiler 2007.05 May 4 2007
# -- Loading package standard
# -- Loading package std_logic_1164
# -- Loading package numeric_std
# -- Compiling entity full_adder
# -- Compiling architecture truth_table of full_adder
# ** Warning: full_adder.vhd(15): (vcom-1186) Array type selected
signal assignment expression must be of a locally static subtype.


Why warning??? What does this locally static subtype mean??

Regards,
JK
 
Joined
May 4, 2007
Messages
49
Reaction score
0
If you haven't already noticed, Modelsim has some pretty cruddy bugs in it. I would suggest using another simulator, such as Aldec Active-HDL. Using that particular simulator gives no warnings with your code. However, if you must use Modelsim change your 'with' (selection) to a static bit_vector (x) as I show below. I'm not sure why the warning is there except that Modelsim has some problems.

library IEEE;
use IEEE.std_logic_1164.ALL;
use IEEE.numeric_std.ALL;

entity velocity_reviews2 is
port (
a, b, c_in : in bit;
c_out, sum : out bit
);
end entity velocity_reviews2;

architecture truth_table of velocity_reviews2 is

signal x : bit_vector(2 downto 0);
begin

x <= a & b & c_in;

with x select
(c_out, sum) <= bit_vector'("00") when "000",
bit_vector'("01") when "001",
bit_vector'("01") when "010",
bit_vector'("10") when "011",
bit_vector'("01") when "100",
bit_vector'("10") when "101",
bit_vector'("10") when "110",
bit_vector'("11") when "111";


end architecture truth_table;

Scott
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top