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

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [rtl/] [verilog/] [t6532.v] - Blame information for rev 193

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 192 creep
////////////////////////////////////////////////////////////////////////////
2
////                                                                    ////
3
//// t6532 IP Core                                                      ////
4
////                                                                    ////
5
//// This file is part of the t2600 project                             ////
6
//// http://www.opencores.org/cores/t2600/                              ////
7
////                                                                    ////
8
//// Description                                                        ////
9
//// 6532 top level                                                     ////
10
////                                                                    ////
11
//// TODO:                                                              ////
12
//// - Add the timer, ram and i/o                                       ////
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 193 creep
module t6532(clk, io_lines, enable, rw_mem, address, data);
48 192 creep
        parameter [3:0] DATA_SIZE = 4'd8;
49
        parameter [3:0] ADDR_SIZE = 4'd7; // this is the *local* addr_size
50
 
51
        localparam [3:0] DATA_SIZE_ = DATA_SIZE - 4'd1;
52
        localparam [3:0] ADDR_SIZE_ = ADDR_SIZE - 4'd1;
53
 
54
        input clk;
55
        input [15:0] io_lines;
56
        input enable;
57 193 creep
        input rw_mem;
58 192 creep
        input [ADDR_SIZE_:0] address;
59
        inout [DATA_SIZE_:0] data;
60 193 creep
 
61
        wire [DATA_SIZE_:0] ram [127:0];
62
        wire [DATA_SIZE_:0] io_ports [3:0]; // porta, portaddr, portb, portbddr
63
 
64
        reg [DATA_SIZE_:0] data_drv;
65
 
66
        assign data = (rw_mem) ? 8'bZ: data_drv; // if i am writing the bus receives the data from cpu  
67
 
68
        t6532_io t6532_io (
69
                .clk            (clk),
70
                .io_lines       (io_lines),
71
                .ddra           (io_ports[1]),
72
                .A              (io_ports[0]),
73
                .B              (io_ports[2])
74
        );
75
 
76
        always @(clk) begin
77
                if (enable && rw_mem) begin
78
                        case (address)
79
                                8'h80: data_drv <= io_ports[0];
80
                                default: ;
81
                        endcase
82
                end
83
        end
84
 
85
        always @(*) begin
86
                io_ports [3] = 8'h00; // portb ddr is always input
87
        end
88
 
89
        // io
90
        // timer
91
        // ram
92 192 creep
 
93
endmodule

powered by: WebSVN 2.1.0

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