VHDL综合错误。信号blk_pointer无法合成,同步描述不良

时间:2014-12-06 21:08:26

标签: vhdl fpga xilinx-ise

我对该代码的综合存在问题。 显示的错误是"信号blk_pointer无法合成,错误的同步描述。当前软件版本不支持用于描述同步元素(寄存器,内存等)的描述样式。"。

我想在两台设备之间保存通讯消息。具有falling_edge和rising_edge的部分是查找消息的当前部分,并创建指向该部分的指针(msg_pointer,blk_pointer)。然后我想将当前值保存到缓冲区。

当我删除最后一部分(带有for循环)时,它会起作用。

process(com_delayed)
variable msg_pointer : INTEGER range 0 to 20:=0;    --pointing to a number of message block 
variable blk_pointer : INTEGER range 0 to 50:=0;    --pointing to a number of bit from the current block
variable buf_pointer : INTEGER range 0 to 13:=0;    --pointing to a number of bit in the output S14T7C7_TEMP buf
variable S14T7C7_TEMP : STD_LOGIC_VECTOR (13 downto 0):="00000000000000";
variable nzer : INTEGER range 0 to 9:=0;
variable njed : INTEGER range 0 to 9:=0;
variable copy : STD_LOGIC;

begin
    if falling_edge(com_delayed) then
        if com_level_time > 4500 then
            msg_pointer := 0;
            blk_pointer := 0;
            buf_pointer := 0;
        elsif ( com_level_time < 4500 ) and ( com_level_time > 630 ) then
            msg_pointer := 1;
            blk_pointer := 0;
            buf_pointer := 0; 
        elsif blk_pointer >= 9 then
            blk_pointer:=0; 
            if msg_pointer<6 then
                msg_pointer:=msg_pointer+1;
            end if;
        elsif com_level_time <= 80 then
            blk_pointer:=blk_pointer+1;
            njed:=1;
            copy:='1';
        elsif (com_level_time>80 and com_level_time<=142) then
            blk_pointer:=blk_pointer+2;
            njed:=2;
            copy:='1';
        elsif (com_level_time>142 and com_level_time<=200) then
            blk_pointer:=blk_pointer+3;
            njed:=3;
            copy:='1';
        elsif (com_level_time>200 and com_level_time<=274) then
            blk_pointer:=blk_pointer+4;
            njed:=4;
            copy:='1';
        elsif (com_level_time>274 and com_level_time<=336) then
            blk_pointer:=blk_pointer+5;
            njed:=5;
            copy:='1';
        elsif (com_level_time>336 and com_level_time<=396) then
            blk_pointer:=blk_pointer+6;
            njed:=6;
            copy:='1';
        elsif (com_level_time>396 and com_level_time<=460) then
            blk_pointer:=blk_pointer+7;
            njed:=7;
            copy:='1';
        elsif (com_level_time>460 and com_level_time<=526) then
            blk_pointer:=blk_pointer+8;
            njed:=8;
            copy:='1';
        elsif (com_level_time>526 and com_level_time<=630) then
            blk_pointer:=blk_pointer+9;
            njed:=9;
            copy:='1';
        end if;         
    end if;


    if rising_edge(com_delayed) then
        if com_level_time <= 80 then
            blk_pointer:=blk_pointer+1;
            nzer:=1;
            copy:='1';
        elsif (com_level_time>80 and com_level_time<=142) then
            blk_pointer:=blk_pointer+2;
            nzer:=2;
            copy:='1';
        elsif (com_level_time>142 and com_level_time<=200) then
            blk_pointer:=blk_pointer+3;
            nzer:=3;
            copy:='1';
        elsif (com_level_time>200 and com_level_time<=274) then
            blk_pointer:=blk_pointer+4;
            nzer:=4;
            copy:='1';
        elsif (com_level_time>274 and com_level_time<=336) then
            blk_pointer:=blk_pointer+5;
            nzer:=5;
            copy:='1';
        elsif (com_level_time>336 and com_level_time<=396) then
            blk_pointer:=blk_pointer+6;
            nzer:=6;
            copy:='1';
        elsif (com_level_time>396 and com_level_time<=460) then
            blk_pointer:=blk_pointer+7;
            nzer:=7;
            copy:='1';
        elsif (com_level_time>460 and com_level_time<=526) then
            blk_pointer:=blk_pointer+8;
            nzer:=8;
            copy:='1';
        elsif (com_level_time>526 and com_level_time<=630) then
            blk_pointer:=blk_pointer+9;
            nzer:=9;
            copy:='1';
        end if;
    end if;

    msg_pointer_ext:=msg_pointer;
    blk_pointer_ext:=blk_pointer;

    if copy='1' then        
        For it in 1 to 9 loop
            if nzer/=0 then
                message1(msg_pointer_ext)(blk_pointer_ext-nzer):='0';
                nzer:=nzer-1;
            end if;
        end loop;
    end if;
    copy:='0';
