A
arkaitz
Guest
Hi,
I have some problems when using two clock domains in my design.
My main clock works at a frequency of 60 Mhz. The clock port is routed
to the input port of the internal DLL which provides two clock
sources, one of the same frequency (60 Mhz) and the other of 20Mhz.
There is a rising edge detector FF excited with 20 Mhz clock
re_detect:
block is
signal aux : std_logic;
begin
process( rst, clk_20 )
begin
if ( rst = '1' ) then
aux <= '0';
elsif ( clk_20 = '1' and clk_20'event ) then
aux <= input;
end if;
end process;
re_edge <= not(aux) and input;
Note: the input is synchronized to avoid glitches and metastability.
Then I have another FF whose set and reset are separate conditions
that is
excited with 60 Mhz clock.
process ( rst, clk_60 )
begin
if ( rst = '1' ) then
out <= '0';
elsif ( clk_60'event and clk = '1' ) then
if ( input = '1' ) then
out <= '1';
end if;
if ( re_edge = '1' ) then
out <= '0';
end if;
end if;
end process;
I have simulated functionally the design with Modelsim 5.6f and I see
that "out" signal doesn´t become low when "re_edge" is active. Note
that the if clauses are writen in such way so that the reset condition
has the biggest priority.
This might be because the "re_edge" signal is a 0 ps wide pulse, I
mean is asserted and dessaserted in the same simulation step and in
the same time with the rising edge of the clock signal.
I don't know certainly why, but I believe that it can be because I use
the DLL. I have created the same design using a clock divider instead
of a DLL and it works but there are several differences in the
functional simulation:
- "re_edge" signal is a clk_20 period wide signal instead of a glitch
- "aux" signal is asserted 1 clk_20 period later than the "input"
signal
Anybody any suggestion?
Thanks in advance,
Arkaitz
-------------------------------
Ikerlan
Electronics Area
Pş J. M. Arizmendiarrieta, 2
20500 Arrasate (Gipuzkoa)
-------------------------------
I have some problems when using two clock domains in my design.
My main clock works at a frequency of 60 Mhz. The clock port is routed
to the input port of the internal DLL which provides two clock
sources, one of the same frequency (60 Mhz) and the other of 20Mhz.
There is a rising edge detector FF excited with 20 Mhz clock
re_detect:
block is
signal aux : std_logic;
begin
process( rst, clk_20 )
begin
if ( rst = '1' ) then
aux <= '0';
elsif ( clk_20 = '1' and clk_20'event ) then
aux <= input;
end if;
end process;
re_edge <= not(aux) and input;
Note: the input is synchronized to avoid glitches and metastability.
Then I have another FF whose set and reset are separate conditions
that is
excited with 60 Mhz clock.
process ( rst, clk_60 )
begin
if ( rst = '1' ) then
out <= '0';
elsif ( clk_60'event and clk = '1' ) then
if ( input = '1' ) then
out <= '1';
end if;
if ( re_edge = '1' ) then
out <= '0';
end if;
end if;
end process;
I have simulated functionally the design with Modelsim 5.6f and I see
that "out" signal doesn´t become low when "re_edge" is active. Note
that the if clauses are writen in such way so that the reset condition
has the biggest priority.
This might be because the "re_edge" signal is a 0 ps wide pulse, I
mean is asserted and dessaserted in the same simulation step and in
the same time with the rising edge of the clock signal.
I don't know certainly why, but I believe that it can be because I use
the DLL. I have created the same design using a clock divider instead
of a DLL and it works but there are several differences in the
functional simulation:
- "re_edge" signal is a clk_20 period wide signal instead of a glitch
- "aux" signal is asserted 1 clk_20 period later than the "input"
signal
Anybody any suggestion?
Thanks in advance,
Arkaitz
-------------------------------
Ikerlan
Electronics Area
Pş J. M. Arizmendiarrieta, 2
20500 Arrasate (Gipuzkoa)
-------------------------------