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

Verilator fails to create files with long names #937

Closed
veripoolbot opened this issue Jun 25, 2015 · 4 comments
Closed

Verilator fails to create files with long names #937

veripoolbot opened this issue Jun 25, 2015 · 4 comments
Assignees
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Luke Yang
Original Redmine Issue: 937 from https://www.veripool.org
Original Date: 2015-06-25
Original Assignee: Wilson Snyder (@wsnyder)


I have a sufficiently complex design, and I ran it through Verilator. Verilator breaks when it's emitting files, because the file name is too long. (On Linux the file name length limit is 255 characters.) It's one of the {prefix}{each_verilog_module}.h/cpp files. Apparently stuffs a lot of parameters into the name of the final net lists and use these names as file names.

Precisely, it breaks at V3OutFile::V3OutFile(const string&, V3OutFormatte::Language), where a call to V3File::new_fopen_w() (which calls fopen()) returned with a failure.

I had to intercept the open() and stat() system calls and hash the file names (coming from Verilator) that are too long.

It might be worth your consideration to choose a more space-efficient encoding when naming the final net lists or output files. Right now it's all hard-coded with raw module names and parameter values.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-07-06T01:40:53Z


I started a bunch of work on hashing filenames, but realized then the parameter code already should not allow names longer than 30 characters due to the parameters alone. Can you please provide an example of one of the long generated names? Thanks.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Todd Strader (@toddstrader)
Original Date: 2015-09-18T12:08:30Z


Here's a fork with a regression test showing this:

https://github.com/toddstrader/verilator-long-module-name

I believe the issue was not caused by Verilator's treatment of parameters, but another tool's. We were writing out the netlist of a design and the tool we were using to do this flattened parameter values into each instance's module name. So the root issue is that Verilator can't handle really long module names.

To reproduce:

$ test_regress/t/t_big_name.pl

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-09-20T00:14:38Z


Fixed in git towards 3.877.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-11-01T13:22:41Z


In 3.878.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants