Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use string variable as $fopen argument #947

Closed
veripoolbot opened this issue Jul 21, 2015 · 2 comments
Closed

Can't use string variable as $fopen argument #947

veripoolbot opened this issue Jul 21, 2015 · 2 comments
Assignees
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800

Comments

@veripoolbot
Copy link
Contributor


Author Name: Sven Stucki
Original Redmine Issue: 947 from https://www.veripool.org
Original Date: 2015-07-21
Original Assignee: Wilson Snyder (@wsnyder)


Example:

 string fn;
 $fopen(fn, "w");

This leads to an error when compiling with verilator. After applying your suggested fix (from this thread: http://www.veripool.org/boards/2/topics/1662?r=1665#message-1665), the error message is:

verilator/include/verilated.h: In function 'IData VL_FOPEN_NI(std::string, IData)':
verilator/include/verilated.h:360:103: error: invalid conversion from 'IData {aka unsigned int}' to 'const char*' [-fpermissive]
 inline IData VL_FOPEN_NI(std::string ofilename, IData mode) { return VL_FOPEN_S(ofilename.c_str(),mode); }
                                                                                                        ^
verilator/include/verilated.h:356:14: error:   initializing argument 2 of 'IData VL_FOPEN_S(const char*, const char*)' [-fpermissive]
 extern IData VL_FOPEN_S(const char* filenamep, const char* mode);

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-07-21T22:43:44Z


Fixed in git towards 3.875.

See the "download" tab or you can get a patch for the existing tarball like this:

git clone http://git.veripool.org/git/verilator
cd verilator
git show 445c83a

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-08-13T01:44:43Z


In 3.876.

@veripoolbot veripoolbot added resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800 labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800
Projects
None yet
Development

No branches or pull requests

2 participants