-
Notifications
You must be signed in to change notification settings - Fork 150
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
Reject -o flag when using -verilog #357
base: main
Are you sure you want to change the base?
Conversation
Whether a flag is named as a warning or error Wxxx vs Exxx is just a convention. What it actually does depends on how the message fits into the control flow (and whether the user has promoted some warnings to errors and so on. In this case, the flag handler either returns a function to update to update the current Flags data OR a message explaining why flag decoding failed (i.e. an error). That being said, I think an error totally fine here. If someone passes in the -o flag when the compiler isn't linking a simulation executable it's not going to do anything sensible with it. Failing is probably better than charging off and doing the wrong thing. However, there is another subtlety here. The test isn't actually Bluesim vs Verilog, it's compiling [.bs, .bsv] -> [.ba, .v] vs linking [.ba, .v] -> an "executable" (often a shell script invoking Bluesim or a Verilog simulator). I think that means the check doesn't belong in flag decoding but rather in Does that make sense? |
I also came here to apologize that the original issue is not well worded. As @nanavati said, the The The two modes can accept many of the same flags, but many other flags are specific to one or the other. For the most part, these aren't checked! I would guess that there are many more flags besides The At the moment, the only warnings that occur are warnings while parsing individual flags. You'll see, for example, that once
This doesn't let the But I'm also OK with this being an error. (If we wanted it to be an error that can be downgraded, that would require some extra code in |
@nanavati @quark17 OK, this is making sense. If we check flag compatibility after |
@quark17 ping! |
Hm. You're right, that there's currently no way to tell if the user provided It's worth noting that, for path flags, we use a token ( Another option is to not replace it at all, leave it as Another option is to not use Probably we should start by auditing all the flags and when they are used (and under what circumstances we'd want to warn/error). But if you just want to fix things for this one flags (and maybe it can be argued that this flag is one that people will trip over more?), then using a |
It's also worth noting that source programs can attach flags to modules and functions, with an attribute ( If one is thinking generally about command-line decode issues, it might be worth starting by thinking about the attribute situation -- solutions for other issues might just fall out of any solution for this. |
Proposed fix for #47 .
@quark17 not sure this is the right solution (e.g. I intended for this to be a warning but it's acting like an error), but I thought I'd post it early and iterate on your feedback!