无限HDL合成

时间:2014-04-02 18:05:44

标签: vhdl hdl synthesis

每当我尝试合成我的代码时,它都会陷入无限循环,即它停留在HDL SYNTHESIS。我没有使用任何循环。但问题仍然存在。

---------------------------------------------------------------------------------- 
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.NUMERIC_STD.ALL;


entity mat is
  port(
    start,clck,start4,add4,check4,delete3,start3,add3,final3,load,load3,load4,search3:in std_logic;
    data1,data2,newitem:in std_logic_vector(0 to 8);
    completeload4tocontroller,completeadd3,search3cmplt,completeload3tocontroller,
    completeloadtocontroller,discerncomplete,complete4add,completedel3,step4comptocntrl:out bit;
    data4,data6:out std_logic_vector(0 to 15));
end mat;

architecture Behavioral of mat is

  type positiveelem is array (0 to 255) of std_logic_vector(0 to 18);
  type negativeelem is array (0 to 255) of std_logic_vector(0 to 18);
  signal poselem:positiveelem ;
  signal negelem:negativeelem ;
  signal pospointer:integer range 0 to 255:=0;
  signal negpointer:integer range 0 to 255:=0;
  signal jpst:integer range 0 to 255 := 0;
  signal jnst:integer range 0 to 255 := 0;
  signal jp1st:integer range 0 to 255 := 0;
  signal jp2st:integer range 0 to 255 := 0;
  signal jn4st:integer range 0 to 255 := 0;
  signal jp4st:integer range 0 to 255 := 0;
  signal j3pntr:integer range 0 to 255 := 0;
  signal j3npntr:integer range 0 to 255 := 0;
  signal j3ptr:integer range 0 to 255 := 0;
  type list12 is array(0 to 65535) of integer range 0 to 31;
  signal clist:list12;
  signal limitcount:integer range 0 to 255 :=0;
  signal flag1:std_logic :='0';
  signal position:integer range 0 to 255;

