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

Subversion Repositories pss

[/] [pss/] [trunk/] [pss/] [hdl/] [pss_soc_top.v] - Blame information for rev 4

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 pss_soc_top
38
(
39
        input clk_i, rst_i,
40
 
41
        input rx_i,
42
        output tx_o,
43
 
44
        input ext_int_i,
45
 
46
        input  [7:0] SW,
47
        output reg [7:0] LED
48
);
49
 
50
wire sync_reset;
51
 
52
wire uc_bus_enb;
53
wire uc_bus_we;
54
wire [31:0] uc_bus_addr;
55
wire [31:0] uc_bus_wdata;
56
reg [31:0] uc_bus_rdata;
57
reg uc_bus_resp;
58
 
59
wire ext_int;
60
debouncer debouncer
61
(
62
        .clk_i(clk_i),
63
        .rst_i(rst_i),
64
 
65
        .in_i(ext_int_i),
66
        .out_o(ext_int)
67
);
68
 
69
wire [3:0] interrupts;
70
assign interrupts = {3'h0, ext_int};
71
 
72
pss
73
#(
74
        .CPU_PRESENT(1),
75
        .CPU_RESET_DEFAULT(0),
76
        .A31_DEFAULTS(1),
77 4 AlexAntono
        .MEM_DATA("print_your_full_hex_filename"),
78 2 AlexAntono
        .MEM_SIZE_KB(8)
79
)
80
pss
81
(
82
        .clk_i(clk_i),
83
        .arst_i(rst_i),
84
        .srst_o(sync_reset),
85
 
86
        .rx_i(rx_i),
87
        .tx_o(tx_o),
88
 
89
        .INT_i(interrupts),
90
 
91
        .xport_req_o(uc_bus_enb),
92
        .xport_ack_i(1'b1),
93
        .xport_err_i(1'b0),
94
        .xport_we_o(uc_bus_we),
95
        .xport_addr_bo(uc_bus_addr),
96
        .xport_wdata_bo(uc_bus_wdata),
97
        .xport_resp_i(uc_bus_resp),
98
        .xport_rdata_bi(uc_bus_rdata)
99
);
100
 
101
always @(posedge clk_i)
102
        begin
103
        if (rst_i) uc_bus_rdata <= 32'h0;
104
        else if (uc_bus_addr == 32'h8A000000) uc_bus_rdata <= SW;
105
        else uc_bus_rdata <= uc_bus_addr;
106
        end
107
 
108
always @(posedge clk_i)
109
        begin
110
        if (rst_i)
111
                uc_bus_resp <= 1'b0;
112
        else if ( (uc_bus_enb == 1'b1) && (uc_bus_we == 1'b0) )
113
                uc_bus_resp <= 1'b1;
114
        else
115
                uc_bus_resp <= 1'b0;
116
        end
117
 
118
always @(posedge clk_i)
119
        begin
120
        if (sync_reset)
121
                LED <= 8'hAA;
122
        else if (uc_bus_we)
123
                LED <= uc_bus_wdata;
124
        end
125
 
126
//assign uc_bus_rdata = uc_bus_addr;
127
 
128
endmodule

powered by: WebSVN 2.1.0

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