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

Subversion Repositories System09

[/] [System09/] [trunk/] [rtl/] [Cyclone2/] [wb_rom.vhd] - Blame information for rev 116

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 116 dilbert57
--===========================================================================--
2
--
3
--  S Y N T H E Z I A B L E    ROM / WISHBONE interface
4
--
5
--  www.OpenCores.Org - August 2003
6
--  This core adheres to the GNU public license  
7
--
8
-- File name      : wb_rom.vhd
9
--
10
-- Purpose        : Implements a WISHBONE compatble interface
11
--                  for an External ROM
12
--
13
-- Dependencies   : ieee.Std_Logic_1164
14
--                  ieee.std_logic_unsigned
15
--                                                                      work.std_logic_arith (MTI's mti_std_logic_arith.vhd)
16
--
17
-- Author         : Michael L. Hasenfratz Sr.
18
--
19
--===========================================================================----
20
--
21
-- Revision History:
22
--
23
-- Date:          Revision         Author
24
--===========================================================================--
25
-- 5 Aug 2003       0.1              Michael L. Hasenfratz Sr.
26
--      Created
27
--
28
 
29
library ieee;
30
use ieee.std_logic_1164.all;
31
use ieee.std_logic_unsigned.all;
32
use ieee.std_logic_arith.all;
33
 
34
entity wb_rom is
35
        generic (
36
                ROM_WIDTH       :               positive        range 1 to 64 := 8;                             -- data bits WIDE
37
                ROM_WIDTHAD :   positive        range 1 to 32   := 8                            -- address bits;
38
        );
39
        port (
40
          DAT_O :      out std_logic_vector(ROM_WIDTH-1 downto 0);
41
                ADR_I :      in  std_logic_vector(ROM_WIDTHAD-1 downto 0);
42
                SEL_I :      in  std_logic_vector((ROM_WIDTH/8)-1 downto 0);
43
                STB_I :      in  std_logic;             -- VMA (Valid Memory Access)
44
                CYC_I :      in  std_logic;             -- CYC in progress
45
                ACK_O :      out std_logic;             -- Data ready
46
 
47
                rom_adr :    out std_logic_vector(ROM_WIDTHAD-1 downto 0);
48
          rom_dat :    in  std_logic_vector(ROM_WIDTH-1 downto 0);
49
          rom_csn :    out std_logic;           -- ROM Chip Select
50
          rom_oen :    out std_logic            -- ROM Output Enable
51
        );
52
end;
53
 
54
architecture bhv_wb_rom of wb_rom is
55
 
56
        signal  sel :                   std_logic;              -- internal SELECT
57
 
58
begin
59
 
60
---------------------------------------------------------
61
--      Interconnections
62
---------------------------------------------------------
63
sel0 :  process(SEL_I, CYC_I, STB_I)
64
        variable        isel :          std_logic;
65
        begin
66
                isel    := '0';          -- reset 'or'
67
                -- look for ANY selects
68
                for idx in SEL_I'RANGE loop
69
                        isel    := isel or SEL_I(idx);
70
                end loop;
71
                sel             <= isel and CYC_I;
72
        end process;
73
 
74
        rom_adr <= ADR_I;
75
        rom_csn <= not(sel);
76
        rom_oen <= not(sel) and STB_I;
77
 
78
        DAT_O           <= rom_dat;
79
        ACK_O           <= sel and STB_I;
80
 
81
end bhv_wb_rom;
82
 

powered by: WebSVN 2.1.0

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