Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Dual Edge Oversampling

Reply
Thread Tools

Dual Edge Oversampling

 
 
ALuPin@web.de
Guest
Posts: n/a
 
      03-08-2007
Hi newsgroup,

As shown in the VHDL code I am feeding two flip flop chains
with the same input. The chains use complementary clocks (200Mhz).

In the process "rise_fall" I do some combinational logic
to detect rising and falling of the sampled input.

Now I want to use one of the combinational signals as a clock
in a process "clksel" to sample the second combinationl signal.

Speaking in terms of functional simulation the function
of the hardware description is the following:
The signal which gets active first
is used for ClockSel.

The output ClockSel is then used to feed a DCS module.

The problem I see in this hardware description is that
the clock in the process "clksel" is a gated clock.

What is your opinion about the desription ? How can
I modify it to make it synthesizable ? Is there some
need for additional constraints ?

Here is the code:


library ieee;
use ieee.std_logic_1164.all;

entity ana is
port( Reset : in std_logic;
Clk : in std_logic;
DataIn : in std_logic;
ClockSel : out std_logic
);
end ana;

architecture arch_ana of ana is

signal r_p1, r_p2, r_p3 : std_logic;
signal f_p1, r_p2, r_p3 : std_logic;

signal trig_rise, trig_fall : std_logic;

begin

------------------------------------
sync_redge: process(Reset, Clk)
begin
if Reset='1' then
r_p1 <= '0';
r_p2 <= '0';
r_p3 <= '0';

elsif rising_edge(Clk) then
r_p1 <= DataIn;
r_p2 <= r_p1;
r_p3 <= r_p2;

end if;
end process sync_redge;

------------------------------------
sync_fedge: process(Reset, Clk)
begin
if Reset='1' then
f_p1 <= '0';
f_p2 <= '0';
f_p3 <= '0';

elsif rising_edge(Clk) then
f_p1 <= DataIn;
f_p2 <= f_p1;
f_p3 <= f_p2;

end if;
end process sync_fedge;

------------------------------------
rise_fall: process(r_p2, r_p3,
f_p2, f_p3)
begin

trig_rise <= ((not r_p3) AND r_p2);
trig_fall <= ((not_f_p3) AND f_p3);

end process rise_fall;

------------------------------------
-- ?????????????????????????????????
clksel: process(Reset, trig_fall)
begin
if Reset='1' then
ClockSel <= '0';

elsif rising_edge(trig_fall) then
ClockSel <= trig_rise;
end if;
end process clksel;


end arch_ana;

 
Reply With Quote
 
 
 
 
ALuPin@web.de
Guest
Posts: n/a
 
      03-08-2007
Some correction: The process sync_fedge
is triggered with "falling_edge(Clk)"

------------------------------------
sync_fedge: process(Reset, Clk)
begin
if Reset='1' then
f_p1 <= '0';
f_p2 <= '0';
f_p3 <= '0';


elsif falling_edge(Clk) then
f_p1 <= DataIn;
f_p2 <= f_p1;
f_p3 <= f_p2;


end if;
end process sync_fedge;


 
Reply With Quote
 
 
 
 
Jim Lewis
Guest
Posts: n/a
 
      03-08-2007
Do you wish to correct the following also:
trig_fall <= ((not_f_p3) AND f_p3);


You need to simulate before you post.

Regards,
Jim
 
Reply With Quote
 
ALuPin@web.de
Guest
Posts: n/a
 
      03-08-2007
Hi Jim,

yes you are right:

The corrected version:
trig_fall <= ((not_f_p3) AND f_p2);

I simulated it but I just simplified the design
to post it, that is why the error crept in.

Sorry.

Rgds
Andre




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lenovo ThinkPad EDGE 13: Bleeding Edge Ian Front Page News 0 02-28-2011 10:18 AM
using both rising edge and falling edge of signal denish VHDL 5 11-17-2008 07:12 PM
NetGear SPH200D dual Dual-mode, Cordless Phone vs Dualphone 3088 dual mode cordless phone Paul NZ Computing 0 05-08-2007 09:06 AM
Boost.graph - changing edge end-points or copying an edge Ferdi Smit C++ 0 10-10-2005 04:30 PM
Odd Oversampling ALuPin VHDL 9 04-20-2005 07:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57