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

Subversion Repositories pss

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

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 5 AlexAntono
 Version 0.99
8 2 AlexAntono
 
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 5 AlexAntono
        .A31_DEFAULT(1),
77 9 AlexAntono
        .MEM_DATA("<path_to_svn>/pss/trunk/pss/SW/onboard/Heartbeat/Heartbeat.hex"),
78 2 AlexAntono
        .MEM_SIZE_KB(8)
79
)
80 5 AlexAntono
PSS
81 2 AlexAntono
(
82
        .clk_i(clk_i),
83
        .arst_i(rst_i),
84 5 AlexAntono
        .srst_i(0),
85 2 AlexAntono
        .srst_o(sync_reset),
86
 
87
        .rx_i(rx_i),
88
        .tx_o(tx_o),
89
 
90 5 AlexAntono
        .INT_bi(interrupts),
91 2 AlexAntono
 
92
        .xport_req_o(uc_bus_enb),
93
        .xport_ack_i(1'b1),
94
        .xport_err_i(1'b0),
95
        .xport_we_o(uc_bus_we),
96
        .xport_addr_bo(uc_bus_addr),
97
        .xport_wdata_bo(uc_bus_wdata),
98
        .xport_resp_i(uc_bus_resp),
99
        .xport_rdata_bi(uc_bus_rdata)
100
);
101
 
102
always @(posedge clk_i)
103
        begin
104
        if (rst_i) uc_bus_rdata <= 32'h0;
105
        else if (uc_bus_addr == 32'h8A000000) uc_bus_rdata <= SW;
106
        else uc_bus_rdata <= uc_bus_addr;
107
        end
108
 
109
always @(posedge clk_i)
110
        begin
111
        if (rst_i)
112
                uc_bus_resp <= 1'b0;
113
        else if ( (uc_bus_enb == 1'b1) && (uc_bus_we == 1'b0) )
114
                uc_bus_resp <= 1'b1;
115
        else
116
                uc_bus_resp <= 1'b0;
117
        end
118
 
119
always @(posedge clk_i)
120
        begin
121
        if (sync_reset)
122
                LED <= 8'hAA;
123
        else if (uc_bus_we)
124
                LED <= uc_bus_wdata;
125
        end
126
 
127
//assign uc_bus_rdata = uc_bus_addr;
128
 
129
endmodule

powered by: WebSVN 2.1.0

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