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

Subversion Repositories wb4pb

[/] [wb4pb/] [trunk/] [rtl/] [picoblaze_wb_uart.v] - Blame information for rev 26

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

Line No. Rev Author Line
1 12 ste.fis
////////////////////////////////////////////////////////////////////////////////
2
// This sourcecode is released under BSD license.
3
// Please see http://www.opensource.org/licenses/bsd-license.php for details!
4
////////////////////////////////////////////////////////////////////////////////
5
//
6
// Copyright (c) 2010, Stefan Fischer <Ste.Fis@OpenCores.org>
7
// All rights reserved.
8
//
9
// Redistribution and use in source and binary forms, with or without 
10
// modification, are permitted provided that the following conditions are met:
11
//
12
//  * Redistributions of source code must retain the above copyright notice, 
13
//    this list of conditions and the following disclaimer.
14
//  * Redistributions in binary form must reproduce the above copyright notice,
15
//    this list of conditions and the following disclaimer in the documentation
16
//    and/or other materials provided with the distribution. 
17
//  * Neither the name of the author nor the names of his contributors may be 
18
//    used to endorse or promote products derived from this software without 
19
//    specific prior written permission.
20
//
21
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
22
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
23
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
24
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
25
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
26
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
27
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
28
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
29
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
30
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
31
// POSSIBILITY OF SUCH DAMAGE.
32
//
33
////////////////////////////////////////////////////////////////////////////////
34
// filename: picoblaze_wb_uart.v
35
// description: synthesizable PicoBlaze (TM) uart example using wishbone
36
// todo4user: add other modules as needed
37
// version: 0.0.0
38
// changelog: - 0.0.0, initial release
39
//            - ...
40
////////////////////////////////////////////////////////////////////////////////
41
 
42
 
43
module picoblaze_wb_uart (
44
  p_rst_n_i,
45
  p_clk_i,
46
 
47
  p_uart_rx_si_i,
48
  p_uart_tx_so_o
49
);
50
 
51
  input p_rst_n_i;
52
  wire  p_rst_n_i;
53
  input p_clk_i;
54
  wire  p_clk_i;
55
 
56
  input p_uart_rx_si_i;
57
  wire  p_uart_rx_si_i;
58
  output p_uart_tx_so_o;
59
  wire   p_uart_tx_so_o;
60
 
61
  reg rst;
62
  wire clk;
63
 
64
  wire wb_cyc;
65
  wire wb_stb;
66
  wire wb_we;
67
  wire[7:0] wb_adr;
68
  wire[7:0] wb_dat_m2s;
69
  wire[7:0] wb_dat_s2m;
70
  wire wb_ack;
71
 
72
  wire pb_write_strobe;
73
  wire pb_read_strobe;
74
  wire[7:0] pb_port_id;
75
  wire[7:0] pb_in_port;
76
  wire[7:0] pb_out_port;
77
 
78
  wire[17:0] instruction;
79
  wire[9:0] address;
80
 
81
  wire interrupt;
82
  wire interrupt_ack;
83
 
84
  // reset synchronisation
85 26 ste.fis
  always@(posedge clk)
86 12 ste.fis
    rst <= ! p_rst_n_i;
87
  assign clk = p_clk_i;
88
 
89
  // module instances
90
  ///////////////////
91
 
92
  kcpsm3 inst_kcpsm3 (
93
    .address(address),
94
    .instruction(instruction),
95
    .port_id(pb_port_id),
96
    .write_strobe(pb_write_strobe),
97
    .out_port(pb_out_port),
98
    .read_strobe(pb_read_strobe),
99
    .in_port(pb_in_port),
100
    .interrupt(interrupt),
101
    .interrupt_ack(interrupt_ack),
102
    .reset(rst),
103
    .clk(clk)
104
  );
105
 
106
  pbwbuart inst_pbwbuart (
107
    .address(address),
108
    .instruction(instruction),
109
    .clk(clk)
110
  );
111
 
112
  wbm_picoblaze inst_wbm_picoblaze (
113
    .rst(rst),
114
    .clk(clk),
115
 
116
    .wbm_cyc_o(wb_cyc),
117
    .wbm_stb_o(wb_stb),
118
    .wbm_we_o(wb_we),
119
    .wbm_adr_o(wb_adr),
120
    .wbm_dat_m2s_o(wb_dat_m2s),
121
    .wbm_dat_s2m_i(wb_dat_s2m),
122
    .wbm_ack_i(wb_ack),
123
 
124
    .pb_port_id_i(pb_port_id),
125
    .pb_write_strobe_i(pb_write_strobe),
126
    .pb_out_port_i(pb_out_port),
127
    .pb_read_strobe_i(pb_read_strobe),
128
    .pb_in_port_o(pb_in_port)
129
  );
130
 
131
  wbs_uart inst_wbs_uart (
132
    .rst(rst),
133
    .clk(clk),
134
 
135
    .wbs_cyc_i(wb_cyc),
136
    .wbs_stb_i(wb_stb),
137
    .wbs_we_i(wb_we),
138
    .wbs_adr_i(wb_adr),
139
    .wbs_dat_m2s_i(wb_dat_m2s),
140
    .wbs_dat_s2m_o(wb_dat_s2m),
141
    .wbs_ack_o(wb_ack),
142
 
143
    .uart_rx_si_i(p_uart_rx_si_i),
144
    .uart_tx_so_o(p_uart_tx_so_o)
145
  );
146
 
147
endmodule

powered by: WebSVN 2.1.0

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