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

Subversion Repositories steelcore

[/] [soc/] [bench/] [tb_uart_tx.v] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 rafaelcalc
//////////////////////////////////////////////////////////////////////////////////
2
// Engineer: Rafael de Oliveira Calçada (rafaelcalcada@gmail.com) 
3
// 
4
// Create Date: 05.08.2020 19:57:30
5
// Module Name: tb_uart_tx
6
// Project Name: Steel SoC 
7
// Description: UART transmitter testbench (9600 baud, 1 stop bit, no parity,
8
//              no control) 
9
// 
10
// Dependencies: uart_tx.v
11
// 
12
// Version 0.01
13
// 
14
//////////////////////////////////////////////////////////////////////////////////
15
 
16
/*********************************************************************************
17
 
18
MIT License
19
 
20
Copyright (c) 2020 Rafael de Oliveira Calçada
21
 
22
Permission is hereby granted, free of charge, to any person obtaining a copy
23
of this software and associated documentation files (the "Software"), to deal
24
in the Software without restriction, including without limitation the rights
25
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26
copies of the Software, and to permit persons to whom the Software is
27
furnished to do so, subject to the following conditions:
28
 
29
The above copyright notice and this permission notice shall be included in all
30
copies or substantial portions of the Software.
31
 
32
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38
SOFTWARE.
39
 
40
********************************************************************************/
41
 
42
`timescale 1ns / 1ps
43
 
44
module tb_uart_tx();
45
 
46
    reg CLK;
47
    reg [7:0] WDATA;
48
    reg WR_EN;
49
    wire [31:0] RDATA;
50
    wire TX;
51
 
52
    uart_tx dut(
53
        .CLK(CLK),
54
        .WDATA(WDATA),
55
        .WR_EN(WR_EN),
56
        .RDATA(RDATA),
57
        .TX(TX)
58
    );
59
 
60
    always
61
    begin
62
        #10 CLK = !CLK;
63
    end
64
 
65
    initial
66
    begin
67
 
68
        // The purpose of this testbench is just to observe the UART waveform
69
 
70
        $display("Testing UART transmitter unit...");
71
 
72
        CLK = 1'b0;
73
        WR_EN = 1'b0;
74
        WDATA = 8'h11;
75
 
76
        #20;
77
        WR_EN = 1'b1;
78
 
79
    end
80
 
81
endmodule

powered by: WebSVN 2.1.0

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