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

Subversion Repositories pss

[/] [pss/] [trunk/] [pss/] [hdl/] [pss/] [udm/] [udm.v] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 AlexAntono
/*
2
 PSS
3
 
4
 Copyright (c) 2016 Alexander Antonov <153287@niuitmo.ru>
5
 All rights reserved.
6
 
7
 Version 0.9
8
 
9
 The FreeBSD license
10
 
11
 Redistribution and use in source and binary forms, with or without
12
 modification, are permitted provided that the following conditions
13
 are met:
14
 
15
 1. Redistributions of source code must retain the above copyright
16
    notice, this list of conditions and the following disclaimer.
17
 2. Redistributions in binary form must reproduce the above
18
    copyright notice, this list of conditions and the following
19
    disclaimer in the documentation and/or other materials
20
    provided with the distribution.
21
 
22
 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
23
 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25
 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
 PSS PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27
 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28
 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31
 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33
 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
 
36
 
37
module udm
38
(
39
        input clk_i, rst_i,
40
 
41
        input rx_i,
42
        output tx_o,
43
 
44
        output rst_o,
45
        output bus_enb_o,
46
        output bus_we_o,
47
        output [31:0] bus_addr_bo,
48
    output [31:0] bus_wdata_bo,
49
 
50
    input bus_ack_i,
51
    input [31:0] bus_rdata_bi
52
);
53
 
54
wire rx_done_tick;
55
wire [7:0] rx_data;
56
wire [7:0] tx_data;
57
wire tx_start;
58
wire tx_done_tick;
59
 
60
wire locked;
61
wire [28:0] bitperiod;
62
 
63
uart_rx uart_rx
64
(
65
    .clk_i(clk_i),
66
    .rst_i(rst_i),
67
 
68
    .rx_i(rx_i),
69
    .rx_done_tick_o(rx_done_tick),
70
    .dout_bo(rx_data),
71
 
72
    .locked_o(locked),
73
    .bitperiod_o(bitperiod)
74
);
75
 
76
uart_tx uart_tx
77
(
78
    .clk_i(clk_i),
79
    .rst_i(rst_i),
80
 
81
    .tx_start_i(tx_start),
82
    .din_bi(tx_data),
83
 
84
    .locked_i(locked),
85
    .bitperiod_i(bitperiod),
86
 
87
    .tx_done_tick_o(tx_done_tick),
88
    .tx_o(tx_o)
89
);
90
 
91
 
92
udm_controller udm_controller
93
(
94
        .clk_i(clk_i),
95
        .reset_i(rst_i),
96
 
97
        // uart rx
98
        .rx_done_tick_i(rx_done_tick),
99
    .rx_din_bi(rx_data),
100
 
101
        // uart tx
102
        .tx_dout_bo(tx_data),
103
        .tx_start_o(tx_start),
104
    .tx_done_tick_i(tx_done_tick),
105
 
106
        // bus
107
        .rst_o(rst_o),
108
        .bus_enb_o(bus_enb_o),
109
        .bus_we_o(bus_we_o),
110
        .bus_addr_bo(bus_addr_bo),
111
    .bus_wdata_bo(bus_wdata_bo),
112
 
113
    .bus_ack_i(bus_ack_i),
114
    .bus_rdata_bi(bus_rdata_bi)
115
);
116
 
117
endmodule

powered by: WebSVN 2.1.0

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