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

Subversion Repositories 8051

[/] [8051/] [trunk/] [bench/] [verilog/] [oc8051_uart_test.v] - Blame information for rev 97

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

Line No. Rev Author Line
1 97 simont
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  8051 uart test                                              ////
4
////                                                              ////
5
////  This file is part of the 8051 cores project                 ////
6
////  http://www.opencores.org/cores/8051/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////   submodul of oc8051_tb, used to comunicate with 8051        ////
10
////   serial potr                                                ////
11
////                                                              ////
12
////  To Do:                                                      ////
13
////   nothing                                                    ////
14
////                                                              ////
15
////  Author(s):                                                  ////
16
////      - Simon Teran, simont@opencores.org                     ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE.  See the GNU Lesser General Public License for more ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
//
45
// CVS Revision History
46
//
47
// $Log: not supported by cvs2svn $
48
// Revision 1.4  2002/09/30 17:34:01  simont
49
// prepared header
50
//
51
//
52
 
53
// synopsys translate_off
54
`include "oc8051_timescale.v"
55
// synopsys translate_on
56
 
57
 
58
module oc8051_uart_test (clk, rst, addr, wr, wr_bit, data_in, data_out, bit_out, rxd, txd, ow, intr, ack, stb);
59
//
60
// serial interface simulation. part of oc8051_tb
61
//
62
// clk          (in)  clock
63
// rst          (in)  reset
64
// addr         (in)  addres [oc8051.ext_addr]
65
// wr           (in)  write [oc8051.write]
66
// wr_bit       (in) write bit addresable [oc8051.p3_out.0]
67
// data_in      (out) data input [oc8051.data_out]
68
// data_out     (in)  data output [oc8051.data_in]
69
// rxd          (in)  receive data [oc8051.txd]
70
// txd          (out) transmit data [oc8051.rxd]
71
// ow           (in)  owerflov (used in mode 1 and 3) [oc8051.p3_out.1]
72
// intr         (out) interrupt request [oc8051.p3_in.0]
73
//
74
 
75
input clk, rst, wr, wr_bit, rxd, ow, stb;
76
input [7:0] addr, data_in;
77
 
78
output txd, intr, bit_out, ack;
79
output [7:0] data_out;
80
 
81
wire syn;
82
reg wr_r, ack;
83
reg [7:0] addr_r, data_in_r;
84
 
85
 
86
oc8051_uart oc8051_uart_test(.rst(rst), .clk(clk), .bit_in(data_in[0]), .rd_addr(addr), .data_in(data_in_r),
87
                    .wr(wr_r), .wr_bit(wr_bit), .wr_addr(addr_r), .data_out(data_out), .bit_out(bit_out),
88
                    .rxd(rxd), .txd(txd), .intr(intr), .t1_ow(ow));
89
 
90
 
91
always @(posedge clk)
92
begin
93
  if (ack) ack <= #1 1'b0;
94
  else
95
    ack <= #1 stb;
96
end
97
 
98
always @(posedge clk)
99
begin
100
  wr_r <= #1 wr;
101
  addr_r <= #1 addr;
102
  data_in_r <= #1 data_in;
103
end
104
 
105
 
106
endmodule

powered by: WebSVN 2.1.0

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