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

Subversion Repositories edge

[/] [edge/] [trunk/] [HW/] [Boards/] [Atlys/] [edge_atlys_processor.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 heshamelma
//////////////////////////////////////////////////////////////////
2
//                                                              //
3
//  Top level module for Edge project on Atlys board            //               
4
//                                                              //
5
//  This file is part of the Edge project                       //
6
//  http://www.opencores.org/project,edge                       //
7
//                                                              //
8
//  Description                                                 //
9
//   Top level module conatining Edge core, data memory,        //
10
//   instruction memory, uart controller and others to run on   //
11
//   Atyls board.                                               //
12
//                                                              //
13
//  Author(s):                                                  //
14
//      - Hesham AL-Matary, heshamelmatary@gmail.com            //
15
//                                                              //
16
//////////////////////////////////////////////////////////////////
17
//                                                              //
18
// Copyright (C) 2014 Authors and OPENCORES.ORG                 //
19
//                                                              //
20
// This source file may be used and distributed without         //
21
// restriction provided that this copyright statement is not    //
22
// removed from the file and that any derivative work contains  //
23
// the original copyright notice and the associated disclaimer. //
24
//                                                              //
25
// This source file is free software; you can redistribute it   //
26
// and/or modify it under the terms of the GNU Lesser General   //
27
// Public License as published by the Free Software Foundation; //
28
// either version 2.1 of the License, or (at your option) any   //
29
// later version.                                               //
30
//                                                              //
31
// This source is distributed in the hope that it will be       //
32
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
33
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
34
// PURPOSE.  See the GNU Lesser General Public License for more //
35
// details.                                                     //
36
//                                                              //
37
// You should have received a copy of the GNU Lesser General    //
38
// Public License along with this source; if not, download it   //
39
// from http://www.opencores.org/lgpl.shtml                     //
40
//                                                              //
41
//////////////////////////////////////////////////////////////////
42
 
43
module top_level
44
#
45
(
46
  parameter N=32,
47
  parameter M=5
48
)
49
(
50
  input CLK,
51
  input RESET,
52
  output[7:0] LED,
53
 
54
  output wire UART_TXD // UART send data
55
);
56
 
57
wire CLK_2x;
58
wire CLK_50MHz;
59
wire reset;
60
 
61
/* Insruction Memory in-out wires */
62
wire[N-1:0] pc_toIMemory;
63
wire[N-1:0] instr_fromIMemory;
64
 
65
/* Data Memory in-out wires */
66
wire[N-1:0] Address_toDMemory, WriteData_toDMemory;
67
wire MemWrite_toDMemory;
68
wire[N-1:0] RD_fromDMemory;
69
wire UART_VALID;
70
wire[N-1:0] UART_TX;
71
wire UART_READY;
72
wire StallDataMemory;
73
wire[1:0] MemRefSize;
74
wire CP0_TimerIntMatch;
75
wire IO_TimerIntReset;
76
 
77
reg[31:0] UART_CTRL = 0;
78
wire[31:0] UART_CTRL_TO_DMEM;
79
 
80
clock_manager
81
#
82
(
83
  .CLK_OUT(100000000/2)
84
)
85
clk_divider
86
(
87
  .clk_in(CLK),
88
  .clk_out(CLK_50MHz)
89
);
90
 
91
clock_manager
92
#(.CLK_OUT(100000000/2)
93
  )
94
clk_div2x(
95
   .clk_in(CLK),
96
   .clk_out(CLK_2x)
97
);
98
 
99
reset_logic reset_logic
100
(
101
  .reset_interrupt(RESET),
102
  .clk(CLK_50MHz),
103
  .reset(reset)
104
);
105
 
106
  /* Instantiate the Unit Under Test (UUT) */
107
Edge_Core Edge
108
(
109
  .clk(CLK_50MHz),
110
  .reset(reset),
111
  .pc_toIMemory(pc_toIMemory),
112
  .instr_fromIMemory(instr_fromIMemory),
113
 
114
  .Address_toDMemory(Address_toDMemory),
115
  .WriteData_toDMemory(WriteData_toDMemory),
116
  .MemWrite_toDMemory(MemWrite_toDMemory),
117
  .MemRefSize(MemRefSize),
118
  .RD_fromDMemory(RD_fromDMemory),
119
  .StallDataMemory(StallDataMemory),
120
 
121
  .CP0_TimerIntMatch(CP0_TimerIntMatch),
122
  .IO_TimerIntReset(IO_TimerIntReset)
123
);
124
 
125
 
126
/* Instantiate Insturction Memory */
127
Instruction_Memory ins_mem
128
(
129
  .CLK(CLK),
130
  .reset(reset),
131
  .address(pc_toIMemory),
132
  .dout(instr_fromIMemory)
133
);
134
 
135
/* Instantiate Data Memory */
136
Memory_System mem_io
137
(
138
  .clk(CLK_50MHz),
139
  .ProcessorAddress(Address_toDMemory),
140
  .WriteData(WriteData_toDMemory),
141
  .WE(MemWrite_toDMemory),
142
  .RD(RD_fromDMemory),
143
 
144
  .UART_TX(UART_TX),
145
  .UART_VALID(UART_VALID),
146
  .UART_CTRL(UART_CTRL_TO_DMEM),
147
  .CP0_TimerIntMatch(CP0_TimerIntMatch),
148
  .StallBusy(StallDataMemory),
149
  .MemRefSize(MemRefSize),
150
  .LEDs(LED),
151
  .IO_TimerIntReset(IO_TimerIntReset)
152
);
153
 
154
/* UART Transmitter to PC */
155
UART_TX_CTRL serial_tty
156
(
157
  .SEND(UART_VALID),
158
  .DATA(UART_TX[7:0]),
159
  .CLK(CLK_50MHz),
160
  .READY(UART_READY),
161
  .UART_TX(UART_TXD)
162
);
163
 
164
always @(posedge CLK_50MHz)
165
  if(UART_READY)
166
    UART_CTRL[0] = 1;
167
  else
168
    UART_CTRL[0] = 0;
169
 
170
assign UART_CTRL_TO_DMEM = UART_CTRL;
171
 
172
endmodule

powered by: WebSVN 2.1.0

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