在线咨询 切换到宽版
eetop公众号 创芯大讲堂 创芯人才网

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜全文
查看: 5575|回复: 10

能不能解释下面的warning!!

[复制链接]
发表于 2003-8-28 21:34:41 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
我是这样用的,SD是双向口,直接用锁存器将SD锁入DATAR,就出现下面的warining,是什么原因啊!
Warning: Converting TRI node DATAR[7]~0 that feeds logic to an OR gate
Warning: Converting TRI node DATAR[6]~1 that feeds logic to an OR gate
Warning: Converting TRI node DATAR[5]~2 that feeds logic to an OR gate
Warning: Converting TRI node DATAR[4]~3 that feeds logic to an OR gate
Warning: Converting TRI node DATAR[3]~4 that feeds logic to an OR gate
Warning: Converting TRI node DATAR[2]~5 that feeds logic to an OR gate
Warning: Converting TRI node DATAR[1]~6 that feeds logic to an OR gate
Warning: Converting TRI node DATAR[0]~7 that feeds logic to an OR gate
发表于 2003-8-28 22:12:49 | 显示全部楼层

能不能解释下面的warning!!

应该把双向i/o转变为:
SD-----+-------> O
       |
        ------<  I
用锁存器锁存O,而不应该为SD
回复 支持 反对

使用道具 举报

发表于 2003-8-29 08:10:31 | 显示全部楼层

能不能解释下面的warning!!

jackzhang: Can you interpret the reason? I am puzzled.
回复 支持 反对

使用道具 举报

发表于 2003-8-29 08:58:16 | 显示全部楼层

能不能解释下面的warning!!

先让 lizhen7799  看看是不是这个原吧
回复 支持 反对

使用道具 举报

发表于 2003-8-29 12:10:42 | 显示全部楼层

能不能解释下面的warning!!

这是由于编译手段不同造成的,如是ALTERA器件,则可参考你网站上的IO程序,即可了解了
回复 支持 反对

使用道具 举报

发表于 2003-8-29 15:26:56 | 显示全部楼层

能不能解释下面的warning!!

双向端口是要由三态控制信号来控制的呀,直接锁存应该不行。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2003-8-30 11:58:25 | 显示全部楼层

能不能解释下面的warning!!

我是用三态来做的啊!!
程序贴给你们看不过风格不好哦!!请指教
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity  monitor is
  port(   RESET  :in      std_logic;
         CLK16x  :in      std_logic;
           SCL   :in      std_logic;
           SDA   :inout   std_logic;
           IOWB  ut     std_logic;
           IORB  ut     std_logic;
           INT0  ut     std_logic;  --interrupt padtest port  
SA   :out     std_logic_vector(7 downto 0);
DATA :out     std_logic_vector(7 downto 0);---test port
SD   :inout   std_logic_vector(7 downto 0));
end  monitor;
architecture  rtl of  monitor  is
type     state  is (start_r,shift_r,ack_r);
signal   rx_states  : state;
type     states  is   (S0,S1,S2,S3);
signal   next_state :states;
signal   REG        :std_logic_vector(7 downto 0);
signal   DATAR      :std_logic_vector(7 downto 0);
signal   ADDR       :std_logic_vector(7 downto 0);
signal   SDA1       :std_logic;
signal   SCL1       :std_logic;
signal   startb     :std_logic;
signal   stopb      :std_logic;
signal   datab      :std_logic;       ---receive continous data signal
signal   start      :std_logic;
signal   COUNT      :std_logic_vector(3 downto 0);
signal   cnt        :std_logic_vector(1 downto 0);
signal   RIDE       :std_logic;
signal   FIDE       :std_logic;
signal   DRIDE      :std_logic;
signal   DFIDE      :std_logic;
signal   WCTR       :std_logic;
signal   RCTR       :std_logic;
signal   DEN        :std_logic;
signal   cnt2       :std_logic_vector(4 downto 0);
signal   ACK        :std_logic;
signal   WEN        :std_logic;
signal   REN        :std_logic;
signal   databr     :std_logic;
signal   IORB0      :std_logic;
signal   IOWB0      :std_logic;
signal   cnt3       :std_logic_vector(2 downto 0);
signal   AEN        :std_logic;
-- signal   doutr      :std_logic_vector(7 downto 0);
begin
   
