📄 p2_drv_spec.vhd
字号:
--------------------------------------------------
-- Model : 8051 Behavioral Model,
-- VHDL Entity mc8051.p2_drv.interface
--
-- Author : Michael Mayer (mrmayer@computer.org),
-- Dr. Hardy J. Pottinger,
-- Department of Electrical Engineering
-- University of Missouri - Rolla
--
-- Created at : 09/22/98 19:32:40
--
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
LIBRARY mc8051 ;
USE mc8051.synth_pack.all;
ENTITY p2_drv IS
PORT(
addr_gb : IN std_logic_vector( 7 DOWNTO 0 ) ;
indirect_sel : IN std_logic ;
int_clk : IN std_logic ;
int_rst : IN std_logic ;
latch_pins : IN std_logic ;
p2_addr : IN std_logic_vector( 7 DOWNTO 0 ) ;
p2_ctrl : IN std_logic ;
rd_gb : IN std_logic ;
read_latch : IN std_logic ;
wr_gb : IN std_logic ;
acknow : OUT std_logic ;
P2 : INOUT std_logic_vector( 7 DOWNTO 0 ) ;
data_gb : INOUT std_logic_vector( 7 DOWNTO 0 )
);
-- Declarations
END p2_drv ;
--
-- VHDL Architecture mc8051.p2_drv.spec
--
-- Created:
-- by - mrmayer.UNKNOWN (eceultra20.ece.umr.edu)
-- at - 19:06:01 09/19/98
--
-- Generated by Mentor Graphics' Renoir(TM) 3.4 (Build 18)
--
architecture spec of p2_drv is
SIGNAL p2_reg : bvec := "00000000";
SIGNAL p2_sel : std_logic;
begin
-- The p2 is selected by addr A0 and NOT indirect_sel
p2_sel <= '1' WHEN (addr_gb = "10100000") AND (indirect_sel = '0') ELSE
'0';
-- The p2 is reset to 1's during reset,
-- set to the data_gb during a write to p2, or else left alone.
p2_reg <= "11111111" WHEN int_rst = '1' ELSE -- reset
unsigned(data_gb) WHEN (wr_gb = '1' AND p2_sel = '1') ELSE -- async
p2_reg;
p2 <= p2_addr WHEN p2_ctrl = '1' ELSE
std_logic_vector(to_high_imped(p2_reg));
-- The data_gb is driven with the p2_ref during a read from p2_reg,
-- or else left in high impedance.
data_gb <= to_x01(p2) WHEN rd_gb = '1' AND p2_sel = '1' AND read_latch = '0' ELSE
std_logic_vector(p2_reg) WHEN rd_gb = '1' AND p2_sel = '1' AND read_latch = '1' ELSE
"ZZZZZZZZ";
-- The acknowledge is pulled high when the global bus and p2
-- reg become equal (considered stable) and the p2 is selected.
acknow <= '1' WHEN data_gb = std_logic_vector(p2_reg) AND p2_sel = '1' ELSE
'Z';
end spec;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -