1 |
118 |
creep |
////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// T6507LP IP Core ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This file is part of the T6507LP project ////
|
6 |
|
|
//// http://www.opencores.org/cores/t6507lp/ ////
|
7 |
|
|
//// ////
|
8 |
|
|
//// Description ////
|
9 |
|
|
//// Implementation of a 6507-compatible microprocessor ////
|
10 |
|
|
//// ////
|
11 |
|
|
//// To Do: ////
|
12 |
|
|
//// - Everything ////
|
13 |
|
|
//// ////
|
14 |
|
|
//// Author(s): ////
|
15 |
|
|
//// - Gabriel Oshiro Zardo, gabrieloshiro@gmail.com ////
|
16 |
|
|
//// - Samuel Nascimento Pagliarini (creep), snpagliarini@gmail.com ////
|
17 |
|
|
//// ////
|
18 |
|
|
////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
//// ////
|
20 |
|
|
//// Copyright (C) 2001 Authors and OPENCORES.ORG ////
|
21 |
|
|
//// ////
|
22 |
|
|
//// This source file may be used and distributed without ////
|
23 |
|
|
//// restriction provided that this copyright statement is not ////
|
24 |
|
|
//// removed from the file and that any derivative work contains ////
|
25 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
26 |
|
|
//// ////
|
27 |
|
|
//// This source file is free software; you can redistribute it ////
|
28 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
29 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
30 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
31 |
|
|
//// later version. ////
|
32 |
|
|
//// ////
|
33 |
|
|
//// This source is distributed in the hope that it will be ////
|
34 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
35 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
36 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
37 |
|
|
//// details. ////
|
38 |
|
|
//// ////
|
39 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
40 |
|
|
//// Public License along with this source; if not, download it ////
|
41 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
42 |
|
|
//// ////
|
43 |
|
|
////////////////////////////////////////////////////////////////////////////
|
44 |
|
|
|
45 |
|
|
`include "timescale.v"
|
46 |
|
|
|
47 |
128 |
gabrielosh |
//`include "T6507LP_ALU.v"
|
48 |
|
|
//`include "t6507lp_fsm.v"
|
49 |
118 |
creep |
|
50 |
|
|
module t6507lp(clk, reset_n, data_in, rw_mem, data_out, address);
|
51 |
|
|
parameter [3:0] DATA_SIZE = 4'd8;
|
52 |
|
|
parameter [3:0] ADDR_SIZE = 4'd13;
|
53 |
|
|
|
54 |
|
|
localparam [3:0] DATA_SIZE_ = DATA_SIZE - 4'b0001;
|
55 |
|
|
localparam [3:0] ADDR_SIZE_ = ADDR_SIZE - 4'b0001;
|
56 |
|
|
|
57 |
|
|
// note: in the top level inputs are just inputs, outputs are just outputs and the internal signals are wired.
|
58 |
|
|
input clk;
|
59 |
|
|
input reset_n;
|
60 |
|
|
input [DATA_SIZE_:0] data_in;
|
61 |
|
|
output rw_mem;
|
62 |
|
|
output [DATA_SIZE_:0] data_out;
|
63 |
|
|
output [ADDR_SIZE_:0] address;
|
64 |
|
|
|
65 |
|
|
wire [DATA_SIZE_:0] alu_result;
|
66 |
|
|
wire [DATA_SIZE_:0] alu_status;
|
67 |
|
|
wire [DATA_SIZE_:0] alu_x;
|
68 |
|
|
wire [DATA_SIZE_:0] alu_y;
|
69 |
|
|
wire [DATA_SIZE_:0] alu_opcode;
|
70 |
|
|
wire [DATA_SIZE_:0] alu_a;
|
71 |
|
|
wire alu_enable;
|
72 |
|
|
|
73 |
|
|
// `include "T6507LP_Package.v"
|
74 |
128 |
gabrielosh |
//TODO change rw_mem to mem_rw
|
75 |
118 |
creep |
t6507lp_fsm #(DATA_SIZE, ADDR_SIZE) t6507lp_fsm(
|
76 |
|
|
.clk (clk),
|
77 |
|
|
.reset_n (reset_n),
|
78 |
|
|
.alu_result (alu_result),
|
79 |
|
|
.alu_status (alu_status),
|
80 |
|
|
.data_in (data_in),
|
81 |
|
|
.alu_x (alu_x),
|
82 |
|
|
.alu_y (alu_y),
|
83 |
|
|
.address (address),
|
84 |
128 |
gabrielosh |
.mem_rw (rw_mem),
|
85 |
118 |
creep |
.data_out (data_out),
|
86 |
|
|
.alu_opcode (alu_opcode),
|
87 |
|
|
.alu_a (alu_a),
|
88 |
|
|
.alu_enable (alu_enable)
|
89 |
|
|
);
|
90 |
|
|
|
91 |
|
|
T6507LP_ALU T6507LP_ALU (
|
92 |
|
|
.clk_i (clk),
|
93 |
|
|
.n_rst_i (reset_n),
|
94 |
|
|
.alu_enable (alu_enable),
|
95 |
|
|
.alu_result (alu_result),
|
96 |
|
|
.alu_status (alu_status),
|
97 |
|
|
.alu_opcode (alu_opcode),
|
98 |
|
|
.alu_a (alu_a),
|
99 |
|
|
.alu_x (alu_x),
|
100 |
|
|
.alu_y (alu_y)
|
101 |
|
|
);
|
102 |
|
|
endmodule
|