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

Update spyglass.py #324

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

Update spyglass.py #324

wants to merge 6 commits into from

Conversation

jgbhatia
Copy link

The run_main runs the spyglass tool. There are two targets in the make file. args = ["-i"] option is required to ignore the error code from the first design read target and run the lint target.

The run_main runs the spyglass tool. There are two targets in the make file. args = ["-i"] option is required to ignore the error code from the first design read target and run the lint target.
@olofk
Copy link
Owner

olofk commented Jul 6, 2022

Hi @jgbhatia. Thank you for this patch. I'm not completely sure how the spyglass backend works but if I understand correctly it tries to run multiple goals and if any of them fails, it will not run the other ones. I wonder if everyone wants to have it this way or if we should add an option so that users can select which behavior they want. Perhaps @imphil can give some input here?

Your fix looks fine, but I think we can make it simpler. spyglass doesn't handle plusargs (AFAIU) so we only need to set the -i flag, not parse plusargs in run_main.

@jgbhatia
Copy link
Author

jgbhatia commented Jul 6, 2022

Hi @olofk, thanks for your response. When I configured fusesoc for my design setup, I found that the setup was created for spyglass but the spyglass did not run. It was because the run_main routine was not present. After adding the run_main routine, I hit another issue. The makefile has two targets, run-goal-design_read & run-goal-lint_lint_rtl. It always used to run the design_read goal and exit with an error. Hence I added -i option so that make can ignore the error and execute the next goal.
The errors in the design_read goal can be due to various reasons. One of the most common reason for the error is due to the use of standard cells or hard macros. The fix for this issue required use of read_file -type gateslib command, which I could not find. So -i option was the easiest one to work around the error.
With some more debugging, I found that this behavior is related with the "set_option enable_pass_exit_codes yes" option. I am not sure about the history behind it. But setting this option to no, removing it from makefile and removing -i argument makes spyglass run as expected. This code is not yet checked in into git. Based on the discussion, I can push the changes in the repository for review and merge.
We can discuss the support for gateslib file type in a separate thread.

@olofk
Copy link
Owner

olofk commented Jul 6, 2022

I see. I have no idea why set_option enable_pass_exit_codes yes is in the template file. Generally, I want to avoid setting default options for exactly this reasons. Different people have different needs so it's better to let the users who need it set it themselves. But unfortunately I'm not a spyglass user myself so I can't really judge if it makes sense to set this option by default. It would be great if other spyglass users could give their input as well.

@jagriti-bhatia
Copy link

I have pushed the changes as mentioned by @jgbhatia

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