end process;

新的两个过程:

process(com_delayed)
variable msg_pointer : INTEGER range 0 to 20:=0;    --pointing to a number of message block 
variable blk_pointer : INTEGER range 0 to 50:=0;    --pointing to a number of bit from the current block
variable nzer : INTEGER range 0 to 9:=0;
variable njed : INTEGER range 0 to 9:=0;
variable copy : STD_LOGIC;

begin
    if rising_edge(com_delayed) then
        msg_pointer:=msg_pointer_ext;
        blk_pointer:=blk_pointer_ext;
        if com_level_time <= 80 then
            blk_pointer:=blk_pointer+1;
            nzer:=1;
            copy:='1';
        elsif (com_level_time>80 and com_level_time<=142) then
            blk_pointer:=blk_pointer+2;
            nzer:=2;
            copy:='1';
        elsif (com_level_time>142 and com_level_time<=200) then
            blk_pointer:=blk_pointer+3;
            nzer:=3;
            copy:='1';
        elsif (com_level_time>200 and com_level_time<=274) then
            blk_pointer:=blk_pointer+4;
            nzer:=4;
            copy:='1';
        elsif (com_level_time>274 and com_level_time<=336) then
            blk_pointer:=blk_pointer+5;
            nzer:=5;
            copy:='1';
        elsif (com_level_time>336 and com_level_time<=396) then
            blk_pointer:=blk_pointer+6;
            nzer:=6;
            copy:='1';
        elsif (com_level_time>396 and com_level_time<=460) then
            blk_pointer:=blk_pointer+7;
            nzer:=7;
            copy:='1';
        elsif (com_level_time>460 and com_level_time<=526) then
            blk_pointer:=blk_pointer+8;
            nzer:=8;
            copy:='1';
        elsif (com_level_time>526 and com_level_time<=630) then
            blk_pointer:=blk_pointer+9;
            nzer:=9;
            copy:='1';
        end if;

        if copy='1' then        
            For it in 1 to 9 loop
                if nzer/=0 then
                    message1(msg_pointer)(blk_pointer-nzer):='0';
                    nzer:=nzer-1;
                end if;
            end loop;
        end if;
        copy:='0';

        msg_pointer_ext:=msg_pointer;
        blk_pointer_ext:=blk_pointer;
    end if;

end process;


process(com_delayed)
variable msg_pointer : INTEGER range 0 to 20:=0;    --pointing to a number of message block 
variable blk_pointer : INTEGER range 0 to 50:=0;    --pointing to a number of bit from the current block
variable nzer : INTEGER range 0 to 9:=0;
variable njed : INTEGER range 0 to 9:=0;
variable copy : STD_LOGIC;