begin

  P1:process(load,load4,clck,load3,check4,start,add4,start4,start3,delete3,add3)
    variable temp4:std_logic_vector(0 to 15);
    variable temp5:std_logic_vector(0 to 15);
    variable temp1:std_logic_vector(0 to 15);
    variable tempp3:std_logic_vector(0 to 15);

  begin 
    if(rising_edge(clck))then

      if(load='1')then                           
        poselem(pospointer) <= data1;
        negelem(negpointer) <= data2;
        pospointer <= pospointer + 1;
        negpointer <= negpointer + 1;
        limitcount <= limitcount + 1;

        if(limitcount = 10)then      
          completeloadtocontroller <= '1'; 
        end if;  

      elsif((load4 = '1') and (load ='0'))then
        poselem(pospointer) <= newitem;
        pospointer <= pospointer + 1;
        completeload4tocontroller <= '1';

      elsif((load3 = '1') and (load = '0'))then
        negelem(negpointer) <= newitem;
        negpointer <= negpointer + 1;
        completeload3tocontroller <= '1';              

      elsif(start = '1')then 
        if((jpst <= pospointer) and (jnst <= negpointer))then
          temp4 := poselem(jpst)(0 to 15) xor negelem(jnst)(0 to 15);  
          clist(conv_integer(temp4)) <= clist(conv_integer(temp4)) + 1;

          if((jnst = (negpointer - 1)) and (jpst < (pospointer - 1)))then
            jnst <= 0;
            jpst <= jpst + 1;
          elsif(jnst < (negpointer - 1) and (jpst < (pospointer - 1)))then
            jnst <= jnst + 1;
          elsif(jpst = (pospointer - 1) and (jnst < (negpointer - 1)))then
            jnst <= jnst + 1;
          elsif((jp1st = pospointer) and (jp2st = pospointer) and
            (jpst = pospointer) and (jnst =  negpointer))then
            discerncomplete <= '1';
          end if;

        end if;    


      elsif(start4 = '1')then 
        if(add4 = '1')then
          temp1 := newitem(0 to 15) xor negelem(jn4st)(0 to 15);
          if(clist(conv_integer(temp1)) = 0)then
            data4 <= temp1;
          end if;

          clist(conv_integer(temp1)) <= clist(conv_integer(temp1)) + 1; 

          if(jn4st < (negpointer - 1))then
            jn4st <= jn4st + 1;
          elsif((jp4st = pospointer - 1) and (jn4st = negpointer - 1))then
            complete4add <= '1';
          end if;    
        end if;

      elsif(start3 = '1')then
        if(delete3 = '1')then
          if((poselem(position)(0 to 15) /= poselem(j3pntr)) 
              and (poselem(position)(16 to 18) /= poselem(j3pntr)(16 to 18)))then
            tempp3 := poselem(position)(0 to 15) xor poselem(j3pntr)(0 to 15);         
            if(clist(conv_integer(tempp3)) = 1)then
              data6 <= tempp3;
            end if;
            if(clist(conv_integer(tempp3)) /= 0)then
              clist(conv_integer(tempp3)) <= clist(conv_integer(tempp3)) - 1;
            end if;

            if(j3pntr < (pospointer - 1))then
              j3pntr <= j3pntr + 1;
            elsif((j3pntr = pospointer - 1) and (j3npntr = negpointer - 1))then
              completedel3 <= '1';
              poselem(position) <= "0000000000000000000";  
            end if;
          end if;

        elsif(search3 = '1')then 
          if((poselem(position)(16 to 18) /= newitem(16 to 18)) 
            and (poselem(position)(0 to 15) = newitem(0 to 15)))then 
            flag1 <= '1';
          end if;
          if((position < pospointer) and (flag1 = '0'))then
            position <= position + 1;
          elsif(flag1 = '1')then                
            search3cmplt <= '1';
          end if;   

        elsif(add3 = '1')then
          tempp3 := newitem(0 to 15) xor poselem(j3ptr)(0 to 15);
          if(clist(conv_integer(tempp3)) = 0)then
            data4 <= tempp3;
          end if;
          clist(conv_integer(tempp3)) <= clist(conv_integer(tempp3)) + 1;
          if(j3ptr < pospointer - 1 and (j3ptr = (position - 1)))then
            j3ptr <= j3ptr + 2;
          elsif(j3ptr = (pospointer - 1))then 
            completeadd3 <= '1';
          else
            j3ptr <= j3ptr + 1;                       
          end if;
        end if;    
      end if;
    end if;
    if(falling_edge(clck))then
      if(start = '1')then      
        if((jp1st /= pospointer) and (jp2st /= pospointer) and   (poselem(jp1st)(16 to 18) /= poselem(jp2st)(16 to 18)) 
            and (poselem(jp1st)(0 to 15) /= poselem(jp2st)(0 to 15))) then
          temp5 := poselem(jp1st)(0 to 15) xor poselem(jp2st)(0 to 15);
          clist(conv_integer(temp5)) <= clist(conv_integer(temp5)) + 1;           
        end if;

        if(jp1st < (pospointer - 1) and jp2st = (pospointer-1))then
          jp1st <= jp1st + 1;
          jp2st <= 0;
        elsif(jp1st = (pospointer - 1) and jp2st < (pospointer-1))then
          jp2st <= jp2st + 1;
        elsif(jp1st < (pospointer - 1) and jp2st < (pospointer-1))then
          jp2st <= jp2st + 1;
        elsif((jp1st = pospointer) and (jp2st = pospointer) and (jpst = pospointer) and (jnst = negpointer))then
          discerncomplete <= '1';
        end if;


    elsif(start4 = '1')then
      if(add4 = '1')then
        if((poselem(jp4st)(0 to 15) /= "0000000000000000"))then
          if(poselem(jp4st)(0 to 15) /= newitem(0 to 15)) 
              and (poselem(jp4st)(16 to 18) /= newitem(16 to 18)))then
            temp1 := newitem(0 to 15) xor poselem(jp4st)(0 to 15);
            if(clist(conv_integer(temp1)) = 0)then
              data4 <= temp1;
            end if;

            clist(conv_integer(temp1)) <= clist(conv_integer(temp1)) + 1; 
          end if;

          if(jp4st < (pospointer - 1))then
            jp4st <= jp4st + 1;
          elsif((jp4st = pospointer - 1) and (jn4st = negpointer - 1))then
            complete4add <= '1';
          end if;
        end if;     

      elsif(start3 = '1')then
        if(delete3 = '1')then
          tempp3 := newitem(0 to 15) xor negelem(j3npntr)(0 to 15);          
          if(clist(conv_integer(tempp3)) = 1)then
            data6 <= tempp3; 
          end if;
          if(clist(conv_integer(tempp3)) = 0)then
            clist(conv_integer(tempp3)) <= clist(conv_integer(tempp3)) - 1; 
          end if;
          if(j3npntr < negpointer - 1 )then     
            j3npntr <= j3npntr + 1;
          elsif((j3pntr = pospointer - 1) and (j3npntr = negpointer - 1))then
            completedel3 <= '1';
            poselem(position) <= "0000000000000000000";               
          end if;
        end if;
      end if;
    end if;

  end process P1;
end Behavioral;

1 个答案:

答案 0 :(得分:0)

我的评论解决了其中一些问题,但我认为我会将它们打印出来作为补充更多细节和澄清的答案。

合成软件陷入某一步并锁定与您正在使用的任何特定语言结构几乎没有任何关系,并且可能意味着该软件在解析您的代码时遇到问题。虽然我将此称为软件中的错误,但您可以通过查找语法错误来解决它(使用其他编译器,如ModelSim或其他东西,如果您有访问权限,也可能有帮助)。例如,您似乎有一个if-loop而不是在if falling_edge(clck)下的某个地方关闭。您还缺少(行:

if(poselem(jp4st)(0 to 15) /= newitem(0 to 15)) 
    and (poselem(jp4st)(16 to 18) /= newitem(16 to 18)))then

您将data1(一个9位向量)分配给poselem(pospointer),一个19位向量(以及其他类似的赋值)。检查您的端口和信号定义。