verilog中文件的读取问题

duoniandxibei 2011-04-22 10:48:55
我现在在做verilog的仿真工作,我的任务是读取一个二进制的视频码流,并提取出每个数据单元,但readmemb不能读取连续的二进制文件,要用PLI程序怎么实现呢,哪位大侠给帮帮忙?
...全文
502 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
哈皮歪詩 2011-04-23
  • 打赏
  • 举报
回复
My two cents

(1) one way to do this is to write some script, such as perl to translate the binary file to text file

(2) Or you can use $fread function

I don't have simulation tool with me right now, so I can not tell for sure if you need to use system verilog (.sv file) when you use the $fread. But do check out the functions provided by system verilog, which has a richer set of functions for file i/o


I don't think you need PLI, that is too complicated for your case. Even if you do need to communicate between C and Verilog, try to use system verilog's DPI, which is much easier to use than PLI.

6,163

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 硬件设计
社区管理员
  • 硬件设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