This repository was archived by the owner on Dec 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuartMod_Test.v
More file actions
109 lines (95 loc) · 1.83 KB
/
Copy pathuartMod_Test.v
File metadata and controls
109 lines (95 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11:20:08 10/02/2017
// Design Name: Main_Uart
// Module Name: C:/Users/Cou/Documents/tp_final/uartMod_Test.v
// Project Name: tp_final
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: Main_Uart
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module uartMod_Test;
// Inputs
reg clk;
reg rx;
reg uart_reset;
reg readFlag;
reg [7:0] dataToSend;
reg uart_tx_start;
// Outputs
wire [7:0] receivedData;
wire dataAvailable;
wire tx;
wire uart_tx_done;
wire [3:0] state;
wire [7:0] dout_wdata;
// Instantiate the Unit Under Test (UUT)
Main_Uart uut (
.clk(clk),
.rx(rx),
.uart_reset(uart_reset),
.readFlag(readFlag),
.dataToSend(dataToSend),
.uart_tx_start(uart_tx_start),
.receivedData(receivedData),
.dataAvailable(dataAvailable),
.tx(tx),
.uart_tx_done(uart_tx_done),
.state(state),
.dout_wdata(dout_wdata)
);
initial begin
// Initialize Inputs
clk = 0;
rx = 1;
uart_reset = 0;
readFlag = 0;
dataToSend = 0;
uart_tx_start = 0;
// Wait 100 ns for global reset to finish
#500;
// Add stimulus here
rx = 1;
#99999;
#52083.34;
rx = 0;//start bit
#52083.34;
rx = 1;
#52083.34;
rx = 1;
#52083.34;
rx = 0;
#52083.34;
rx = 0;
#52083.34;
rx = 0;
#52083.34;
rx = 1;
#52083.34;
rx = 1;
#52083.34;
rx = 0;
#52083.34;
rx = 1;//stop bit
#52083.34;
#99999;
readFlag = 1;
end
always begin //clock de 100 Mhz como el de la placa
clk = 1'b0;
#(80/2) clk = 1'b1;
#(80/2);
end
endmodule