真你假我 2015-04-26 08:29
浏览 602

8255VHDL语言波形问题

下面的这个程序在ModelSim SE运行怎么没波形
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
USE IEEE.std_logic_arith.ALL;
USE IEEE.std_logic_unsigned.ALL;

ENTITY ppi IS
PORT(reset,rd,wr,cs,a0,a1:IN std_logic;
pa:INOUT std_logic_vector(7 downto 0);
pb:INOUT std_logic_vector(7 downto 0);
pcl:INOUT std_logic_vector(3 downto 0);
pch:INOUT std_logic_vector(3 downto 0);
d:INOUT std_logic_vector(7 downto 0));

END ppi;

ARCHITECTURE Behavioral OF ppi IS
SIGNAL internal_bus:std_logic_vector(7 downto 0);
SIGNAL st,ad,flag:std_logic_vector(1 downto 0);
SIGNAL ctrreg:std_logic_vector(7 downto 0);
SIGNAL pa_latch,pb_latch,pc_latch:std_logic_vector(7 downto 0);
BEGIN

PROCESS(rd,cs)
BEGIN
st<=ctrreg(3)&ctrreg(0);
IF(cs='0'AND rd='0')THEN
IF(a0='0' and a1='0' and ctrreg(4)='1')THEN
internal_bus<=(pa);
ELSIF(a0='1' and a1='1' and ctrreg(1)='1')THEN
internal_bus<=(pb);
ELSIF(a0='0' and a1='1' and st="01")THEN
internal_bus(3 downto 0)<=pcl(3 downto 0);
ELSIF(a0='0' and a1='1' and st="10")THEN
internal_bus(7 downto 0)<=pch(3 downto 0);
ELSIF(a0='0' and a1='1' and st="11" and ctrreg(7)='1')THEN
internal_bus(3 downto 0)<=pcl(3 downto 0);
internal_bus(7 downto 4)<=pch(3 downto 0);
END IF;
ELSE
internal_bus<="ZZZZZZZZ";
END IF;
d<=internal_bus;
END PROCESS;

PROCESS(cs,wr,reset)
BEGIN
IF(cs='0'and wr='0')THEN
ad<=a1&a0;
ctrreg(7)<=d(7);
internal_bus<=d;
END IF;
IF(reset='1')THEN
pa_latch<="00000000";
pb_latch<="00000000";
pc_latch<="00000000";
ctrreg<="10011011";
ELSIF(cs='0' and wr='0')THEN
IF(ctrreg(7)='1' and ad="11" and cs='0')THEN
ctrreg<=internal_bus;
ELSIF(ctrreg(7)='1' and cs='0' and ad="00")THEN
pa_latch<=internal_bus;
ELSIF(ctrreg(7)='1' and cs='0' and ad="01")THEN
pb_latch<=internal_bus;
ELSIF(ctrreg(7)='1' and cs='0' and ad="10")THEN
pc_latch<=internal_bus;
ELSIF(ctrreg(7)='0' and cs='0' and ad="11")THEN
ctrreg(3 downto 0)<=internal_bus(3 downto 0);
CASE ctrreg(3 downto 0) IS
WHEN"0000"=>pc_latch(0)<='0';
WHEN"0010"=>pc_latch(1)<='0';
WHEN"0100"=>pc_latch(2)<='0';
WHEN"0110"=>pc_latch(3)<='0';
WHEN"1000"=>pc_latch(4)<='0';
WHEN"1010"=>pc_latch(5)<='0';
WHEN"1100"=>pc_latch(6)<='0';
WHEN"1110"=>pc_latch(7)<='0';
WHEN"0001"=>pc_latch(0)<='1';
WHEN"0011"=>pc_latch(1)<='1';
WHEN"0101"=>pc_latch(2)<='1';
WHEN"0111"=>pc_latch(3)<='1';
WHEN"1001"=>pc_latch(4)<='1';
WHEN"1011"=>pc_latch(5)<='1';
WHEN"1101"=>pc_latch(6)<='1';
WHEN"1111"=>pc_latch(7)<='1';
when others=>null;
END CASE;
END IF;
END IF;
END PROCESS;

PROCESS(pa_latch)
BEGIN
IF(ctrreg(4)='0')THEN
pa<=(pa_latch);
ELSE
PA<="ZZZZZZZZ";
END IF;
END PROCESS;

PROCESS(pb_latch)
BEGIN
IF(ctrreg(1)='0')THEN
pb<=(pb_latch);
ELSE
pb<="ZZZZZZZZ";
END IF;
END PROCESS;

PROCESS(pc_latch)
BEGIN
IF(ctrreg(0)='0')THEN
pcl<=pc_latch(3 downto 0);
ELSE
pcl<="ZZZZ";
END IF;
END PROCESS;

PROCESS(pc_latch)
BEGIN
IF(ctrreg(3)='0')THEN
pch<=pc_latch(7 downto 4);
ELSE
pch<="ZZZZ";
END IF;
END PROCESS;
END Behavioral;

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog