cgg.v
591 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// $Id: cgg.v,v 1.1.1.1 2002/05/17 06:14:57 blythe Exp $
`timescale 1ns/100ps
module cgg(stopgclk, clk, gclk, reset_l);
`include "reality.vh"
// clock generator controls
parameter CLOCK_PERIOD = 16;
input stopgclk;
output clk;
output gclk;
output reset_l;
reg clk;
reg gclk;
reg reset_l;
reg mclk;
always #(CLOCK_PERIOD / 2) mclk = ~mclk;
initial mclk = HIGH;
initial begin
reset_l = LOW;
repeat (10) @(posedge mclk);
reset_l <= HIGH;
end
always @(mclk) begin
if (mclk) begin
clk = HIGH;
gclk = ~stopgclk;
end
else begin
clk = LOW;
gclk = LOW;
end
end
endmodule