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

Subversion Repositories openverifla

[/] [openverifla/] [trunk/] [openverifla_2.4/] [verilog/] [verifla/] [baud_of_verifla.v] - Blame information for rev 47

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

Line No. Rev Author Line
1 46 laurentiud
 
2
module baud_of_verifla(
3
                        sys_clk,
4
                        sys_rst_l,
5
                        baud_clk_posedge
6
                );
7
 
8
 
9
`include "inc_of_verifla.v"
10
 
11
 
12
input                   sys_clk;
13
input                   sys_rst_l;
14
output                  baud_clk_posedge;
15
reg baud_clk;
16
reg baud_clk_posedge;
17
 
18
reg [BAUD_COUNTER_SIZE-1:0] counter=0; //{BAUD_COUNTER_SIZE{1'b0}};
19
 
20
always @(posedge sys_clk or negedge sys_rst_l)
21
begin
22
        if(~sys_rst_l) begin
23
                baud_clk <= 0;
24
                baud_clk_posedge <= 0;
25
                counter <= 0;
26
        end else if (counter < T2_div_T1_div_2) begin
27
                counter <= counter + 1;
28
                baud_clk <= baud_clk;
29
                baud_clk_posedge <= 0;
30
        end else begin
31
                if(~baud_clk) // baud_clk will become 1
32
                        baud_clk_posedge <= 1;
33
                counter <= 0;
34
                baud_clk <= ~baud_clk;
35
        end
36
end
37
 
38
/*
39
reg [2:0] baud_vec=3'b000;
40
always @(posedge clk) baud_vec = {baud_vec[1:0], baud_clk};
41
wire baud_clk_posedge=(baud_vec[2:1]=2'b01;
42
wire baud_clk_negedge=(baud_vec[2:1]=2'b10;
43
*/
44
 
45
endmodule

powered by: WebSVN 2.1.0

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