OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [verilator/] [bench/] [verilog/] [minsoc_bench_clock.v] - Blame information for rev 128

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 128 rfajardo
`include "minsoc_bench_defines.v"
2
 
3
`include "timescale.v"
4
 
5
 
6
module minsoc_verilog_bench();
7
 
8
`ifdef POSITIVE_RESET
9
    localparam RESET_LEVEL = 1'b1;
10
`elsif NEGATIVE_RESET
11
    localparam RESET_LEVEL = 1'b0;
12
`else
13
    localparam RESET_LEVEL = 1'b1;
14
`endif
15
 
16
reg clock, reset, eth_tx_clk, eth_rx_clk;
17
 
18
minsoc_bench minsoc_bench_0(
19
    .clock(clock),
20
    .reset(reset),
21
    .eth_tx_clk(eth_tx_clk),
22
    .eth_rx_clk(eth_rx_clk)
23
);
24
 
25
initial begin
26
    reset = ~RESET_LEVEL;
27
    clock = 1'b0;
28
        eth_tx_clk = 1'b0;
29
        eth_rx_clk = 1'b0;
30
    // Reset controller
31
    repeat (2) @ (negedge clock);
32
    reset = RESET_LEVEL;
33
    repeat (16) @ (negedge clock);
34
    reset = ~RESET_LEVEL;
35
 
36
end
37
 
38
//
39
//      Regular clocking and output
40
//
41
always begin
42
    #((`CLK_PERIOD)/2) clock <= ~clock;
43
end
44
 
45
//Generate tx and rx clocks
46
always begin
47
        #((`ETH_PHY_PERIOD)/2) eth_tx_clk <= ~eth_tx_clk;
48
end
49
always begin
50
        #((`ETH_PHY_PERIOD)/2) eth_rx_clk <= ~eth_rx_clk;
51
end
52
//~Generate tx and rx clocks
53
 
54
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.