音影先锋亚洲天堂网|电影世界尽头的爱完整版播放|国产 熟女 91|高清无码免费观看欧美日韩|韩国一区二区三区黄色录像|美女亚洲加勒比在线|亚洲综合网 开心五月|7x成人在线入口|成人网站免费日韩毛片区|国产黄片?一级?二级?三级

登錄 免費(fèi)注冊(cè) 首頁(yè) | 行業(yè)黑名單 | 幫助
維庫(kù)電子市場(chǎng)網(wǎng)
技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng)
驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe

請(qǐng)教一個(gè)quartus編譯時(shí)的警告

作者:雷風(fēng) 欄目:EDA技術(shù)
請(qǐng)教一個(gè)quartus編譯時(shí)的警告
1 variable "clock_divide" may not be assigned a new VALUE in every possible path through the Always Construct.  Variable "clock_divide" holds its previous VALUE in every path with no new VALUE assignment, which may create a combinational loop in the current design.

這個(gè)警告的意思是不是說我必須在always每一條可能的路徑中都給state_next一個(gè)明確的值?

2 Latch counter[4] has unsafe behavior
    Warning: Ports D and ENA on the latch are fed by the same signal state.process

這個(gè)警告什么意思我就一點(diǎn)也不明白了
還請(qǐng)大家指點(diǎn)

2樓: >>參與討論
雷風(fēng)
沒有高手愿意幫忙么

沒有高手愿意幫忙么?
程序如下:
`define freq_div 32      //分頻系數(shù)
MODULE pwm
(
clk,
pwm_enable,
resetn,
pwm_out,
key_add,
key_dec,
key_duty,
key_clock
);
//Inputs
input clk;     //Input Clock to be divided
input pwm_enable;   //Enable signal,撥碼開關(guān)1,pin58
input resetn;    //Reset,pin23
input key_add;    //pin 48
input key_dec;    //pin 49
input key_duty;    //pin 57,you must press this key first
input key_clock;   //pin 62
//Outputs
OUTPUT pwm_out;       //PWM OUTPUT,pin 187
//Signal Declarations
reg [31:0] counter;   //PWM Internal Counter
reg pwm_out;    //PWM OUTPUT
reg [31:0] duty_cycle;  //Duty Cycle VALUE
reg [31:0] clock_divide; //Clock Divide VALUE
reg [2:0] state;
reg [2:0] state_next;
reg key_done;      //按鍵掃描完成
reg key_in_reg;    //有鍵按下,進(jìn)入按鍵處理程序

//parameter declarations
parameter  idle =   3'B001,
    key_in =  3'B010,
    PROCESS =  3'B100;
    
always @( posedge clk or negedge resetn )
begin
  if( !resetn )
   begin
    state = `freq_div )
      begin
       key_done = 1'b1;
       state_next = PROCESS;  
      end
     else
      begin
       key_done = 1'b0;
       state_next = key_in;
      end
    end
    
   PROCESS:
    begin
     if( pwm_enable )
      begin
       if ( counter >= duty_cycle )
        begin
         pwm_out = 1'b1;
         if (counter >= clock_divide)
          counter = 0;
        end  
       else
        begin
         if (counter == 0)
          pwm_out = 1'b0;
         else
          pwm_out = pwm_out;
         counter = counter + 1;
        end
      end
     else
      begin
      counter = counter;
      pwm_out = 1'b0;
      if( key_in_reg )
       state_next = key_in;
      else state_next = PROCESS;   
      end
    end
   default:
    state_next = idle;
  endcase
end
always @( negedge key_add or negedge key_dec or negedge key_duty or negedge key_clock )
begin
  if( !key_add )
  begin
   duty_cycle = duty_cycle + 1;
   if( duty_cycle > clock_divide )
    duty_cycle = duty_cycle;
   key_in_reg <= 1;
  end
  if( !key_dec )
  begin
   duty_cycle = duty_cycle - 1;
   if( duty_cycle == 32'd0 )
    duty_cycle = 0;
   key_in_reg <= 1;  
  end
  if( !key_duty )
   begin
    duty_cycle = duty_cycle + 1;
    key_in_reg <= 1;
   end
  if( !key_clock )
   begin
    clock_divide = clock_divide + 1;
    key_in_reg <= 1;
   end
end

endMODULE

3樓: >>參與討論
oo1xx
有l(wèi)atch!
一個(gè)是狀態(tài)不完全,一個(gè)是有l(wèi)atch

參與討論
昵稱:
討論內(nèi)容:
 
 
相關(guān)帖子
弱弱地問:pof和sof的區(qū)別
請(qǐng)教vhdl
工作中有困難,急請(qǐng)南京VHDL家教.
問一個(gè)CPLD下載配置的問題
求modelsim6.0
免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入


Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào)