Rules | Recent posts | topic RSS | Search | Register  | Log in

Need code for generating clock doubler using DCM...
Goto page Previous  1, 2, 3  Next
 
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design
Author Message
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post30 Jun 2008 9:41   Re: Need code for generating clock doubler using DCM...

Hi,

I didn't understand u r talking about which pulse duration?

The pulse duration should be at least three clock cycles?

Added after 4 minutes:

I didnt understand u r talking about which clock pulse duration?

The pulse duration should be at least three clock cycles?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post30 Jun 2008 12:08   Need code for generating clock doubler using DCM...

"Also try applying a reset pulse to the DCM."

That's the RST_IN port of dcm2x.


I hope that solves the problem, because I have no more guesses!
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post30 Jun 2008 18:26   Re: Need code for generating clock doubler using DCM...

Hi,

I tried to generate my dcm with vhdl in my friends sytem its working fine but not in verilog. But I dont have option to select lang preference in my system. I have asked for service pack of ISE 8.1i. Is there any other chances?

Added after 5 hours 54 minutes:

I have a doubt why do we need counter in the top module. I have one more doubt I have generated dcm using ISE 9.1i (Institute system) in VHDL but its not working with ISE 8.1i. Does it make any diff...? In 8.1i version I don't have any option to generate dcm using vhdl mean dont have option to select lang preference...
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post30 Jun 2008 23:25   Need code for generating clock doubler using DCM...

Good to hear that you have seen partial success. You may be closer to solving the problem.

Over the years, I've seen a variety of problems with Xilinx DCM simulation models, even as recently as version 10.1. For example, this problem occurs in VHDL but works fine in Verilog:
http://www.xilinx.com/support/answers/30812.htm

If you have good internet bandwidth, you can download ISE service packs here. Use the "Modify Search" to select your ISE version:
http://www.xilinx.com/support/download/index.htm

Mixing code from different versions of Xilinx tools sometimes causes problems. I'm not surprised that 8.1 didn't like the 9.1 DCM.

You are correct that my counter isn't necessary. I put it into the top module simply to give the clock something useful to do!


Other options:

If you are a commercial ISE customer or a professor (but not a student), you can submit a WebCase question to the Xilinx customer support team.
http://www.xilinx.com/support/clearexpress/websupport.htm

If you are a student or hobbyist, you can try asking your question in the Xilinx support forum:
http://forums.xilinx.com/
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post05 Jul 2008 7:19   Re: Need code for generating clock doubler using DCM...

Hi

I have installed service pack for ISE 8.1i,but then I dont have option to generate my DCM in VHDL.I am running the code generated by 10.1i.I am not getting the output i.e, clock2x from my DCM. Please let me know if I have to make any changes in DCM module.I believe there is any port connection missing for clock2x output.I got perfect output in 10.1i, for the same code.Find attached file which consists code for DCM , top module and o/p waveform of DCM.




Sorry, but you need login in to view this attachment

Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post07 Jul 2008 19:18   Re: Need code for generating clock doubler using DCM...

Hi,

I was not getting output in 8.1i. I have downloaded webpack 10.1. I am getting partial output. I am not getting locked out o/p and o/p clk is does not have 50% duty cycle. Another thing there is no component declaration in the code generated by webpack. However it is present in 10.1i licensed version. Then i added the component declaration into code. But no improvements. Plz let me know if u have any idea where its going wrong....I am very thankful for ur guidelines n encouragement.




Sorry, but you need login in to view this attachment

Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post08 Jul 2008 2:59   Need code for generating clock doubler using DCM...

You mentioned using Spartan-3. Are you sure you've selected Spartan-3 in your project? Your code contains a DCM_SP, and Spartan-3 only provides DCM.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post08 Jul 2008 9:13   Re: Need code for generating clock doubler using DCM...

