clock.v
442 Bytes
//
// Generate Clock
//
initial
begin
gclock = 1;
clock = 1;
end
//
// Standard sim clock period.
//
always
begin
clock = 1;
#800;
clock = 0;
#800;
end
//
// A one-time permanent assignment for gclock (value of gclock depends on
// gclock_enable_t and the free-running clock; if gclock_enable_t goes away,
// we hold the current value of gclock).
//
always @(clock)
gclock = gclock_enable ? clock:gclock;