Simulating clock drift

B

bwilson79

I'm trying to simulate drift between two clocks in my simulation and
seeing some behavior that I cannot explain. It is an 80MHz clock, so
the expected period is 12.5ns. However, I'm seeing a period of
12.501ns in the simulation. Please see the code snippet below:

GenDifferentClocks : if (USE_DIFFERENT_CLOCKS = TRUE) generate
constant DRIFT_RES : time := 1 ps;
subtype DelayRange is time range 0 ps to 12.5 ns;
signal t_delay : time := 0 ps;
signal clk_drifted : std_logic;
begin
process (clk)
begin
if rising_edge(clk) then
if (t_delay = DelayRange'high) then
t_delay <= DelayRange'low;
else
t_delay <= t_delay + DRIFT_RES;
end if;
end if;
end process;
clk_drifted <= transport clk after t_delay;
end generate GenDifferentClocks;
 
B

bwilson79

I'm trying to simulate drift between two clocks in my simulation and
seeing some behavior that I cannot explain. It is an 80MHz clock, so
the expected period is 12.5ns. However, I'm seeing a period of
12.501ns in the simulation. Please see the code snippet below:

GenDifferentClocks : if (USE_DIFFERENT_CLOCKS = TRUE) generate
constant DRIFT_RES : time := 1 ps;
subtype DelayRange is time range 0 ps to 12.5 ns;
signal t_delay : time := 0 ps;
signal clk_drifted : std_logic;
begin
process (clk)
begin
if rising_edge(clk) then
if (t_delay = DelayRange'high) then
t_delay <= DelayRange'low;
else
t_delay <= t_delay + DRIFT_RES;
end if;
end if;
end process;
clk_drifted <= transport clk after t_delay;
end generate GenDifferentClocks;

Nevermind... I think I figured out what was going on. =)
 

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,888
Messages
2,569,964
Members
46,294
Latest member
HollieYork

Latest Threads

Top