I
Ilya Kalistru
Guest
Good day.
I came across a strange behavior in my project and can't understand it. Maybe you could explain it to me.
I've reduced it to the point where it still persists.
I've tried to ask on the xilinx forum
but it looks like that that forum more engaged to help me avoid that problem then explain what is going on here...
Here is the code
entity test is
Port (
Clock : in std_logic;
Dev_Linked : in std_logic_vector(0 downto 0);
R_CHCS : out std_logic_vector(1 downto 0):="01"
);
end entity test;
architecture Behavioral of test is
begin
R_CHCS_proc : process (Clock) is
begin
if rising_edge(Clock) then
for i in 0 to 0 loop
R_CHCS(i * 2) <= '0';
end loop;
end if;
end process R_CHCS_proc;
R_CHCS(1) <= Dev_Linked(0) when rising_edge(Clock);
end Behavioral;
On the first clock cycle R_CHCS becomes "X0". And I don't know why. On Xilinx forum say that "Questa also gives the same output" and it's not a bug of the simulator and it's because each process makes it's own driver for CHCS and it gives 'X' value. But it doesn't make sense for me because if I remove unnecessary loop in R_CHCS_proc this problem disappears, and it is nothing to do with processes.
Maybe someone could explain this to me?
I came across a strange behavior in my project and can't understand it. Maybe you could explain it to me.
I've reduced it to the point where it still persists.
I've tried to ask on the xilinx forum
but it looks like that that forum more engaged to help me avoid that problem then explain what is going on here...
Here is the code
entity test is
Port (
Clock : in std_logic;
Dev_Linked : in std_logic_vector(0 downto 0);
R_CHCS : out std_logic_vector(1 downto 0):="01"
);
end entity test;
architecture Behavioral of test is
begin
R_CHCS_proc : process (Clock) is
begin
if rising_edge(Clock) then
for i in 0 to 0 loop
R_CHCS(i * 2) <= '0';
end loop;
end if;
end process R_CHCS_proc;
R_CHCS(1) <= Dev_Linked(0) when rising_edge(Clock);
end Behavioral;
On the first clock cycle R_CHCS becomes "X0". And I don't know why. On Xilinx forum say that "Questa also gives the same output" and it's not a bug of the simulator and it's because each process makes it's own driver for CHCS and it gives 'X' value. But it doesn't make sense for me because if I remove unnecessary loop in R_CHCS_proc this problem disappears, and it is nothing to do with processes.
Maybe someone could explain this to me?