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

Subversion Repositories wb4pb

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

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 31 ste.fis
//    and/or other materials provided with the distribution.
17 12 ste.fis
//
18
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
19
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
20
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
21
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
22
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
23
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
24
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
25
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
26
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
27
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
28
// POSSIBILITY OF SUCH DAMAGE.
29
//
30
////////////////////////////////////////////////////////////////////////////////
31
// filename: picoblaze_wb_uart.v
32
// description: synthesizable PicoBlaze (TM) uart example using wishbone
33
// todo4user: add other modules as needed
34
// version: 0.0.0
35
// changelog: - 0.0.0, initial release
36
//            - ...
37
////////////////////////////////////////////////////////////////////////////////
38
 
39
 
40
module picoblaze_wb_uart (
41
  p_rst_n_i,
42
  p_clk_i,
43
 
44
  p_uart_rx_si_i,
45
  p_uart_tx_so_o
46
);
47
 
48
  input p_rst_n_i;
49
  wire  p_rst_n_i;
50
  input p_clk_i;
51
  wire  p_clk_i;
52
 
53
  input p_uart_rx_si_i;
54
  wire  p_uart_rx_si_i;
55
  output p_uart_tx_so_o;
56
  wire   p_uart_tx_so_o;
57
 
58
  reg rst;
59
  wire clk;
60
 
61
  wire wb_cyc;
62
  wire wb_stb;
63
  wire wb_we;
64
  wire[7:0] wb_adr;
65
  wire[7:0] wb_dat_m2s;
66
  wire[7:0] wb_dat_s2m;
67
  wire wb_ack;
68
 
69
  wire pb_write_strobe;
70
  wire pb_read_strobe;
71
  wire[7:0] pb_port_id;
72
  wire[7:0] pb_in_port;
73
  wire[7:0] pb_out_port;
74
 
75
  wire[17:0] instruction;
76
  wire[9:0] address;
77
 
78
  wire interrupt;
79
  wire interrupt_ack;
80
 
81
  // reset synchronisation
82 26 ste.fis
  always@(posedge clk)
83 12 ste.fis
    rst <= ! p_rst_n_i;
84
  assign clk = p_clk_i;
85
 
86
  // module instances
87
  ///////////////////
88
 
89
  kcpsm3 inst_kcpsm3 (
90
    .address(address),
91
    .instruction(instruction),
92
    .port_id(pb_port_id),
93
    .write_strobe(pb_write_strobe),
94
    .out_port(pb_out_port),
95
    .read_strobe(pb_read_strobe),
96
    .in_port(pb_in_port),
97
    .interrupt(interrupt),
98
    .interrupt_ack(interrupt_ack),
99
    .reset(rst),
100
    .clk(clk)
101
  );
102
 
103
  pbwbuart inst_pbwbuart (
104
    .address(address),
105
    .instruction(instruction),
106
    .clk(clk)
107
  );
108
 
109
  wbm_picoblaze inst_wbm_picoblaze (
110
    .rst(rst),
111
    .clk(clk),
112
 
113
    .wbm_cyc_o(wb_cyc),
114
    .wbm_stb_o(wb_stb),
115
    .wbm_we_o(wb_we),
116
    .wbm_adr_o(wb_adr),
117
    .wbm_dat_m2s_o(wb_dat_m2s),
118
    .wbm_dat_s2m_i(wb_dat_s2m),
119
    .wbm_ack_i(wb_ack),
120
 
121
    .pb_port_id_i(pb_port_id),
122
    .pb_write_strobe_i(pb_write_strobe),
123
    .pb_out_port_i(pb_out_port),
124
    .pb_read_strobe_i(pb_read_strobe),
125
    .pb_in_port_o(pb_in_port)
126
  );
127
 
128
  wbs_uart inst_wbs_uart (
129
    .rst(rst),
130
    .clk(clk),
131
 
132
    .wbs_cyc_i(wb_cyc),
133
    .wbs_stb_i(wb_stb),
134
    .wbs_we_i(wb_we),
135
    .wbs_adr_i(wb_adr),
136
    .wbs_dat_m2s_i(wb_dat_m2s),
137
    .wbs_dat_s2m_o(wb_dat_s2m),
138
    .wbs_ack_o(wb_ack),
139
 
140
    .uart_rx_si_i(p_uart_rx_si_i),
141
    .uart_tx_so_o(p_uart_tx_so_o)
142
  );
143
 
144
endmodule

powered by: WebSVN 2.1.0

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