文章 ID: 000077004 內容類型: 產品資訊與文件 最近查看日期: 2015 年 01 月 01 日

如何在 ModelTech 中編譯器語言介面 (PLI), convert_hex2ver.c, 以模擬包含 ROM 或初始化 RAM 的設計MAX PLUS® II 輸出檔案?

環境

  • Intel® Quartus® II 訂閱版
  • BUILT IN - ARTICLE INTRO SECOND COMPONENT
    描述

    從 EDIF 網站 (HTTP://www.edif.org/lpmweb/convert_hex2ver.c) 下載convert_hex2ver.c檔案。

     

    • 建立稱為檔案 veriuser_mti.c 含下列內容:
      #include "veriuser.h"
      #include "acc_user.h"
      
      extern convert_hex2ver();
      
      s_tfcell veriusertfs[] =
      {
          /*** Template for an entry:
          { usertask|userfunction, data,
            checktf(), sizetf(), calltf(), misctf(),
            ""},
          Example:
          { usertask, 0, check, 0, func, misctf, "" },
          ***/
      
          /*** add customer task entries here ***/
          /* This converts intel binary bit patterns to a verilog readmemb format*/
          {usertask, 0, 0, 0, convert_hex2ver,   0,  "",  1},
          
      {0} /*** final entry must be 0 ***/
      };
      
      /* mti interface */
      void init_usertfs()
      {
       p_tfcell usertf;
       for (usertf = veriusertfs; usertf; usertf  ) {
        if(usertf->type == 0)
          return;
        mti_RegisterUserTF(usertf);
       }
      }
      
    • 編譯並連結兩個 C 源檔案 (veriuser_mti.cconvert_hex2ver.c).例如:

       

      gcc -c -I/full_path_to_modelsim> /include convert_hex2ver.c
      gcc -c -I/
      full_path_to_modelsim>/include veriuser_mti.c
      ld -G -o altera.sl convert_hex2ver.o veriuser_mti.o

    • 建立並編輯本機副本 modelsim.ini 包括下列資訊:

       

      Veriuser = /full_path_to_where_you_created_altera.sl>/altera.sl

    • 使用 vlog 命令。流量分析檔案時,您應該會看到下列訊息 vlog:

      Loading work.design_name> Loading / full_path_to_where_you_created_altera.sl>/altera.sl

    • 繼續進行模擬。

    相關產品

    本文章適用於 1 產品

    Intel® 可程式裝置

    這個頁面的內容綜合了英文原始內容的人工翻譯譯文與機器翻譯譯文。本內容是基於一般資訊目的,方便您參考而提供,不應視同完整或準確的內容。如果這個頁面的英文版與譯文之間發生任何牴觸,將受英文版規範及管轄。 查看這個頁面的英文版。