Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1040

DPI string parameter and readmemh

Added by Stefan Wallentowitz about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
Unsupported
% Done:

0%


Description

Hi,

I am using this construct:
export "DPI-C" task do_readmemh_file;

task do_readmemh_file;
   input string file;
   $readmemh(file, mem);
endtask

It generates VL_READMEM_N which does not exist. Do I miss anything? I found an ugly workaround with an integer array and memcpy, but I am wondering if I am missing something.

Thanks, Stefan

readmem_string.patch View (9.45 KB) Stefan Wallentowitz, 02/29/2016 10:43 AM

History

#1 Updated by Wilson Snyder about 1 year ago

First time this has probably come up. Can you try making a patch to fix this? Add a "extern void VL_READMEM_N()" function inside verilated_heavy.h with arguments similar to the declarations in verilated.h, then in verilated.cpp make a READMEM_N function. The existing VL_READMEM_W function up front converts to a ofilenamez; this instead should convert to a string and call READMEM_N. If you look at the existing VL_FLOPEN_N* functions you'll get the idea. Thanks.

#2 Updated by Stefan Wallentowitz about 1 year ago

Yes, I will give it a try. Thanks for the hint!

#3 Updated by Stefan Wallentowitz 12 months ago

Hi Wilson,

attached please find this (rather trivial) patch.

Cheers, Stefan

#4 Updated by Wilson Snyder 12 months ago

  • Status changed from New to Resolved
  • Assignee set to Stefan Wallentowitz

Great, thanks for the patch, fixed in git towards 3.881.

#5 Updated by Wilson Snyder 12 months ago

  • Status changed from Resolved to Closed

In 3.882.

Also available in: Atom