📄 mcuconnect.vhd
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity mcuconnect is
port(
--reset: in std_logic;
ALE : in STD_LOGIC; --ale signal
WR : in STD_LOGIC; --write signal
RD : in STD_LOGIC; -- read signal
RST : in STD_LOGIC; -- master reset signal
DTA : in STD_LOGIC; --data acknowledge signal
A : in STD_LOGIC_VECTOR(8 to 15); --high address input signal
RorW : out STD_LOGIC; -- read and write signal
AB : out STD_LOGIC_VECTOR(0 to 15); --address out signal
D : inout STD_LOGIC_VECTOR(0 to 7); --inout data and CPU connect signal
CS : out STD_LOGIC; -- slow coin select signal
DO : inout STD_LOGIC_VECTOR(0 to 7) --inout data and other slow coin signal
);
end mcuconnect;
--}} End of automatically maintained section
architecture mcuconnect of mcuconnect is
signal ABird : std_logic_vector(0 to 7);
signal tempR : std_logic;
signal tempW : std_logic;
signal CStemp : std_logic;
signal CKtemp : std_logic_vector(1 to 3);
signal PR : std_logic;
signal LatchALE : std_logic;
signal CSmiddle : std_logic;
signal Dtemp : std_logic_vector(0 to 7);
signal DOtemp : std_logic_vector(0 to 7);
begin
CStemp <= not(A(15) and A(14) and not A(13) and not A(12));
CKtemp(1) <= not((WR and RD) or CStemp);
CKtemp(2) <= not(CStemp or RD);
CKtemp(3) <= not(CStemp or WR);
--PR <= not(not DTA or RST); -- DTA high effective
PR <= DTA and not RST; -- DTA low effective
-- enter your statements here --
process(ALE)
begin
if(ALE'EVENT and ALE = '0') then
ABird <= D;
end if;
end process;
process(CKtemp(3))
begin
if(CKtemp(3)'EVENT and CKtemp(3)='1') then
Dtemp <= D;
end if;
end process;
process(PR,CKtemp)
begin
if(PR = '0') then --DTA low effective
CSmiddle <= '1';
tempR <= '1';
tempW <= '1';
else
if(CKtemp(1)'EVENT and CKtemp(1)='1') then
CSmiddle <= '0';
end if;
if(CKtemp(2)'EVENTt and CKtemp(2)='1') then
tempR <= '0';
end if;
if(CKtemp(3)'EVENT and CKtemp(3)='1') then
tempW <= '0';
end if;
end if;
CS<= CSmiddle;
LatchALE <= CSmiddle and ALE;
end process;
process(LatchALE)
begin
if(LatchALE'EVENT and LatchALE='0') then
AB(0 to 7) <= D;
AB(8 to 15) <= A;
end if;
end process;
process(CKtemp(2))
begin
if(CKtemp(2)='1') then
D <= DOtemp;
else
D <= "ZZZZZZZZ";
end if;
end process;
process(tempR)
begin
if(tempR'EVENT and tempR='1') then
DOtemp <= DO;
end if;
end process;
process(tempW)
begin
if(tempW='0') then
DO <= Dtemp;
else
DO <= "ZZZZZZZZ";
end if;
end process;
RorW <= tempW or not tempR;
end mcuconnect;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -