UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor nissanlu
Visitor
4,876 Views
Registered: ‎01-09-2013

Synchronizing a bus

 

Hi everyone!

 

For our project we need to establish communication between uC and FPGA clocked by its clock (named fClk).

The project is coded for SPARTAN-6 device, and the communication is based on a bi-directional bus used for write and read, and some control signals (nCS....) which are output only.

 

Along with the bus signals, the uC output the its bus clock (named bClk) for synchronization.

 

Since the uC signals are asynchronous to the FPGA and metastablity will probably occur, I tried to look out for bus synchronizer. I found topology that is based on sampling the bClk with two FF clocked by fClk and use an edge_detection circuit for detecting rising edges at bClk (Attached to post).

 

 

When I try to IMPLEMENT it in ISE, it warnings me that I use bCLk for non-clock input.

 

 

Is there any solution for it? Can I connect the bClk to FF D-input without warnings?

If not - can someone help me with helpful bus_synchronizer code??

I really need it.

 

 

ThanX in advance.

 

0 Kudos
4 Replies
Instructor
Instructor
4,856 Views
Registered: ‎08-14-2007

Re: Synchronizing a bus

You should not get this warning unless you also use bClk as a clock.  In the code you posted,

the only part where bClk is used as a clock was commented out.  If you have an input pin

that is both a clock and a signal to the D of a flip-flop (in another clock domain) you should

instantiate the BUFG to drive the clocked processes, and use the unbuffered input for

the D input of the flip-flop.  Otherwise the tools try to automatically insert a BUFG because

of the clock loads, and then without a separate name for the unbuffered signal, they try

to route that globally buffered clock signal to a D input of a flop, which is not a valid route

for Spartan 6.

 

-- Gabor

-- Gabor
0 Kudos
Visitor nissanlu
Visitor
4,851 Views
Registered: ‎01-09-2013

Re: Synchronizing a bus

 

Hi gszakacs,

 

U right, my mistake - the posted code should not have that comments. I added them when I debug the design. Without the comment I get that warnings as you say.

 

You wrote

"If you have an input pin that is both a clock and a signal to the D of a flip-flop (in another clock domain) you should instantiate the BUFG to drive the clocked processes, and use the unbuffered input for

the D input of the flip-flop"

 

I agree. but how I write it to the syntesizer in the VHD file?

 

 

 

0 Kudos
Instructor
Instructor
4,839 Views
Registered: ‎08-14-2007

Re: Synchronizing a bus

I'm attaching a copy of your code with the BUFG added.  I cut and pasted the instantiation from the Libraries Guide and didn't test it out, but it shows the principal.

 

-- Gabor

-- Gabor
0 Kudos
Visitor nissanlu
Visitor
4,825 Views
Registered: ‎01-09-2013

Re: Synchronizing a bus

 

Hi Gabor!

 

Following your advice, i changed some of the signal assignments in my code and added the BUFG instantiation.

 

It works now, and the implementation is good!

 

Thanks a lot!! 

0 Kudos