yeah I have selected spartan 3 and spartan 3E(when i didnt get thro' spartan 3).
with which device DCM_SP will be generated?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post08 Jul 2008 10:20   Need code for generating clock doubler using DCM...

Spartan-3 has DCM.

Spartan-3E, -3A, and -3A DSP have DCM_SP. If you use DCM with one of these FPGAs, ISE should automatically substitute a DCM_SP during synthesis.

Uh-oh, now it's broken for me. One of my previously working projects is now generating bad CLK2X. I recently upgraded to ISE 10.1.02 and ModelSim 6.4. I don't yet know which upgrade is causing the malfunction. If I use 1X feedback instead of 2X feedback, or if I use DCM instead of DCM_SP, the CLK2X output starts working again.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post08 Jul 2008 10:34   Re: Need code for generating clock doubler using DCM...

Acc to datasheets if i need clock2x output i need to give clock2x as feedback....so i was going in that way. However even my friend tried with 1x feedback in her office, she is getting output. even i tried to change to 1x but no improvements. One more doubt my OS is pirated one does it matter?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post08 Jul 2008 10:46   Need code for generating clock doubler using DCM...

Yes, "2X" feedback mode requires CLK2X signal feedback. "1X" feedback mode requires CLK0 signal feedback. Well, that's the way it *should* behave.

I don't think bootleg will cause this problem. Wink
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post11 Jul 2008 10:18   Re: Need code for generating clock doubler using DCM...

hi,

u said u r facing issues in ur previous projects which worked very much fine earlier.... Did u come to know wheter any issues with ISE or modelsim... Plz let me know if u have any idea about ISE webpack whether it generates good outputs or not?

Added after 1 hours 19 minutes:

Hi,

Even though I am getting partial output I mean I am not getting LOCKED output, Still I was simulating design bcz my aim is to get the output clock as twice that of input clock... I am getting error as

# ** Fatal: Integer divide (mod) by zero.
# Time: 1000040 ps Iteration: 19 Process: /top_module/u2/dcm_sp_inst/ps_delay_md_p File: C:/Xilinx/10.1/ISE/vhdl/src/unisims/unisim_VITAL.vhd
# Fatal error at C:/Xilinx/10.1/ISE/vhdl/src/unisims/unisim_VITAL.vhd line 7216
#
run
# Cannot continue because of fatal error.
run
# Cannot continue because of fatal error.
run
# Cannot continue because of fatal error.
run
# Cannot continue because of fatal error.
run
# Cannot continue because of fatal error.
run
# Cannot continue because of fatal error.
run
# Cannot continue because of fatal error.
run
# Cannot continue because of fatal error.

plz check the Output wave form....If u need I wil upload my codes... I have taken my system clock as 100MHZ and input to DCM as 50MHZ....
How do I fix it????????

Added after 1 minutes:

Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post11 Jul 2008 13:30   Need code for generating clock doubler using DCM...

I suspect the DCM_SP simulation model is broken in ISE 10.1. Xilinx Answer record 30812 says one problem was fixed in SP2, but maybe the fix is incomplete.

I haven't seen any problems with DCM. Try using DCM instead of DCM_SP. However, if you are doing post-route simulations, XST replaces DCM with DCM_SP.

For me, the problem occurs only when using 2X feedback. The CLK2X output is still available when using 1X feedback, but of course the phase alignment will be different. Maybe you can still use it.

I haven't seen the fatal error problem. Try examining line 7216 to see why it's dividing by zero.

Probably the best way to solve your problem is to contact Xilinx support via WebCase. The service is available to registered customers.
http://www.xilinx.com/support/clearexpress/websupport.htm

I've seen related discussions on the Xilinx forums:
http://forums.xilinx.com/xlnx/
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post11 Jul 2008 13:47   Re: Need code for generating clock doubler using DCM...

Hi,

I have changed DCM_SP with DCM, even then I am getting error. Then I saw the UNISIM file which says PS_delay=1/256 (CLK_IN )period. And with input freq (65 to 125)MHZ should be used acc to datasheets of SPARTAN-3 FPGA.So that PS will lie bit 30 to 60 psec. But as I am doubling clock over six times successively, the outputs at later stages is going beyond range .so I am not getting output till the expected outputs. I am planning to use DFS instead of DCM. But for that PS_delay should lie between 20 to 40 psec. I think I wil end up with same results. will try once....
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post11 Jul 2008 14:03   Need code for generating clock doubler using DCM...

"even then I am getting error" -- Are you referring to the faulty CLK2X output, or the fatal error messages?

Doubling clock six times? That's 64 times frequency. Long ago you mentioned using a long chain of DCMs. Don't do that! It may work in simulation, but it will probably fail in the FPGA due to accumulated jitter.

What frequency is your input clock, and what output frequency are you trying to generate?
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post11 Jul 2008 15:51   Re: Need code for generating clock doubler using DCM...

I am deciding my input clock frequency depending on the DCM (MIN N MAX ) frequency. Bcz I am giving my input to DCM. I am getting clock2x output for only couple of clocks. As my design consists of multiplying clock n num of times. I am instantiating DCM for 6 times and generating ADC clock at the output of 6th DCM.
spartan 3 with DLL got limited freq range. The Output range is beyond the limit
(18 TO 167MHZ for low mode or 48 to 280MHZ). Now I thought I wil use Spartan-3E with DFS which got good freq flexibility between 5 to 333MHZ. even if I give
5 Mhz as my input freq its output at the end of last DCM will be 320Mhz. Plz check my logic block dia and let me know is it going better with DFS?But my DCM with DFS is not working. I tried to generate twice the input freq by selecting (4/2) 4-multiply adn 2-divide so that input is multiplied by 2 as explained in datasheet.If it works I thought i wil directly choose for 6 and 12 multiply numbers, when I instantiate it in top module I got error as ...Crying or Very sad


# ** Warning: (vsim-3473) Component instance "clkfx_bufg_inst : bufg" is not bound.
# Time: 0 ps Iteration: 0 Region: /top_module/u0 File: dcm2.vhd
# ** Warning: (vsim-3473) Component instance "clkfx180_bufg_inst : bufg" is not bound.
# Time: 0 ps Iteration: 0 Region: /top_module/u0 File: dcm2.vhd
# ** Warning: (vsim-3473) Component instance "clkin_ibufg_inst : ibufg" is not bound.
# Time: 0 ps Iteration: 0 Region: /top_module/u0 File: dcm2.vhd
# ** Warning: (vsim-3473) Component instance "clk2x_bufg_inst : bufg" is not bound.
# Time: 0 ps Iteration: 0 Region: /top_module/u0 File: dcm2.vhd
# ** Warning: (vsim-3473) Component instance "dcm_sp_inst : dcm_sp" is not bound.
# Time: 0 ps Iteration: 0 Region: /top_module/u0 File: dcm2.vhd
# Loading D:\vidya_projects\dcm-vhdl\libraries\unisim.bufg(bufg_v)
# .main_pane.mdi.interior.cs.vm.paneset.cli_0.wf.clip.cs.pw.wf
# .main_pane.workspace



Sorry, but you need login in to view this attachment

Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post11 Jul 2008 18:29   Need code for generating clock doubler using DCM...

Your code is configured for 2X feedback, but you commented-out the CLK2X_BUF lines, so they are probably floating.
Also, we've seen that 2X feedback is probably broken in the DCM_SP simulation model, so try DCM or 1X feedback.

If you use Spartan-3, a 5 MHz input is only allowed in DFS mode.

Why do you want to use such a low input frequency? A DCM causes jitter, cascading DCMs causes even more jitter, and jitter will hurt your ADC acquisition. Also, it may be impossible to use DCMs to convert from 5 MHz to 320 MHz due to excessive jitter. Be sure the output jitter from the first DCM doesn't exceed the allowable input jitter of the next DCM. The ISE Architecture Wizard can tell you the output jitter depending on DCM mode, but it may not calculate accumulated jitter.

VHDL files should have extension .vhd instead of .txt

I don't understand the "is not bound" warnings. Probably some VHDL issue. I use Verilog.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post12 Jul 2008 17:49   Re: Need code for generating clock doubler using DCM...

okay, as I was using DFS I commented CLK2X output signal in design.
For uploading into EDA I copied my VHDL files in a text file. With clock as input to DCM I am generating ADC-clk so I need very high freq at the output.
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post13 Jul 2008 3:45   Need code for generating clock doubler using DCM...

Your code specified "2X" feedback mode. That mode requires the CLK2X feedback signal. If you don't care about feedback, you can change the feedback mode to "NONE".

I understand your high freq ADC clock. I was wondering why your *input* clock is so low, only 5 MHz. It's more common to use a higher frequency oscillator such as 50 MHz or 100 MHz in FPGA projects, to avoid minimum-frequency limitations and to reduce jitter cause by too much clock multiplication.

You can RAR your vhd files just as easily as txt files.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post13 Jul 2008 7:48   Re: Need code for generating clock doubler using DCM...

Have u worked with DFS? I have decided to used DFS. Bcz with DLL's I need more DCM's its creating unnecessry delay and jitter.
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post14 Jul 2008 4:26   Need code for generating clock doubler using DCM...

Yes I've used DFS. Beware that a DFS section generates more jitter than a DLL section. Cascading two DFS sections usually works, but some combinations may not work, so it's not guaranteed by Xilinx. For more explanation, see the comment from the Xilinx fellow in this discussion:
http://forums.xilinx.com/xlnx/board/message?board.id=Virtex&thread.id=911

If you can use 10 MHz input clock instead of 5 MHz, then you would need only one DFS stage to generate 320 MHz.

This example (sorry Verilog) actually works on my Spartan-3E Starter Kit. It divides the on-board oscillator down from 50 MHz to 5 MHz, and then uses two DFS stages to multiply the 5 MHz to 320 MHz. However, the reliability may be marginal because it exceeds the rated specs of my board's "ES" grade FPGA, and I didn't analyze the jitter situation.

Code:
// Pin locations for Xilinx Spartan-3E Starter Kit
module top (clk50MHz, clk320MHz, locked2);
  (* LOC="C9", PERIOD="50 MHz" *) input clk50MHz;
  reg                             [3:0] count = 0;
  wire                                  clk5MHz = count[3];
  wire                                  clka, clkb, clkc, locked1;
  reg                             [4:0] reset=0;
  (* LOC="A10",SLEW="FAST" *) output    clk320MHz;
  (* LOC="A6", SLEW="FAST" *) output    locked2;

  always @ (posedge clk50MHz)
    count <= count == 4 ? -5 : count + 1;   // divide 50 MHz to 5 MHz

  // synthesize 40 MHz from 5 MHz
  DCM dcm1 (.CLKIN(clk5MHz), .RST(1'b0), .CLKFB(), .CLK0(), .CLKDV(), .CLKFX(clka), .LOCKED(locked1));
  defparam dcm1.CLK_FEEDBACK       = "NONE";
  defparam dcm1.CLKFX_MULTIPLY     = 8;
  defparam dcm1.CLKFX_DIVIDE       = 1;
  defparam dcm1.CLKIN_PERIOD       = 200;

  BUFG buf1 (.I(clka), .O(clkb));

  always @ (posedge clkb)
    reset <= {reset,locked1};

  // synthesize 320 MHz from 40 MHz
  DCM dcm2 (.CLKIN(clkb), .RST(~reset[4]), .CLKFB(), .CLK0(), .CLKDV(), .CLKFX(clkc), .LOCKED(locked2));
  defparam dcm2.CLK_FEEDBACK       = "NONE";
  defparam dcm2.CLKFX_MULTIPLY     = 8;
  defparam dcm2.CLKFX_DIVIDE       = 1;
  defparam dcm2.CLKIN_PERIOD       = 25;

  BUFG buf2 (.I(clkc), .O(clk320MHz));
endmodule
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post14 Jul 2008 9:28   Re: Need code for generating clock doubler using DCM...

yeah I have downloaded servicepack for 10.1. I will check it out and let u know the results.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post15 Jul 2008 12:29   Re: Need code for generating clock doubler using DCM...

Hi,

I am getting output with DFS in ISE 10.1. Now I am facing the challenge of using two DCM'S. My first DCM has to multiply input clock by six times and second one by two times the output of first DCM. I am not able to generate two DCM'S in one project. I tried with other to use cascade two DCM'S but here its generating dcm module. A popup is opening saying the limited range for DLL and DFS(.200 to 333 MHZ for DFS). But I have only given my clock input as 5MHZ to first DCM, which is multiplied by 6, output is supposed to be 30MHZ then when this is given as input to second DCM which is multiplied by 2 will generate 60MHZ....Even though they are with in the constraints Why it is not taking into consideration...?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post15 Jul 2008 13:18   Need code for generating clock doubler using DCM...

Which program are you using that generates those error messages? If you are using Project Navigator and Architecture Wizard, sorry I don't build projects that way because of too many headaches. I simply write code like my example above.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post15 Jul 2008 13:26   Re: Need code for generating clock doubler using DCM...

Oh...I mean to say to generate DCM. Are you writing code for DCM by ur own?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post15 Jul 2008 13:43   Need code for generating clock doubler using DCM...

I write code by hand like my example two messages ago. That's a complete project with two cascaded DFS stages. I don't use any wizards or Project Navigator.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post15 Jul 2008 16:57   Re: Need code for generating clock doubler using DCM...

This you have instatiated from ur DCM module rite generated by ISE..?

DCM dcm1 (.CLKIN(clk5MHz), .RST(1'b0), .CLKFB(), .CLK0(), .CLKDV(), .CLKFX(clka), .LOCKED(locked1));

Here u ahve done port mapping rite?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post16 Jul 2008 1:33   Need code for generating clock doubler using DCM...

I didn't use any tools to generate that code. I simply read the DCM syntax description in the ISE Libraries Guide, and then wrote the code.

My DCM instantiation statement is quite short because I needed only a few ports. I could make it even shorter by omitting the unused CLKFB, CLK0, and CLKDV ports. I use those ports in other projects, so I kept them here merely as placeholders, reminders to myself. Verilog allows it.

My Verilog example works in simulation and actual hardware. I tested it on my Spartan-3E Starter Kit.
Back to top
vidyaredy



Joined: 31 Jan 2008
Posts: 51


Post16 Jul 2008 7:10   Re: Need code for generating clock doubler using DCM...

sorry I didn't get you.... Even though you have written code on your own there should be a lower level module rite? Whats the logic for doubling clock frequency if you are not configuring DCM generated by ISE ?...In your earlier responses you mentioned HDL's won't support?

could you please elaborate it...
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 565


Post16 Jul 2008 10:06   Need code for generating clock doubler using DCM...

I simply put all the DCM and BUFG instantiations into my "top" module instead of putting them into separate lower level modules. The code is more compact, one module instead of three. Either way, the design works the same. It can be done in VHDL too, but I'm not very good at writing VHDL.

My code does configure the two DCMs. It uses Verilog "defparam" statements. They are similar to the "generic" statements in your VHDL.

I don't understand "HDL's won't support". If you are referring to my very first message, then perhaps you aren't familiar with the difference between "infer" and "instantiate".


Last edited by echo47 on 16 Jul 2008 10:23; edited 1 time in total
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design
Page 2 of 3 All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next


Abuse
Administrator
Moderators
topic RSS 
sitemap