返回该小组首页 回复主题
digirhythm

digirhythm

小组等级:     E币:131  (E币换礼)

#1楼主:求助: 一个综合的问题

文章发表于:2008-02-03 05:50

这几天花了不少时间终于把Synplify pro (8.6.2)安装好了. 当我把自己写的可以在ModelSim中编译的rs触发器代码放到Synplify中编译时, warning出现.

以下是我写的VHDL rs_latch 代码:

library ieee;

use ieee.std_logic_1164.all;

 

entity rs_latch is

    port ( r      : in  std_logic;

           s      : in  std_logic;

           q      : out  std_logic;

           iq     : out  std_logic);

end rs_latch;

 

architecture bhv_rslatch of rs_latch is

 

begin

      process(r, s)

      begin

         if r'event and r = '1' then

               q  <= '0';

               iq <= '1';

         elsif s'event and s = '1' then

               q <= '1';

               iq <= '0';

         else

               null;

         end if;

      end process;

end bhv_rslatch;

 

这段代码在ModelSim中的编译没有任何问题, 而且以它为component的模块的行为也符合预期.

 

Synplify给出的warning:

 

@W: CL116 :The input data for signal q contains references to signal edges.  An async-reset may be missing from the sensitivity list.

 

我的理解是提示我在process 的敏感信号中加上一个reset 信号. 但是如果加上这个信号, rs_latch就和原来的设想不太一样了. (原来的r 就可以起到异步复位作用)

 

请问Synplify为什么要求加一Async_Reset, 有什么规律可寻吗? 为什么在ModelSim中就没问题?

 

谢谢.

digirhythm

   小组等级:    E币:131  (E币换礼)

#2

文章发表于:2008-02-04 03:49

如果将Latch改为电平敏感, 则有warning CL117提示

process(r, s)
 begin
      if r = '0' and s = '1' then
        q  <= '0';
        iq <= '1';
      elsif s= '0' and r = '1' then
        q  <= '1';
        iq <= '0';
      else
         null;
      end if;

end process;

CL117: Latch generated from process for signal q, probably caused by a missing assignment in an if or case stmt

有"else"概括了其他情况了, 还要什么"statment"?

 

 

wwh_nuaa

   小组等级:    E币:1260  (E币换礼)

#3

文章发表于:2008-02-15 14:13

modelsim 语法检查不是那么严格

目前的分析综合软件,是不支持双沿触发的----会报错!!!

 

riple

   小组等级:    E币:4266  (E币换礼)

#4

文章发表于:2008-02-21 15:40

modelsim是仿真工具,不是综合工具。对应地,HDL语言也分为仿真语言和综合语言。modelsim检查的是HDL语言的可仿真性,synplify检查的是HDL语言的可综合性,可以认为:可综合性语句集合包含于可仿真语句集合中。所以,仿真工具检测没有问题的语句,在综合工具看来就可能是错误的。

此外,所谓综合,是把语言的逻辑描述转化为器件的电路描述,综合必须对应底层器件结构。比如你的第一个例子,要求底层器件结构支持双边沿触发,在我已知的FPGA器件中还没有哪种器件支持这一特性,所以综合工具不理解你的描述,并且把你的描述归类为某一种错误,给出警告。

riple

   小组等级:    E币:4266  (E币换礼)

#5

文章发表于:2008-02-21 18:49

对于第二个例子,我觉得你写对了,生成了一个latch。但是由于在FPGA内部采用latch会浪费资源,并且无法针对latch进行时序分析,所以综合工具不希望你的代码中出现latch,所以给出了warning,提醒你检查一下代码,看看引入该latch是不是你的设计本意。

给出你的代码的两个变形形式:

形式一:在else里面保持原有取值,与你的原写法在功能和电路上一样。

       if r = '0' and s = '1' then
        q  <= '0';
        iq <= '1';
      elsif s= '0' and r = '1' then
        q  <= '1';
        iq <= '0';
      else
        q  <= q;
        iq <= iq;
      end if;

形式二:你的程序的另一种写法。

      if rs = "01" then
        q  <= '0';
        iq <= '1';
      elsif rs = "10" then
        q  <= '1';
        iq <= '0';
      else
        q  <= q;
        iq <= iq;
      end if;

形式三:这种写法与你的代码有什么区别呢,我还没想出来,看起来不一样。

      if r = '0' then
        q  <= '0';
        iq <= '1';
      elsif s = '0' then
        q  <= '1';
        iq <= '0';
      else
        q  <= q;
        iq <= iq;
      end if;

digirhythm

   小组等级:    E币:131  (E币换礼)

#6

文章发表于:2008-08-30 08:59

谢谢riple

我的code是从实际电路而来, 原来此处是rs_latch.

已经改成用D_flipflop来实现, 波型上稍差一点(毛刺多了), 可综合不报警了

我很懒, 不常来. 谢谢你的建议

 

总共 , 当前 /

快速回复主题--如果想加入编辑器功能,建议使用 [高级回复]

您目前还不是小组成员,请先加入

回复贴子区

用户名:    您没有注册?

密码:    忘记了密码?

内容:

  • DesignDesign
  • HTMLHTML

浏览该小组的用户还看过...

所有小组精华文章