N00b question about DCM

Apr 27, 2007 2 Replies

I have a Spartan3E Starter Kit, and I am trying to figure out how to use the DCM to double the freq from 50MHz to 100MHz.



I wrote a small verilog program to blink LEDs 0-3 based on the 50MHz clock, and LEDs 4-7 based on the



100MHz clock, so if it works properly, the second group of LEDs should blink twice as fast. But it doesn't work. LEDs 4-7 don't blink at all.

How do I specify (in verilog or UCF?) that the "clk_100mhz" is supposed to be the CLK2X output from the DCM? How do I specify which DCM to use, or does the compiler figure that out for itself?



Thanks for any help.


------------------------------------------------------------- // blink.v



module blink ( input wire clk_50mhz, input wire clk_100mhz, output reg[7:0] leds );



reg [20:0] cnt50; // Counter @ 50MHz reg [20:0] cnt100; // Counter @ 100MHz



initial begin cnt50


... There are _no_ DCM instance in your code ... how do you expect it to work ?

Saying in the ucf one clock is 50 and the other 100 will _NOT_ make the tools instanciate a DCM for you. Go for the easy way and use coregen to setup your DCM then instanciate it in your code.

Sylvain

I think I made exactly this same error when I was first starting out. In this case, you're setting a constraint telling the placer/router that you want the net "clk_100mhz" to be routed such that it can safely carry a signal at 100Mhz. However, this doesn't actually /drive/ the line. You need to explicitly instantiate a dcm instance for that. Coregen can generate one for you, or it's almost as easy to look at the library guide to figure it out. See doc/usenglish/books/manuals.pdf inside your Xilinx install directory for the library guide for your platform.

Good luck.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required