M
mamu
Hi,
when i simulate the following code I see that clk1 and clk2 are not
the same clk nets and therefore reg2 takes the value of reg1 at what
looks to be the some rising edge. I can understand the result of the
simulation if it is correct that clk2 should be delayed by one delta
cycle. But in my mind clk1 and clk2 are the same net and the
simulation does not match the expected result of the circuit
described.
So, does the simulator interpret the VHDL code correctly and is this
is a case where a functional simulation will always give a mismatch
with hardware?
architecture rtl of test is
signal clk1 : std_logic := '0';
signal clk2 : std_logic := '0';
signal reg1 : std_logic := '0';
signal reg2 : std_logic;
begin
clk1 <= not clk1 after 10 ns;
clk2 <= clk1;
pSync1 : process (clk1) is
begin
if rising_edge(clk1) then
reg1 <= not reg1;
end if;
end process pSync1;
pSync2 : process (clk2) is
begin
if rising_edge(clk2) then
reg2 <= reg1;
end if;
end process pSync2;
end architecture rtl;
when i simulate the following code I see that clk1 and clk2 are not
the same clk nets and therefore reg2 takes the value of reg1 at what
looks to be the some rising edge. I can understand the result of the
simulation if it is correct that clk2 should be delayed by one delta
cycle. But in my mind clk1 and clk2 are the same net and the
simulation does not match the expected result of the circuit
described.
So, does the simulator interpret the VHDL code correctly and is this
is a case where a functional simulation will always give a mismatch
with hardware?
architecture rtl of test is
signal clk1 : std_logic := '0';
signal clk2 : std_logic := '0';
signal reg1 : std_logic := '0';
signal reg2 : std_logic;
begin
clk1 <= not clk1 after 10 ns;
clk2 <= clk1;
pSync1 : process (clk1) is
begin
if rising_edge(clk1) then
reg1 <= not reg1;
end if;
end process pSync1;
pSync2 : process (clk2) is
begin
if rising_edge(clk2) then
reg2 <= reg1;
end if;
end process pSync2;
end architecture rtl;