fmaximovic
Junior Member level 2
Hi all,
one of my VHDL modules produces "X" values even with the slowest clock; there were no problems with its behavioral simulation though.
Here's the code; basically it's an adder (it sums its single data input A2 to a constant FO1 after reshaping A2 into the variable A1) whose output is forced to 0 if the result is negative
Interestingly enough, if I comment the section between "---- from here" and "---- to here" in the above code, no X values result in the timing simulation.
Any suggestions?
Thank you!
PS: My UCF file is made up by the following line
one of my VHDL modules produces "X" values even with the slowest clock; there were no problems with its behavioral simulation though.
Here's the code; basically it's an adder (it sums its single data input A2 to a constant FO1 after reshaping A2 into the variable A1) whose output is forced to 0 if the result is negative
Code:
entity FUE is
port(
CLK : in std_logic;
RESET : in std_logic;
EN : in std_logic; -- enable
A2 : in std_logic_vector(8 downto 0);
SUB12 : out std_logic_vector(7 downto 0)
);
end FUE;
architecture BEHAVIORAL of FUE is
constant FO1: std_logic_vector (7 downto 0):= "00001010";
begin
AWS_P : process (CLK,RESET)
variable A1 : std_logic_vector(7 downto 0);
variable AWS_TMP : std_logic_vector(7 downto 0);
variable CONT0 : std_logic;
begin
if RESET='1' then
SUB12<=(others=>'0');
elsif (CLK'event and CLK='1') then
if EN='1' then
A1:=A2(8) & A2(8 downto 2);
if (A1(7) ='0') then
AWS_TMP := conv_std_logic_vector(conv_integer(FO1) - conv_integer(A1),8);
else
AWS_TMP := conv_std_logic_vector(conv_integer(FO1) + conv_integer(A1),8);
end if;-
CONT0:=AWS_TMP(7); ------------------------ from here
if (CONT0='1') then
SUB12 <= "00000000";
else
SUB12 <= AWS_TMP(7 downto 0);
end if;----------------------------------------- to here
end if;
end if;
end process;
end BEHAVIORAL;
Interestingly enough, if I comment the section between "---- from here" and "---- to here" in the above code, no X values result in the timing simulation.
Any suggestions?
Thank you!
PS: My UCF file is made up by the following line
Code:
NET "CLK" PERIOD = 4 ns HIGH 50%;