Continue to Site

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.

Testbench: variable clock

Status
Not open for further replies.

dd2001

Full Member level 4
Full Member level 4
Joined
Apr 14, 2002
Messages
236
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
1,912
How to write a variable clock generator?

always #cycle clk = ~clk;


want to cycle auto increse 10 every #500.


Any one guru can help?
 

Use several clock sources, then mux those clocks together and that mux controled by counter(s). Since its not synthesisable, you need NOT to worry about the glitchs, load....
 

Is this what you want ?


`define cycle_main 100
`define cycle_inc 500
`define inc 10

integer tinc;

initial begin
tinc = 0;
clk <= 0;
end


always begin
#(`cycle_main + tinc)
clk <= ~clk;
end

always begin
#(`cycle_inc)
tinc = tinc + `inc;
end
 

Well, karlheinz:


It is very close, I just want it functions like a VCO, if feedback 7-bit data changed, then frequency also follow.


Thnaks.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top