我的vhdl代码有问题。在active-hdl中它工作得很好,但是当我尝试使用ise design xilinx在FPGA板上实现它时,我遇到了一个组件的问题。我发现的错误是:
错误:Xst:827 - " E:/proiect_final/dispozitiv_impartitor/src/generator_square_wave.vhd"第16行:信号numar_intermediar< 0>无法合成,同步描述不好。当前软件版本不支持您用于描述同步元素(寄存器,内存等)的描述样式。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity generator_square_wave is
port(clock,reset :in bit;
controler:std_logic_vector(2 downto 0);
numar:out std_logic_vector(7 downto 0);
data_clock:out bit);
end generator_square_wave ;
architecture descriere of generator_square_wave is
signal reset1:std_logic;
begin
process (clock,reset) -- here it shows me the error
variable numar_intermediar:bit_vector(3 downto 0 ):="0000";
variable numar_intermediar2:std_logic_vector(3 downto 0);
variable bitul:bit;
begin
reset1<=to_stdulogic(reset);
if rising_edge(reset1) then
numar_intermediar:="0001";
numar_intermediar2:=To_StdLogicVector(numar_intermediar);
numar(0)<=numar_intermediar2(0);
numar(1)<=numar_intermediar2(1);
numar(2)<=numar_intermediar2(2);
numar(3)<=numar_intermediar2(3);
numar(4)<='0';
numar(5)<='0';
numar(6)<='0';
numar(7)<='0';
else if( clock'event and clock ='1' and controler="001")then
bitul:=numar_intermediar(0);
numar_intermediar:=numar_intermediar srl 1;
numar_intermediar(3):=bitul;
numar_intermediar2:=To_StdLogicVector(numar_intermediar);
numar(0)<=numar_intermediar2(0);
numar(1)<=numar_intermediar2(1);
numar(2)<=numar_intermediar2(2);
numar(3)<=numar_intermediar2(3);
numar(4)<='0';
numar(5)<='0';
numar(6)<='0';
numar(7)<='0';
if(reset/='1' and controler/="001")then
numar<="00000000";
end if;
end if;
end if;
data_clock<=clock;
end process;
end descriere;
答案 0 :(得分:1)
你有一些问题。首先,您不应将重置视为时钟(即使用rising_edge()
)。如果它是异步的,你应该写:
if reset1 = '1' then
...
以下行也有问题(不确定这是否严格违法,但不建议这样做):
if( clock'event and clock ='1' and controler="001")then
这应该是:
if clock'event and clock = '1' then
if controler = "001" then
(需要额外的end if
才能匹配。)
至少应该允许它合成。
您可能还希望将语句reset1<=to_stdulogic(reset)
置于并发状态而不是将其包含在此过程中,并且您可以进行其他一些可能的更改,但它们并不那么重要(除非我错过了东西)。