How to write a clock in testbench?

Status
Not open for further replies.

carrot

Full Member level 3
Joined
Feb 23, 2004
Messages
182
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,298
Location
Bangalore, India
Activity points
1,532
Clock in testbench

Hi,

Suppose if i want a clock in my module so that it will go to entire design, how will it be written in testbench?
 

Clock in testbench

always #10 clk = ~clk;
 

Clock in testbench

initial
begin
clk = 1'b0;
#5 forever #10 clk = ~clk;
end
 

Re: Clock in testbench

hai
clock decleration with out initializing

always #25 clk=~clk

if you want to initialize , then
initial
begin
clk=0;
always #25 clk=~clk
end

The other way of declaration the clock

forever #25 clk=~clk


this is how we declare clock
bye
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…