Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Multiple clock domain sync

Status
Not open for further replies.

vintujose

Newbie level 4
Joined
Mar 26, 2008
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,319
Hi I am a new bee
I need to how is the sync between two clock domains is done .
How can i design it using VHDL without using the Async FIFO .

if anybody has a generic code please pass on to me
with regards
kewl
 

Iouri

Advanced Member level 2
Joined
Aug 17, 2005
Messages
682
Helped
87
Reputation
174
Reaction score
8
Trophy points
1,298
Activity points
4,814
PLease use search in this forum, that topic had been addressed few times
 

shnain

Member level 3
Joined
Jan 7, 2007
Messages
66
Helped
11
Reputation
22
Reaction score
9
Trophy points
1,288
Location
Morocco
Activity points
1,632
Hi,

Maybe you already got the answer, but anyway :

To sync a signal coming from another clock domain you can use a double FF synchronizer, for example :

Code:
process(clk, rst)
begin

  if rst = '0' then
    in_sig = '0';

  elsif rising_edge(clk) then
    tmp <= in_sig;
    in_sig_s <= tmp;
  end if;

end process;


where in_sig is the input signal to be synchronized and in_sig_s is the signal synchronized to clock domain clk

hope it helps !
yours,
Said
 

    vintujose

    Points: 2
    Helpful Answer Positive Rating

xtcx

Advanced Member level 1
Joined
Dec 22, 2007
Messages
494
Helped
65
Reputation
130
Reaction score
58
Trophy points
1,308
Location
Bangalore, India
Activity points
5,003
Hi shnain, your solution is ok, but my case is a bit different,can you solve it?....Like my design(FPGA) communicates with a CODEC which has a clk of 2MHz,but however the codec is a master here...You can't make any handshaking to that.Because it's clk is not controllable.....Is there any solution to sync this clk?....and sample the data with my synchronized FPGA clk?...
 

robinh

Member level 1
Joined
Jan 18, 2002
Messages
38
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
254
Clock domain synchronization is not a simple solution, because of the metastability problems. This problem is quite large and you should investigate a little on Internet to understand what it is. However, there is two solutions :

1 - for a single signal use 2 cascaded flip-flops, synchronized with the destination clock.

2 - for a dataflow, use a FIFO with two clock domains (the FIFO integrates the necessary logic to manage properly the clock domain crossing problems).

Good luck
 

xtcx

Advanced Member level 1
Joined
Dec 22, 2007
Messages
494
Helped
65
Reputation
130
Reaction score
58
Trophy points
1,308
Location
Bangalore, India
Activity points
5,003
robinh said:
2 - for a dataflow, use a FIFO with two clock domains (the FIFO integrates the necessary logic to manage properly the clock domain crossing problems).
Do you mean, implementing Asynchronous FIFO?....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top