process(CLK16x,RESET,cnt)
  begin

if  RESET='0'  then      
  startb<='0';
  datab<='0';
  start<='0';
  cnt<="00";
  stopb<='0';
  REN<='0';
  WEN<='0';
            databr<='0';
  elsif  CLK16x'event  and CLK16x='1' then
    if  SCL1='1' and FIDE='1' then     --monitor start bit  
         startb<='1';
         stopb<='0';
         datab<='0';
         databr<='0';
    elsif  SCL1='1' and RIDE='1'  then --monitor stop bit
         startb<='0';
         stopb<='1';
         databr<='0';
   elsif  COUNT="1000" and  REG="10110000"  
                and startb='1' then  -- device address   B0
         datab<='1';
         databr<='1';
         startb<='0';
    end  if;
--// after writing  B0  and judge the read or write signal
    if     datab='1'  and  REG="10100001"
            and start='1' then --the condition of read  strobe signal (A1)
       REN<='1';
       WEN<='0';
       datab<='0';
    elsif  datab='1' and   REG="10100000"
           and start='1'  then-- the condition of write strobe signal (A0)
WEN<='1';
REN<='0';
datab<='0';
    elsif  stopb='1' or startb='1' then
                     WEN<='0';
REN<='0';
    end   if;
    if  databr='1' and COUNT="1001" and DRIDE='1'  then              
         -- the condition of receive the data from I2C
                start<='1';
    else
                 start<='0';
    end if;
    if   WEN='1'  and COUNT="1001" and DRIDE='1' then
                  cnt<=cnt+1;
    end   if;
end  if;
end process;
process(CLK16x,RESET,rx_states) --- receive the data
  begin
    if  RESET='0' then
rx_states<=start_r;
  COUNT<="0010";
           REG<=(others=>'0');
    elsif   CLK16x'event  and CLK16x='1' then
  if   stopb='1' then
      rx_states<=start_r;
  end  if;
      case  rx_states  is
      
      when  start_r=>            
          if  (startb='1' and DRIDE='1' ) or start='1'  then
           COUNT<="0000";
rx_states<=shift_r;
else              rx_states<=start_r;
           end if;
      
      when   shift_r=>
      if    DFIDE='1'  then  --SCL1='1' and
    COUNT<=COUNT+1; if   COUNT<"1000" then
        rx_states<=shift_r;
       REG<=REG(6 downto 0)&SDA;  ---first MSB                else         
         rx_states<=ack_r;
  end if;
       end if;
      when   ack_r=>  
              if  (COUNT="1001" and DRIDE='1')  then
                 rx_states<=start_r;
   end if;
     end case;           

  end  if;
end process;
   
process(CLK16x,RESET,SDA,SCL)
  begin
  if  RESET='0'  then
  SDA1<='1';
  SCL1<='1';
  RIDE<='0';
  FIDE<='0';
  DRIDE<='0';
  DFIDE<='0';
  ACK<='0';
  elsif CLK16x'event  and CLK16x='1' then
        SCL1<=SCL;
        SDA1<=SDA;
    if   COUNT="1000"  then--and DRIDE='1'  then  
          ACK<='1';
    else--if COUNT="1000" and DFIDE='1' then --question
          ACK<='0';
    end if;
if  (SDA1='1' and SDA='0')  then    ---the falling of the SDA
  FIDE<='1';
  RIDE<='0';
elsif (SDA1='0' and SDA='1')  then  ---the rising of the SDA
                   RIDE<='1';
   FIDE<='0';
    else
                         RIDE<='0';
   FIDE<='0';
    end if;
if  SCL1='0'  and SCL='1' then    --- the rising  of the  SCL
       DRIDE<='1';
       DFIDE<='0';
elsif  SCL1='1' and SCL='0' then  --- the falling  of the  SCL
       DRIDE<='0';
                  DFIDE<='1';
else
       DRIDE<='0';  
       DFIDE<='0';
end if;   
  end if;
