modelsim 6.2b 的初次使用

module count_tp;
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*20) $finish;
end
initial $monitor($time,,,
"clk=%d reset=%d out=%d",clk,reset,out);
endmodule

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   


-- Loading package standard
** Error: D:/Modeltech_6.2b/examples/count_tp.v(1): near "module": expecting: ARCHITECTURE CONFIGURATION
ENTITY LIBRARY PACKAGE USE
** Error: D:/Modeltech_6.2b/examples/count_tp.v(3): near "3:0]": (vcom-113) Mantissa part of based integer
literal terminates with ']'; should be ':'.
** Error: D:/Modeltech_6.2b/examples/count_tp.v(18): near "3:0]": (vcom-113) Mantissa part of based integer
literal terminates with ']'; should be ':'.
** Error: D:/Modeltech_6.2b/examples/count_tp.v(20): near "3:0]": (vcom-113) Mantissa part of based integer
literal terminates with ']'; should be ':'.

網上搜索了半天不得法門,非常鬱悶
今天無聊,就在那相相啊,瞎搗鼓,終於知道啥問題了
編譯菜單出來後,發現有個項目,properties, 打開後,選擇了,general,再選 verilog,並選OK
再 編譯
哈哈,綠色的提示出來了,OL,順利編譯

仔細想了下,應該是這個麼原因:
工程默認是用VHDL 的,所以在編譯時,應該先擇 verilog地

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章