2019年12月13日 星期五

Altera ModelSim 6.5b 的使用與設定

Altera ModelSim 6.5b 的使用與設定

參考來源 http://ccckmit.wikidot.com/aq:quartus



我們使用的開發工具是 Altera Quartus II  9.1 版,

專案建立
選擇:File/New/New Quartus II project 即可建立之。


Verilog 檔案
// Ch02 and_gate.v

// 二輸入及閘 (閘層描述)
module and_gate (A, B, O);
input  A, B; // A, B 一位元輸入
output O; // O    一位元輸出
and (O, A, B);
endmodule

測試檔案

選擇:File/New/Design Files/Verilog HDL file 即可建立之。

// Ch02 T.tfw
// 二輸入及閘 (測試平台程式)

// 時間單位 1ns, 時間精確度10 ps
`timescale 1ns/10ps

module T;
reg A = 1'b0; // A 暫存器資料初值為‘0’
reg B = 1'b0; // B 暫存器資料初值為‘0’
wire O;

// 建立and_gate 的模組例證
and_gate UUT (.A(A),.B(B),.O(O));

// initial程序結構區塊, 產生A、B輸入信號波形
initial
begin
  #100; // 100ns
    B = 1'b1; // “01”
  #100; // 200ns
    A = 1'b1; // “10”
    B = 1'b0;
  #100; // 300ns
    B = 1'b1; // “11”
  end

initial
begin
  #400; // 模擬終止時間  400 ns
    $stop;
end

endmodule


設定






  • 設定模擬工具路徑:在 Tools/Options/General/EDA Tools Options 中,設定 ModelSim-Altera 的路徑 (筆者電腦中的路徑是 C:\altera\11.0\modelsim_ase\win32aloem)
  • 設定模擬工具:在 Assignments/Setting/EDA Tool Settings/Simulation 中,設定下列欄位
    • Tool name = ModelSim-Altera
    • Format for output netlist = Verilog HDL
    • Time Scale = 10us
    • Output Directory 預設為 simulation/modelsim
    • Compile Test Bench 設定 Test Bench
      • 您必需先按下 TestBench 钮,然後用 New 建立 Test Bench ,以本範例為 T)





執行程式


執行ModelSim6.5b程式 (設定)

按Zoom畫面中的

使ModelSim6.5b程式上的波形在優化的位置上



整個畫面


沒有留言:

張貼留言

Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3

  Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3 AngularJS 實例 <!DOCTYPE html> <html> <head> <meta charse...