微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微电子和IC设计 > IC验证交流 > modelsim6.5应用DPI的问题

modelsim6.5应用DPI的问题

时间:10-02 整理:3721RD 点击:
最近需要用到DPI进行C代买和verilog的仿真验证,工具限定为modelsim(没办法)。参照ModelSim? SE User’s ManualSoftware Version 6.5f,应用DPI有5个step如下:

  1. 1. Run vlog to generate a dpiheader.h file.
  2. This file defines the interface between C and ModelSim for exported and imported tasks and functions. Though the dpiheader.h is a user convenience file rather than a requirement, including dpiheader.h in your C code can immediately solve problems
  3. caused by an improperly defined interface. An example command for creating the header file would be:
  4. vlog -dpiheader <dpiheader>.h files.v
  5. 2. Required for Windows only; Run a preliminary invocation of vsim with the-dpiexportobj switch.Because of limitations with the linker/loader provided on Windows, this additional step is required. You must create the exported task/function compiled object file (exportobj) by running a preliminary vsim command, such as:vsim -dpiexportobj exportobj top3. Include the dpiheader.h file in your C code.ModelSim recommends that any user DPI C code that accesses exported tasks/functions, or defines imported tasks/functions, should include the dpiheader.h file. This allows the C compiler to verify the interface between C and ModelSim.4. Compile the C code into a shared object.Compile your code, providing any .a or other .o files required.For Windows users — In this step, the object file needs to be bound together with the.obj that you created using the -dpiexportobj switch, into a single .dll file.5. Simulate the design.

复制代码


其他步骤都还好,但STEP4的For Windows user部分,该如何将C源文件编译生成的.o和第二部生成的.obj链接成为一个.dll文件呢?
查了好多资料都没搞定,同学也没有这方面的经验。还请懂的前辈们多多赐教啊!

自己顶下,别沉了啊!

xie xie fen xiang !

看看 你的 modelsim安装文件夹里面有没有一个gcc?
如果有的话,就用这个。没有的话你就悲剧了 。

帮顶,gcc文件哪里可以下载啊,我也在用modelsim6.5仿真

xie xie fen xiang !

DPI不是用gcc编译的,不需要下载gcc
可以先用visual studio建立一个dll(动态库)的项目,编译生成dll文件。编译要用到modelsim生成的若干头文件。编译完成后吧dll复制到modelsim的项目里,就可以了

你是说把C文件在VS中编译成dll文件?

同求,小编问题解决了没?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top