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

Subversion Repositories steelcore

[/] [soc/] [soc_top.v] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 rafaelcalc
//////////////////////////////////////////////////////////////////////////////////
2
// Engineer: Rafael de Oliveira Calçada (rafaelcalcada@gmail.com) 
3
// 
4
// Create Date: 04.07.2020 20:56:52
5
// Module Name: soc_top
6
// Project Name: Steel SoC 
7
// Description: Example system built with Steel Core 
8
// 
9
// Dependencies: globals.vh
10
//               machine_control.v
11
//               alu.v
12
//               integer_file.v
13
//               branch_unit.v
14
//               decoder.v
15
//               csr_file.v
16
//               imm_generator.v
17
//               load_unit.v
18
//               store_unit.v
19
//               steel_top.v
20
//               bus_arbiter.v
21
//               ram.v
22
//               uart_tx.v
23
// 
24
// Version 0.01
25
// 
26
//////////////////////////////////////////////////////////////////////////////////
27
 
28
/*********************************************************************************
29
 
30
MIT License
31
 
32
Copyright (c) 2020 Rafael de Oliveira Calçada
33
 
34
Permission is hereby granted, free of charge, to any person obtaining a copy
35
of this software and associated documentation files (the "Software"), to deal
36
in the Software without restriction, including without limitation the rights
37
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
38
copies of the Software, and to permit persons to whom the Software is
39
furnished to do so, subject to the following conditions:
40
 
41
The above copyright notice and this permission notice shall be included in all
42
copies or substantial portions of the Software.
43
 
44
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
48
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
49
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
50
SOFTWARE.
51
 
52
********************************************************************************/
53
 
54
`timescale 1ns / 1ps
55
 
56
module soc_top #(
57
 
58
    parameter BOOT_ADDRESS = 32'h00000014
59
 
60
    )(
61
 
62
    input wire CLK, // 100MHz (Nexys4 clock speed)
63
    input wire RESET,
64
 
65
    output wire UART_TX
66
 
67
    );
68
 
69
    wire e_irq;
70
    wire [31:0] daddr_uart;
71
    wire [31:0] daddr_core;
72
    wire [31:0] daddr_mem;
73
    wire [31:0] dout_uart;
74
    wire [31:0] dout_core;
75
    wire [31:0] dout_mem;
76
    wire wr_req_uart;
77
    wire wr_req_core;
78
        wire wr_req_mem;
79
    wire [31:0] din_uart;
80
    wire [31:0] din_core;
81
    wire [31:0] din_mem;
82
    wire [3:0] wr_mask_core;
83
    wire [3:0] wr_mask_mem;
84
    wire [31:0] i_addr;
85
    wire [31:0] instr;
86
 
87
        reg clk50mhz = 1'b0;
88
        always @(posedge CLK) clk50mhz <= !clk50mhz;
89
 
90
    steel_top #(
91
 
92
        .BOOT_ADDRESS(BOOT_ADDRESS)
93
 
94
        ) core (
95
 
96
        .CLK(clk50mhz),
97
        .RESET(RESET),
98
        .REAL_TIME(64'b0),
99
        .I_ADDR(i_addr),
100
        .INSTR(instr),
101
        .D_ADDR(daddr_core),
102
        .DATA_OUT(dout_core),
103
        .WR_REQ(wr_req_core),
104
        .WR_MASK(wr_mask_core),
105
        .DATA_IN(din_core),
106
        .E_IRQ(1'b0),
107
        .T_IRQ(1'b0),
108
        .S_IRQ(1'b0)
109
 
110
        );
111
 
112
    bus_arbiter ba(
113
 
114
        .CLK(clk50mhz),
115
        .RESET(RESET),
116
        .D_ADDR(daddr_core),
117
        .DATA_OUT(dout_core),
118
        .WR_REQ(wr_req_core),
119
        .WR_MASK(wr_mask_core),
120
        .DATA_IN(din_core),
121
 
122
        .D_ADDR_1(daddr_uart),
123
        .DATA_OUT_1(dout_uart),
124
        .WR_MASK_1(),
125
        .WR_REQ_1(wr_req_uart),
126
        .DATA_IN_1(din_uart),
127
 
128
        .D_ADDR_2(daddr_mem),
129
        .DATA_OUT_2(dout_mem),
130
        .WR_REQ_2(wr_req_mem),
131
        .WR_MASK_2(wr_mask_mem),
132
        .DATA_IN_2(din_mem)
133
 
134
        );
135
 
136
    ram mem(
137
 
138
        .CLK(clk50mhz),
139
        .ADDRA(daddr_mem[12:2]),
140
        .ADDRB(i_addr[12:2]),
141
        .DINA(dout_mem),
142
        .WEA(wr_mask_mem),
143
        .DOUTA(din_mem),
144
        .DOUTB(instr)
145
 
146
        );
147
 
148
    uart_tx utx(
149
 
150
        .CLK(clk50mhz),
151
        .WDATA(dout_uart[7:0]),
152
        .WR_EN(wr_req_uart),
153
        .RDATA(din_uart),
154
        .TX(UART_TX)
155
 
156
        );
157
 
158
endmodule

powered by: WebSVN 2.1.0

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