lwpj 发表于 2010-10-27 10:19:19

求助:大家帮忙分析下代码逻辑上的问题,VHDL代码如下

附件的图片中就是出现逻辑问题的地方
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY test IS
      PORT(
                       
                        status0_rise        : INSTD_LOGIC;
                        status1_rise        : INSTD_LOGIC;
                        status2_rise    : INSTD_LOGIC;
                        status3_rise        : INSTD_LOGIC;
                        status4_rise        : INSTD_LOGIC;
                        status5_rise    : INSTD_LOGIC;
                        clkin         : INSTD_LOGIC;
                        alcr            : INSTD_LOGIC;
               
                        cnt_ctrl0       : BUFFER STD_LOGIC;
                        cnt_ctrl1       : BUFFER STD_LOGIC;
                        cnt_ctrl2       : BUFFER STD_LOGIC;
                        cnt_ctrl3       : BUFFER STD_LOGIC;
                        cnt_ctrl4       : BUFFER STD_LOGIC;
                        cnt_ctrl5       : BUFFER STD_LOGIC
                       
);
end test;


ARCHITECTURE rtl OF test IS
BEGIN
process(clkin,alcr)
BEGIN

if(alcr ='0') then
        cnt_ctrl0<='0';
        cnt_ctrl1<='0';
        cnt_ctrl2<='0';
        cnt_ctrl3<='0';
        cnt_ctrl4<='0';
        cnt_ctrl5<='0';
       
else
   if (clkin'event and clkin='1') then
      if(cnt_ctrl0 = '1' and status0_rise ='0')then
         cnt_ctrl0 <= '0';
      end if;
      if(cnt_ctrl1 = '1' and status1_rise ='0')then
         cnt_ctrl1 <= '0';
      end if;
      if(cnt_ctrl2 = '1' and status2_rise ='0')then
         cnt_ctrl2 <= '0';
      end if;
      if(cnt_ctrl3 = '1' and status3_rise ='0')then
         cnt_ctrl3 <= '0';
      end if;
      if(cnt_ctrl4 = '1' and status4_rise ='0')then
            cnt_ctrl4 <= '0';
      end if;
      if(cnt_ctrl5 = '1' and status5_rise ='0')then
            cnt_ctrl5 <= '0';
      end if;
      if (status0_rise ='1' and (cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl4='0' or cnt_ctrl5='0' ))then
            cnt_ctrl0 <= '1';
      else
           if (status1_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl4='0' or cnt_ctrl5='0' )) then
                cnt_ctrl1 <= '1';
           else
             if (status2_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl3='0' or cnt_ctrl4='0' or cnt_ctrl5='0' )) then
                   cnt_ctrl2 <= '1';
               else
                  if (status3_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl4='0' or cnt_ctrl5='0' ) )then
                     cnt_ctrl3 <= '1';
                  else
                     if (status4_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl5='0' ))then
                        cnt_ctrl4 <= '1';
                     else
                        if (status5_rise ='1' and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl4='0' ))then
                           cnt_ctrl5 <= '1';
                        end if;
                     end if;
                  end if;
                end if;
              end if;
           end if;
         end if;
end if;               
end process;


end rtl;

lwpj 发表于 2010-10-27 15:37:59

谢谢大家的关注,问题已经解决!

Sunlife 发表于 2015-4-8 14:50:31

    :L怎么解决的
页: [1]
查看完整版本: 求助:大家帮忙分析下代码逻辑上的问题,VHDL代码如下