📄 cfg_rom.vhd
字号:
--*****************************************************************************
-- FILE : CFG_ROM.vhd
-- DATE : 1.9.1999
-- REVISION: 1.1
-- DESIGNER: KA
-- Descr :
-- Entities: CFG_ROM
-- Changes :
-- ******************************************************
-- * Configuration Space ROM Entity *
-- ******************************************************
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
library WORK;
use WORK.CFGSPACE_SET.all;
entity CFG_ROM is
port(
ADR : in std_logic_vector(3 downto 0);
DATA : out std_logic_vector(31 downto 0)
); end CFG_ROM;
--
-- ******************************************************
-- * Architecture *
-- ******************************************************
architecture RTL of CFG_ROM is
subtype ROM_WORD is std_logic_vector (31 downto 0);
type ROM_TABLE is array (0 to 15) of ROM_WORD;
constant Zero_32 :ROM_WORD := "00000000000000000000000000000000";
constant RomWord13 :ROM_WORD := "000000000000000000000000"& CAP_PTR;
constant RomWord15 :ROM_WORD := MAX_LAT & MIN_GNT & INT_PIN &INT_LINE;
constant ROM: ROM_TABLE := ROM_TABLE'(
ROM_WORD'(DEVICE_ID & VENDOR_ID), -- Device ID + Vendor ID
ROM_WORD'(Zero_32), -- Unused (Status & Command)
ROM_WORD'(CLASS_ID & REV_ID), -- Class ID & SubClass &
Interface & Revision ID
ROM_WORD'(Zero_32), -- BIST + Header Type + Latency
Timer + Cache Line Size
ROM_WORD'(BAR0_MAP), -- BAR 0
ROM_WORD'(BAR1_MAP), -- BAR 1
ROM_WORD'(BAR2_MAP), -- BAR 2
ROM_WORD'(BAR3_MAP), -- BAR 3
ROM_WORD'(BAR4_MAP), -- BAR 4
ROM_WORD'(BAR5_MAP), -- BAR 5
ROM_WORD'(Zero_32), -- CIS Pointer
ROM_WORD'(SUBDEVICE_ID & SUBVENDOR_ID),-- Subsystem Device ID +
Subsystem Vendor ID
ROM_WORD'(EBAR_MAP), -- Expansion ROM BAR
ROM_WORD'(RomWord13), -- Reserved + CAP_PTR
ROM_WORD'(Zero_32), -- Reserved
ROM_WORD'(MAX_LAT & MIN_GNT & INT_PIN &INT_LINE)); -- Max_LAT +
Min_Gnt + Interrupt Pin + Interrupt Line
signal ADRi :integer range 0 to 15;
begin
ADRi <= CONV_INTEGER(ADR);
DATA <= ROM(ADRi); -- Read from the ROM
end RTL;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -