【发布时间】:2020-04-05 14:15:18
【问题描述】:
美好的一天, 我写了以下实体:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity ADCinterface is
generic (
adc_id : std_logic_vector(1 downto 0):="00"; -- Holds the ID of the ADC its assigned to; for data reference
word_size : natural := 32; -- Size of the transmission word in bit (overeall)
crc_length : natural :=8 -- Size/Length of the crc
);
port(
--internal Ports
clkin: in std_logic; -- Module main Clock
n_reset: in std_logic; -- Module reset
adc_clkin: in std_logic; -- ADC sample clock input
spi_clkin: in std_logic; -- SPI master clock input
ack_buffer: in std_logic; -- Signals that the buffer has been copied and can be overwritten
paket_ID: out std_logic_vector(5 downto 0); -- write the paket ID, a consecutive number
spi_data: out std_logic_vector(word_size-1 downto 0);-- Holds the data received from the adc
data_buffer:out std_logic_vector(word_size-1 downto 0);-- holds the data for the paket manager
word_valid: out std_logic; -- Signals data available to the internal paket manager
--External ports
data_in: in std_logic; -- SPI data input
ndrdy: in std_logic; -- Frame Sync pin (alias nDRDY) input from the ADC
data_out: out std_logic; -- SPI data output
start_adc: out std_logic; -- Enables the ADC
adc_clk: out std_logic; -- ADC sampling clk out
spi_clkout: out std_logic -- SPI master clock out
);
end ADCinterface;
architecture ADCinterface_arch of ADCinterface is
signal receive_word : bit := '0'; --enables the receive process
signal adc_data_ready : std_logic := '0'; --holds the captured falling edge on ndrdy
begin
adc_data_ready <= ndrdy;
ADCinterface : process (clkin)
begin
if (rising_edge(clkin) and n_reset='0') then
receive_word <= '0'; --stop any active transmission
elsif (rising_edge(clkin) and adc_data_ready='1') then
receive_word <= '1'; --start / enable the data transmission
end if;
end process ADCinterface;
end ADCinterface_arch;
无法合成错误:
错误 - 第 (65) 行: 声明是不可综合的,因为它不保持其价值 NOT(时钟沿)条件。 VHDL-1242
第 65 行对应于最后一个“end if;”声明。
当我现在改变时
if (rising_edge(clkin) and n_reset='0') then
到
if (n_reset='0') then
它没有错误地完成合成。我使用 Lattice Diamond V 3.11.2.446 和 LSE 进行合成。
我看不出这种变化如何改变你,有人可以帮我理解这里发生了什么吗?在这两种情况下,我希望生成的逻辑能够在非时钟边缘条件下保持其值......
提前致谢
【问题讨论】:
-
将复位置于同步复位的时钟条件内。
标签: vhdl