溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Illegal output or inout port connection (port 'out').

發(fā)布時(shí)間:2020-06-24 16:43:33 來源:網(wǎng)絡(luò) 閱讀:4585 作者:lihaichuan 欄目:開發(fā)技術(shù)

一個(gè)4位計(jì)數(shù)器程序在ISE 聯(lián)合modelsim進(jìn)行仿真,代碼如下

testbench的內(nèi)容:

module count4_tb;
 
 reg clk,reset;
 wire [3:0] out;
 parameter DELY=100;
 
 count4 mycount(out,reset,clk);
 
 always #(DELY/2) clk=~clk;
 
 initial begin
  clk=0;
  reset=0;
  #DELY reset=1;
  #DELY reset=0;
  #(DELY*200) $finish;
 end
   
 initial $monitor($time,,,"clk=%d reset=%d out=%d",clk,reset,out);
 
endmodule

 

count4.v的內(nèi)容:

module count4(out,reset,clk
    );
 
  output [3:0] out;
  input reset,clk;
  reg [3:0] out;
 
  always@(posedge clk) begin
  if(reset)
   out<=0;
  else
   out<=out+1;
  end

endmodule

 

功能仿真,沒有錯(cuò)誤,而布局布線后仿真,有如下錯(cuò)誤提示

 Illegal output or inout port connection (port 'out').

改正辦法:

將testbench 中的 count4 mycount(out,reset,clk);改為count4 mycount(.out(out),.reset(reset),.clk(clk));時(shí)序仿真就會(huì)正確運(yùn)行。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI