Proper use of BUFGMUX and DCM in Spartan 3

I'd like to double check my assumptions about using the Spartan 3 DCM in combination with a BUFGMUX.

I am trying to use a BUFGMUX as input to the clk pin of the DCM so that I can switch between 2 clock sources.

In this regard, I assume that each clk input goes through an IBUFG, the outputs of these IBUFs feed into the inputs of the BUFGMUX, and the output of the BUFGMUX then feeds the clk pin of the DCM.

The output of the DCM uses both clk0 and clk2x, both of which feed into the inputs of yet another BUFGMUX. The reason for this configuration is that when I use one clock input I want to double its frequency (clk2x) while for the other clock I just want clk0.

Is there anything wrong with this configuration?

A related question is the inclusion of "defparam DCM_INST.CLK_FEEDBACK = "1X";" (In Verilog template.) I presume that the other value can be "2X".

Since I am using external feedback, does this parameter matter, or does switching between clk2x and clk1x make a difference?

Reply to
xilinx_user
Loading thread data ...

the

This sounds reasonable as long as you reset the DCM after switching clock inputs.

into

is

(clk2x)

When you say DCM "uses both clk0 and clk2x" , do you mean for feedback? You can't change the feedback path from clk0 to clk2x without changing parameters, and thus not in the same design.

If you mean both outputs are used for the downstream logic this is O.K.

DCM_INST.CLK_FEEDBACK

be

As noted above you can't change the feedback type without re-loading the bitstream, so it can't change dynamically in one design. However it sounds like what you want is to always use clk0 for feedback on the DCM and feed either clk0 or clk2x (depending on requirements for doubling) to the downstream logic. This should work O.K.

does

The parameter tells the DCM whether it needs to divide the feedback clock to match the input clock and will definitely matter. Any DCM should not change the feedback path within the same design. Changing the feedback path to 2X does not cause clock doubling. The clk2x output always has 2x the input frequency. You shouldn't need to use 2x feedback unless you need precise alignment of the 2x clock to the input. If you can live with the normal clk0 to clk2x skew you should be O.K.

The external feedback path requires either clk0 or clk2x to be tied directly to an OBUF or the tools complain and give up. Are you trying to regenerate the clock for external devices? If not you don't really need external feedback. In any case you can't use the output of your BUFGMUX for feedback. You need a separate path from the clk0 output to your DCM feedback.

The Virtex 2 user guide has a very good write-up on using the DCM (this is not the datasheet). see:

formatting link

Reply to
Gabor

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.