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 131

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 129 rfajardo
`include "minsoc_defines.v"
3 128 rfajardo
 
4
`include "timescale.v"
5
 
6
 
7 131 rfajardo
module minsoc_bench_clock();
8 128 rfajardo
 
9
`ifdef POSITIVE_RESET
10
    localparam RESET_LEVEL = 1'b1;
11
`elsif NEGATIVE_RESET
12
    localparam RESET_LEVEL = 1'b0;
13
`else
14
    localparam RESET_LEVEL = 1'b1;
15
`endif
16
 
17
reg clock, reset, eth_tx_clk, eth_rx_clk;
18
 
19 131 rfajardo
minsoc_bench_core minsoc_bench_core_0(
20 128 rfajardo
    .clock(clock),
21
    .reset(reset),
22
    .eth_tx_clk(eth_tx_clk),
23
    .eth_rx_clk(eth_rx_clk)
24
);
25
 
26
initial begin
27
    reset = ~RESET_LEVEL;
28
    clock = 1'b0;
29
        eth_tx_clk = 1'b0;
30
        eth_rx_clk = 1'b0;
31
    // Reset controller
32
    repeat (2) @ (negedge clock);
33
    reset = RESET_LEVEL;
34
    repeat (16) @ (negedge clock);
35
    reset = ~RESET_LEVEL;
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.