begin
    if falling_edge(com_delayed) then
        msg_pointer:=msg_pointer_ext;
        blk_pointer:=blk_pointer_ext;

        if com_level_time > 4500 then
            msg_pointer := 0;
            blk_pointer := 0;
        elsif ( com_level_time < 4500 ) and ( com_level_time > 630 ) then
            msg_pointer := 1;
            blk_pointer := 0;
        elsif blk_pointer >= 9 then
            blk_pointer:=0; 
            if msg_pointer<6 then
                msg_pointer:=msg_pointer+1;
            end if;
        elsif com_level_time <= 80 then
            blk_pointer:=blk_pointer+1;
            njed:=1;
            copy:='1';
        elsif (com_level_time>80 and com_level_time<=142) then
            blk_pointer:=blk_pointer+2;
            njed:=2;
            copy:='1';
        elsif (com_level_time>142 and com_level_time<=200) then
            blk_pointer:=blk_pointer+3;
            njed:=3;
            copy:='1';
        elsif (com_level_time>200 and com_level_time<=274) then
            blk_pointer:=blk_pointer+4;
            njed:=4;
            copy:='1';
        elsif (com_level_time>274 and com_level_time<=336) then
            blk_pointer:=blk_pointer+5;
            njed:=5;
            copy:='1';
        elsif (com_level_time>336 and com_level_time<=396) then
            blk_pointer:=blk_pointer+6;
            njed:=6;
            copy:='1';
        elsif (com_level_time>396 and com_level_time<=460) then
            blk_pointer:=blk_pointer+7;
            njed:=7;
            copy:='1';
        elsif (com_level_time>460 and com_level_time<=526) then
            blk_pointer:=blk_pointer+8;
            njed:=8;
            copy:='1';
        elsif (com_level_time>526 and com_level_time<=630) then
            blk_pointer:=blk_pointer+9;
            njed:=9;
            copy:='1';
        end if;

        if copy='1' then        
            For it in 1 to 9 loop
                if njed/=0 then
                    message1(msg_pointer)(blk_pointer-njed):='0';
                    njed:=njed-1;
                end if;
            end loop;
        end if;
        copy:='0';

        msg_pointer_ext:=msg_pointer;
        blk_pointer_ext:=blk_pointer;       
    end if;

end process;

下一个错误是:并发分配中的整数多源。 (外部指针)

新版本没有错误:

process(clk_com, com_ecu38)
    variable com_clear : STD_LOGIC:='0';
    variable tclt : INTEGER range 0 to 32000:=0;
begin
    if rising_edge(clk_com) and tclt /= 31999 then
        tclt := tclt +1;
    end if;

    if com_ecu38'event then
        com_level_time:=tclt;
        com_clear:='1';
    end if;

    if com_clear='1' then 
        tclt:=0;
        com_delayed<=com_ecu38;
    end if;

    com_clear:='0';

end process;



process(com_delayed)
begin
    if rising_edge(com_delayed) then
        if com_level_time>20 and com_level_time<=80 then
            nzer:=1;
        elsif (com_level_time>80 and com_level_time<=142) then
            nzer:=2;
        elsif (com_level_time>142 and com_level_time<=200) then
            nzer:=3;
        elsif (com_level_time>200 and com_level_time<=274) then
            nzer:=4;
        elsif (com_level_time>274 and com_level_time<=336) then
            nzer:=5;
        elsif (com_level_time>336 and com_level_time<=396) then
            nzer:=6;
        elsif (com_level_time>396 and com_level_time<=460) then
            nzer:=7;
        elsif (com_level_time>460 and com_level_time<=526) then
            nzer:=8;
        elsif (com_level_time>526 and com_level_time<=630) then
            nzer:=9;
        else
            nzer:=0;
        end if;
        copy0<=not(copy0);
    end if;
end process;


process(com_delayed)
begin
    if falling_edge(com_delayed) then
        if com_level_time > 4500 then
            njed:=12;
        elsif com_level_time > 630 and com_level_time <= 4500 then
            njed:=11;
        elsif com_level_time>20 and com_level_time<=80 then
            njed:=1;
        elsif (com_level_time>80 and com_level_time<=142) then
            njed:=2;
        elsif (com_level_time>142 and com_level_time<=200) then
            njed:=3;
        elsif (com_level_time>200 and com_level_time<=274) then
            njed:=4;
        elsif (com_level_time>274 and com_level_time<=336) then
            njed:=5;
        elsif (com_level_time>336 and com_level_time<=396) then
            njed:=6;
        elsif (com_level_time>396 and com_level_time<=460) then
            njed:=7;
        elsif (com_level_time>460 and com_level_time<=526) then
            njed:=8;
        elsif (com_level_time>526 and com_level_time<=630) then
            njed:=9;
        else
            njed:=0;
        end if;
        copy1<=not(copy1);
    end if;
end process;


process(copy1, copy0)
variable n                  : INTEGER range 0 to 9:=0;
variable bit_to_write   : STD_LOGIC;
variable inc_msg            : STD_LOGIC;
variable c1                 : STD_LOGIC;
variable c0                 : STD_LOGIC;
variable msg_pointer    : INTEGER range 0 to 20:=0; --pointing to a number of message block 
variable blk_pointer    : INTEGER range 0 to 50:=0; --pointing to a number of bit from the current block

begin       
    if copy1'event then 
        n:=njed;
        c1:='1';
    elsif copy0'event then
        n:=nzer;
        c0:='1';
    end if;

    msg_pointer:=msg_pointer_ext;
    blk_pointer:=blk_pointer_ext;

    if c1='1' then
        bit_to_write:='1';
    elsif c0='1' then
        bit_to_write:='0';
    end if;

    if n=12 then
        msg_pointer:=0;
        blk_pointer:=0;
        com_ch_out<=not(com_ch_out);
    elsif n=11 then
        msg_pointer:=1;
        blk_pointer:=0;
    else
        if blk_pointer + n <9 then
            blk_pointer:=blk_pointer+n;
        else
            n:=9-blk_pointer;
            inc_msg:='1';
            blk_pointer:=9;
        end if;
        For it in 1 to 9 loop
            if n/=0 then
                message1(msg_pointer)(blk_pointer-n):=bit_to_write;
                n:=n-1;
            end if;
        end loop;
    end if;

    if inc_msg='1' then
        if msg_pointer<5 then
            blk_pointer_ext:=0;
            msg_pointer_ext:=msg_pointer+1;
        end if;
    else
        msg_pointer_ext:=msg_pointer;
        blk_pointer_ext:=blk_pointer;
    end if;

    n:=0;
    inc_msg:='0';
    c1:='0';
    c0:='0';

end process;

process(com_ch_out)
begin
    if com_ch_out'event then
        if latch_outputs='0' then
            if stc_decide = '0' then
                S14T7C7(0)<=message1(1)(1);
                S14T7C7(1)<=message1(1)(2);
                S14T7C7(2)<=message1(1)(3);
                S14T7C7(3)<=message1(1)(4);
                S14T7C7(4)<=message1(1)(5);
                S14T7C7(5)<=message1(1)(6);
                S14T7C7(6)<=message1(1)(7);
                S14T7C7(7)<=message1(2)(1);
                S14T7C7(8)<=message1(2)(2);
                S14T7C7(9)<=message1(2)(3);
                S14T7C7(10)<=message1(2)(4);
                S14T7C7(11)<=message1(2)(5);
                S14T7C7(12)<=message1(2)(6);
                S14T7C7(13)<=message1(2)(7);
            else
                S14T7C7(0)<=message1(4)(1);
                S14T7C7(1)<=message1(4)(2);
                S14T7C7(2)<=message1(4)(3);
                S14T7C7(3)<=message1(4)(4);
                S14T7C7(4)<=message1(4)(5);
                S14T7C7(5)<=message1(4)(6);
                S14T7C7(6)<=message1(4)(7);
                S14T7C7(7)<=C7I(0);
                S14T7C7(8)<=C7I(1);
                S14T7C7(9)<=C7I(2);
                S14T7C7(10)<=C7I(3);
                S14T7C7(11)<=C7I(4);
                S14T7C7(12)<=C7I(5);
                S14T7C7(13)<=C7I(6);        
            end if;
        end if;
    end if;
end process;

强文

0 个答案:

没有答案
相关问题