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

Verilog file list suport #4926

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

JasonBrave
Copy link
Contributor

What are the reasons/motivation for this change?

Most large Verilog/SystemVerilog IP use a file list/command '.f' file to hold list of Verilog file need to be compiled, this change make yosys able to directly parse file list.

Explain how this is achieved.

Implement a read_verilog_file_list command, that read in file list, and calls read_verilog on each Verilog file in the file list. Currently the command only handles file path in file list file, in a future PR I will implement support for +define+ and +incdir+ in file list file.

If applicable, please suggest to reviewers how they can test the change.

@udif
Copy link
Contributor

udif commented Mar 3, 2025

Please note that most, if not all tools, accept any command line argument in their file lists, not just filenames or +define/+incdir.
As far as I remember, the slang front end handles this by reading -f files recursively as part of the command line parser.

Copy link
Member

@KrystalDelusion KrystalDelusion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're adding file list support for the verilog frontend, you should update the read pass in /frontends/verific/verific.cc to call it.

@KrystalDelusion
Copy link
Member

KrystalDelusion commented Mar 3, 2025

@udif The verific frontend for Yosys doesn't do this, so I don't think there's any reason that the read_verilog frontend should. It does however allow recursive calls with -f/-F in the file list. Also it calls it a command-file instead of a file list.

@JasonBrave
Copy link
Contributor Author

All comments addressed, please review @KrystalDelusion

@KrystalDelusion KrystalDelusion self-assigned this Mar 8, 2025
} else {
cmd_error(args, 1, "This version of Yosys is built without Verific support.\n");
args[0] = "read_verilog_file_list";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_verilog_file_list is gated by !defined(__wasm), so it's usage here should be too.

Suggested change
args[0] = "read_verilog_file_list";
#if !defined(__wasm)
args[0] = "read_verilog_file_list";
#else
cmd_error(args, 1, "Command files are not supported on this platform.\n");
#endif

log("Parse a Verilog file list, and pass the list of Verilog files to read_verilog command.\n");
log("\n");
log(" -F file_list_path\n");
log(" File list file contains list of Verilog files to be parsed, any path is treated relative to the file list file\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log(" File list file contains list of Verilog files to be parsed, any path is treated relative to the file list file\n");
log(" File list file contains list of Verilog files to be parsed, any path is\n");
log(" treated relative to the file list file\n");

log("\n");
log(" read_verilog_file_list [options]\n");
log("\n");
log("Parse a Verilog file list, and pass the list of Verilog files to read_verilog command.\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log("Parse a Verilog file list, and pass the list of Verilog files to read_verilog command.\n");
log("Parse a Verilog file list, and pass the list of Verilog files to read_verilog\n");
log("command.\n");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Help messages should break at 80 characters (which is why the |---v---| guides are there).

log(" File list file contains list of Verilog files to be parsed, any path is treated relative to the file list file\n");
log("\n");
log(" -f file_list_path\n");
log(" File list file contains list of Verilog files to be parsed, any path is treated relative to current working directroy\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log(" File list file contains list of Verilog files to be parsed, any path is treated relative to current working directroy\n");
log(" File list file contains list of Verilog files to be parsed, any path is\n");
log(" treated relative to current working directroy\n");

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

Successfully merging this pull request may close these issues.

3 participants