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

Subversion Repositories simpcon

[/] [simpcon/] [trunk/] [vhdl/] [sc_isa.vhd] - Blame information for rev 29

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 martin
--
2 29 martin
--
3
--  This file is a part of JOP, the Java Optimized Processor
4
--
5
--  Copyright (C) 2001-2008, Martin Schoeberl (martin@jopdesign.com)
6
--
7
--  This program is free software: you can redistribute it and/or modify
8
--  it under the terms of the GNU General Public License as published by
9
--  the Free Software Foundation, either version 3 of the License, or
10
--  (at your option) any later version.
11
--
12
--  This program is distributed in the hope that it will be useful,
13
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
--  GNU General Public License for more details.
16
--
17
--  You should have received a copy of the GNU General Public License
18
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
--
20
 
21
 
22
--
23 15 martin
--      sc_isa.vhd
24
--
25
--      ISA bus for ethernet chip
26
--      
27
--      Author: Martin Schoeberl        martin@jopdesign.com
28
--
29
--
30
--      resources on Cyclone
31
--
32
--              xx LCs, max xx MHz
33
--
34
--
35
--      2005-12-28      changed for SimpCon
36
--
37
--      todo:
38
--
39
--
40
 
41
 
42
library ieee;
43
use ieee.std_logic_1164.all;
44
use ieee.numeric_std.all;
45
 
46
entity sc_isa is
47
generic (addr_bits : integer);
48
 
49
port (
50
        clk             : in std_logic;
51
        reset   : in std_logic;
52
 
53
-- SimpCon interface
54
 
55
        address         : in std_logic_vector(addr_bits-1 downto 0);
56
        wr_data         : in std_logic_vector(31 downto 0);
57
        rd, wr          : in std_logic;
58
        rd_data         : out std_logic_vector(31 downto 0);
59
        rdy_cnt         : out unsigned(1 downto 0);
60
 
61
-- ISA bus
62
 
63
        isa_d           : inout std_logic_vector(7 downto 0);
64
        isa_a           : out std_logic_vector(4 downto 0);
65
        isa_reset       : out std_logic;
66
        isa_nior        : out std_logic;
67
        isa_niow        : out std_logic
68
);
69
end sc_isa;
70
 
71
architecture rtl of sc_isa is
72
 
73
--
74
--      signal for isa data bus
75
--
76
        signal isa_data                 : std_logic_vector(7 downto 0);
77
        signal isa_dir                  : std_logic;            -- direction of isa_d ('1' means driving out)
78
 
79
begin
80
 
81
        rdy_cnt <= "00";        -- no wait states
82
 
83
--
84
--      The registered MUX is all we need for a SimpCon read.
85
--
86
process(clk, reset)
87
begin
88
 
89
        if (reset='1') then
90
                rd_data <= (others => '0');
91
        elsif rising_edge(clk) then
92
 
93
                if rd='1' then
94
                        -- no address decoding
95
                        rd_data <= std_logic_vector(to_unsigned(0, 24)) & isa_d;
96
                end if;
97
        end if;
98
 
99
end process;
100
 
101
 
102
--
103
--      SimpCon write is very simple
104
--
105
process(clk, reset)
106
 
107
begin
108
 
109
        if (reset='1') then
110
 
111
                isa_data <= (others => '0');
112
                isa_a <= (others => '0');
113
                isa_reset <= '0';
114
                isa_nior <= '1';
115
                isa_niow <= '1';
116
                isa_dir <= '0';
117
 
118
        elsif rising_edge(clk) then
119
 
120
                if wr='1' then
121
                        if address(0)='0' then
122
                                isa_a <= wr_data(4 downto 0);
123
                                isa_reset <= wr_data(5);
124
                                isa_nior <= not wr_data(6);
125
                                isa_niow <= not wr_data(7);
126
                                isa_dir <= wr_data(8);
127
                        else
128
                                isa_data <= wr_data(7 downto 0);
129
                        end if;
130
                end if;
131
 
132
        end if;
133
end process;
134
 
135
--
136
--      isa data bus
137
--
138
        isa_d <= isa_data when isa_dir='1' else "ZZZZZZZZ";
139
 
140
end rtl;

powered by: WebSVN 2.1.0

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