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

Subversion Repositories openverifla

[/] [openverifla/] [trunk/] [openverifla_2.4/] [verilog/] [examples/] [counters.v] - Blame information for rev 46

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 46 laurentiud
module counters(cntb,
2
        clk, reset,
3
        //top_of_verifla transceiver
4
        uart_XMIT_dataH, uart_REC_dataH
5
);
6
 
7
 
8
input clk, reset;
9
output [7:0] cntb;
10
//top_of_verifla transceiver
11
input uart_REC_dataH;
12
output uart_XMIT_dataH;
13
 
14
// Simple counters
15
reg [7:0] cntb, cnta;
16
always @(posedge clk or posedge reset)
17
begin
18
        if(reset) begin
19
                cntb = 0;
20
                cnta = 0;
21
        end else begin
22
                if((cnta & 1) && (cntb < 16'hf0))
23
                        cntb = cntb+1;
24
                cnta = cnta+1;
25
        end
26
end
27
 
28
// VeriFLA
29
top_of_verifla verifla (.clk(clk), .rst_l(!reset), .sys_run(1'b1),
30
                                .data_in({cntb, cnta}),
31
                                // Transceiver
32
                                .uart_XMIT_dataH(uart_XMIT_dataH), .uart_REC_dataH(uart_REC_dataH));
33
 
34
endmodule
35
 
36
// Local Variables:
37
// verilog-library-directories:(".", "../verifla")
38
// End:

powered by: WebSVN 2.1.0

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