end process;
process(RESET,CLK16x,WEN,REN,DFIDE,COUNT,cnt,REG,WCTR,RCTR,next_state,cnt2)
  begin
  if RESET='0' then         
  next_state<=S0;
  IOWB0<='1';
  IORB0<='1';
  RCTR<='0';
  WCTR<='0';
  DATAR<=(others=>'0');
  ADDR<=(others=>'0');
  DATA<=(others=>'0');
-- SA<=(others=>'0');
  INT0<='1';
  cnt2<="00000";
  DEN<='0';
            AEN<='0';
            cnt3<=(others=>'0');
  elsif CLK16x'event  and CLK16x='1' then
       ---generate enable signal to write or read
      if   WEN='1' and DFIDE='1'  and COUNT="1000" and  cnt(0)='0' then
     ADDR<=REG;
                DATAR<=(others=>'Z');
                WCTR<='0';
                RCTR<='0';
   elsif   WEN='1'  and DFIDE='1' and  COUNT="1000" and cnt(0)='1'  then
     DATAR<=REG;
     WCTR<='1';
                RCTR<='0';
   elsif   REN='1' and  DFIDE='1' and  COUNT="1000"  then
      ADDR<=REG;
                DATAR<=(others=>'Z');
     RCTR<='1';
                WCTR<='0';
     elsif     stopb='1' then
                DATAR<=(others=>'0');
     end  if;
                 
     if  REN='1' and  cnt2="00011" then--cnt2="01100" then
         DATA<=SD;                                      ----问题在这里
     --elsif  stopb='1' then
       --   DATA<=(others=>'0');
     end  if;
   
       --DATA<=doutr;  
   --- the machine  is generated to write or read of ISA
case next_state is  
when  S0=>         --SA<=(others=>'Z');  
                          --  SA<=ADDR;   
                             DEN<='0';         
                     if  WCTR='1' or RCTR='1' then       next_state<=S1;      cnt2<=(others=>'0');
                           cnt3<=(others=>'0');                           
                        else
                            AEN<='0';
                            next_state<=S0;
    end if;
when  S1=>                 
    cnt3<=cnt3+1;
   if  cnt3="111" then  
                            next_state<=S2;
   else
                            WCTR<='0';
                            RCTR<='0';
                            AEN<='1';
                  next_state<=S1;
           end  if;
when  S2=>   
                             next_state<=S3;   
    if  REN='1' then
        IORB0<='0';
                             DEN<='0';   
   elsif WEN='1' then
        IOWB0<='0';
                             DEN<='1';   end  if;     
when  S3=>     
                            cnt2<=cnt2+1;     
         if  REN='1' and  cnt2="01100"  then
                             INT0<='0';
         elsif  cnt2="11111" then                  INT0<='1';
                             IORB0<='1';
                             IOWB0<='1';
                             next_state<=S0;
                      else
                next_state<=S3;
end if;
end   case;
  end if;
end process;

   SD<=DATAR   when  (DEN='1' )  else  "ZZZZZZZZ";
   SDA <='0'   when  (ACK = '1') else 'Z';
   IORB<='0'   when (IORB0='0')  else  'Z';
   IOWB<='0'   when (IOWB0='0')  else  'Z';
   SA<=ADDR    when (AEN='1')    else  "ZZZZZZZZ";
end rtl;
回复 支持 反对

使用道具 举报

发表于 2003-9-1 08:54:17 | 显示全部楼层

能不能解释下面的warning!!

Analysis和Synthesis将三态门TRI(IN, OE)转换为IN+!OE的OR的形式。如果不是设计的错误,就不用管它。只不过是软件的提示而已。
原因是:
SD<=DATAR   when  (DEN='1' )  else  "ZZZZZZZZ";以及DATAR的三态造成的。
是软件的一种处理方法。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2003-9-2 10:11:29 | 显示全部楼层

能不能解释下面的warning!!

我想也是,只是想弄清楚为什么,那请问怎么去消除这个warning呢!!
能不能给一个思路啊
回复 支持 反对

使用道具 举报

发表于 2003-9-2 10:22:29 | 显示全部楼层

能不能解释下面的warning!!

将所有的 datar <= (others => 'z');改为datar <= (others =>'0');
It will be OK.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条


手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 ) |网站地图

GMT+8, 2025-10-25 15:43 , Processed in 0.024688 second(s), 5 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表