Vhdl ADC到RAM信号重建(发送到VGA后)

Vhdl ADC到RAM信号重建(发送到VGA后),vhdl,ram,adc,vga,Vhdl,Ram,Adc,Vga,我应该将ADC中的波形重建到RAM中,然后将其发送到VGA 我写了这个模块,但当我合成时,vivado产生了一个错误:[Synth 8-3380]循环条件在2000次迭代后不会收敛 错误是指while循环,但我不理解原因。不幸的是,如果我不能合成模块,我不知道它是否工作良好 这是模块: library IEEE; use IEEE.STD_LOGIC_1164.ALL; --use ieee.std_logic_arith.all; -- Uncomment the following libr

我应该将ADC中的波形重建到RAM中,然后将其发送到VGA

我写了这个模块,但当我合成时,vivado产生了一个错误:[Synth 8-3380]循环条件在2000次迭代后不会收敛

错误是指while循环,但我不理解原因。不幸的是,如果我不能合成模块,我不知道它是否工作良好

这是模块:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
--use ieee.std_logic_arith.all;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity Data_Elab is
    Generic (
            C: integer := 640;          -- Colonne 640
            R: integer := 480           -- Righe 480
            );
    Port (
        --clk:        in std_logic;
        DRP_Data:   in std_logic_vector(15 downto 0);
        DRP_Ready:  in std_logic;
        RAM_addr:   out std_logic_vector(17 downto 0);
        RAM_Data:   out std_logic;
        RAM_en:     out std_logic
        );

end Data_Elab;

architecture Behavioral of Data_Elab is
    signal data_reg: integer range 0 to 2**16;
    --signal flag: std_logic;            
begin
    process(DRP_Ready, DRP_Data)
    begin
        if(DRP_Ready'event and DRP_Ready = '1') then
            data_reg <=  to_integer(unsigned(DRP_Data));
        end if;
    end process;

    process(data_reg)
        variable Cont_W: integer range 0 to C-1 := 0;    -- contatore per spostamento tra colonne
        variable Cont_i: integer range 0 to C   := 1;    -- contatore colonne
        variable Cont_x: integer range 0 to R   := 1;    -- contaore per spostamento tra righe
        variable Cont_R: integer range 0 to R   := 0;    -- contatore righe       
    begin
        if(Cont_i <= C) then
            if( data_reg <= (2**16/R)*Cont_x ) then               
                RAM_addr <= std_logic_vector(to_unsigned( (C*(R-Cont_x))+Cont_W, RAM_addr'length));
                RAM_en<= '1';
                RAM_Data <= '1';                         -- pixel corrispondente alla forma d'onda (bianchi)
                Cont_W := Cont_W+1;
                Cont_i := Cont_i+1;
                --Cont_R := Cont_R+1;
                --Cont_x := 1;    
                    while Cont_R < R loop
                        RAM_addr <= std_logic_vector(to_unsigned( (C*(R-Cont_x))+Cont_W, RAM_addr'length));
                        RAM_en<= '1';
                        RAM_Data <= '0';                -- pixel neri
                        Cont_R := Cont_R+1;
                        Cont_x:= Cont_x+1;    
                    end loop;
                Cont_R := 0;
            else
                RAM_addr <= std_logic_vector(to_unsigned( (C*(R-Cont_x))+Cont_W, RAM_addr'length));
                RAM_en<= '1';
                RAM_Data <= '0';                        -- pixel neri
                Cont_R := Cont_R+1;
                Cont_x:= Cont_x+1;
            end if;
        else
            RAM_en<= '0';
            Cont_W := 0;
            Cont_i := 1;
            Cont_x := 1;
            Cont_R := 0;            
        end if;
    end process;
end Behavioral;
IEEE库;
使用IEEE.STD_LOGIC_1164.ALL;
--使用ieee.std_logic_arith.all;
--如果使用,请取消注释以下库声明
--具有有符号或无符号值的算术函数
使用IEEE.NUMERIC_STD.ALL;
--如果正在实例化,请取消对以下库声明的注释
--此代码中的任何Xilinx叶细胞。
--UNISIM图书馆;
--使用UNISIM.VComponents.all;
实体数据_Elab是
一般的(
C:整数:=640;--Colonne 640
R:整数:=480——等于480
);
港口(
--clk:标准逻辑中;
DRP_数据:标准逻辑_向量(15到0);
DRP_就绪:在标准_逻辑中;
RAM地址:输出标准逻辑向量(17至0);
RAM_数据:输出标准_逻辑;
RAM_en:输出标准逻辑
);
终端数据链路;
数据Elab的体系结构是
信号数据_reg:整数范围0至2**16;
--信号标志:标准逻辑;
开始
过程(DRP_就绪,DRP_数据)
开始
如果(DRP_Ready'事件和DRP_Ready='1'),则

data_reg我猜合成器不够聪明,无法知道while循环会运行多少次,因为它在每个循环中都会发生变化。我建议改用for循环

for Cont_R in 0 to R-1 loop
    RAM_addr <= std_logic_vector(to_unsigned( (C*(R-Cont_x))+Cont_W, RAM_addr'length));
    RAM_en<= '1';
    RAM_Data <= '0';                -- pixel neri        
    Cont_x:= Cont_x+1;    
end loop;
用于0到R-1循环中的Cont_R

谢谢你的回复。但我需要循环使用Cont_R的值,该值在当时已存在。例如:对于Cont_R到R-1循环中的Cont_R,但这会产生另一个错误[Synth 8-561]范围表达式无法解析为常量您有一些来自ADC的数据。一次一个样品。这将花费一些时间。然而,您已经注释掉了
clk
输入,并试图用组合逻辑实现这一点。你需要放下VHDL,用铅笔和纸设计一个电路来实现你需要的行为(不是在门级,而是在块级*)。完成后,返回VHDL并实现它。这个电路必须是顺序的;也就是说,它必须使用您的
clk
输入,并且需要触发器。*我所说的“块级”是什么意思?我的意思是用移位寄存器、状态机、计数器、触发器、组合逻辑云等绘制一个图表-这不是一个解决方案-这是我所说的块级的一个例子。谢谢你的回答。@user1155120,你是对的,但我想自己找到解决世代问题的办法,并将图像保存在RAM上。我使用的是Zybo7000板。我的想法是使用Xilin XADC,在UG480指南(第73页)中指定了如何在我的案例中使用它。DRP_就绪信号来自ADC,当ADC的寄存器上有就绪数据时,信号为高。我的代码尝试写入所有RAM,这样我就可以在VGA模块上读取和发送整个图像(我已经成功完成并测试了)。我在纸上试过(为了简单起见,我使用了一个只有4*4像素的图像作为测试),在我看来效果很好。虽然我必须调整时间,因为ADC每26个clk周期(clk为25MHz)提供一个新数据,并且每个数据的计算时间可能会更长。但是,如果while循环不可合成,我将不得不完全修改该块。