在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4093|回复: 8

[求助] modelsim6.5应用DPI的问题

[复制链接]
发表于 2012-9-7 11:29:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
最近需要用到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文件呢??
查了好多资料都没搞定,同学也没有这方面的经验。还请懂的前辈们多多赐教啊!!
 楼主| 发表于 2012-9-7 13:39:08 | 显示全部楼层
自己顶下,别沉了啊!
发表于 2012-9-7 15:55:08 | 显示全部楼层
xie xie fen xiang !
发表于 2012-9-7 20:57:42 | 显示全部楼层
看看 你的 modelsim安装文件夹里面有没有一个gcc?
如果有的话,就用这个。没有的话你就悲剧了 。
发表于 2012-11-8 09:42:28 | 显示全部楼层
帮顶,gcc文件哪里可以下载啊,我也在用modelsim6.5仿真
发表于 2013-3-23 17:06:34 | 显示全部楼层
xie xie fen xiang !
发表于 2013-4-1 13:08:38 | 显示全部楼层
DPI不是用gcc编译的,不需要下载gcc
可以先用visual studio建立一个dll(动态库)的项目,编译生成dll文件。编译要用到modelsim生成的若干头文件。编译完成后吧dll复制到modelsim的项目里,就可以了
发表于 2014-4-10 14:57:32 | 显示全部楼层

你是说把C文件在VS中编译成dll文件?
发表于 2015-3-6 22:20:26 | 显示全部楼层
同求,楼主问题解决了没?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-21 11:03 , Processed in 0.024710 second(s), 9 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表