Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ACTIV HDL-VHDL-“VHDL”;信号无法合成,同步描述不好“;_Vhdl - Fatal编程技术网

ACTIV HDL-VHDL-“VHDL”;信号无法合成,同步描述不好“;

ACTIV HDL-VHDL-“VHDL”;信号无法合成,同步描述不好“;,vhdl,Vhdl,我在Xillinx中合成此代码时出错。此错误是: 无法合成信号Z_1,同步描述错误 实体uk3为 港口( rst:以位表示; C:整数; 时钟:以位为单位; S:输出整数 ); 结束uk3; --}}自动维护区段的结束 uk3的架构uk3是 开始 过程(C、clk、rst) 变量Z_1:整数:=0; 开始 如果rst='1',则Z_1:=0; elsif rst='0'和clk'事件以及clk='1'和C=1 然后 Z_1:=Z_1+1; elsif rst='0'和clk'事件以及clk='1

我在Xillinx中合成此代码时出错。此错误是:

无法合成信号Z_1,同步描述错误

实体uk3为
港口(
rst:以位表示;
C:整数;
时钟:以位为单位;
S:输出整数
);
结束uk3;
--}}自动维护区段的结束
uk3的架构uk3是
开始
过程(C、clk、rst)
变量Z_1:整数:=0;
开始
如果rst='1',则Z_1:=0;
elsif rst='0'和clk'事件以及clk='1'和C=1
然后
Z_1:=Z_1+1;
elsif rst='0'和clk'事件以及clk='1'和C=2
然后
Z_1:=Z_1+2;
其他的
Z_1:=Z_1;
如果结束;

您有一个包含重置条件检查的
if
子句,然后是两个单独的选通时钟条件,然后是一个
else
子句。我不认为有任何工具可以综合这一点,因为你不太可能真正想要你所描述的东西,而且它也很难放入硬件中。您需要阅读更多关于HDL和同步设计的基础知识

这样想:如果你像编译器那样从上到下逐行阅读你写的代码,你会如何真正开始构建你所描述的硬件呢?你如何构建一个硬件,在一个时钟上做一件事,在另一个时钟上做另一件事,在没有时钟的情况下做第三件事?如何在FPGA LUT中实现这一点

简而言之,为了让代码正常工作,您需要去掉
else
子句,它无论如何都不起任何作用,合成器通常不喜欢
else
elsif
-子句与时钟条件(
if rising_egde(clk)
if clk'event and clk='1'
)。
C
的条件应在主计时语句中的单独
if
子句中进行检查。另外,在
elsif
子句中去掉对
rst='0'
的检查。您已经在
if
语句中检查了
rst='1'
,并且
信号只能是
'1'
或'0'

可合成代码如下所示:

process (clk, rst)
   if rst = '1' then
       -- your reset condition
   elsif clk'event and clk = '1' then -- if you use a bit type clk, otherwise use elsif rising_edge(clk) then
       if signal = condition then
          -- whatever you need doing
       else
          -- whatever you need doing
       end if;
   end if;
end process;

阅读你的合成工具的编码风格指南。你需要规范你的if语句!在报价单中标记平台错误可能重复的
process (clk, rst)
   if rst = '1' then
       -- your reset condition
   elsif clk'event and clk = '1' then -- if you use a bit type clk, otherwise use elsif rising_edge(clk) then
       if signal = condition then
          -- whatever you need doing
       else
          -- whatever you need doing
       end if;
   end if;
end process;