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

bsc accepts, ignores -o option with -verilog #47

Open
cbiffle opened this issue Feb 11, 2020 · 2 comments
Open

bsc accepts, ignores -o option with -verilog #47

cbiffle opened this issue Feb 11, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cbiffle
Copy link
Contributor

cbiffle commented Feb 11, 2020

Steps to repro:

bsc -verilog -o Top.v Top.bs

Expected result: output goes into Top.v

Expected result, slightly darker timeline: -o flag is rejected as incompatible with Verilog output, compile fails.

Actual result: -o flag silently ignored, output goes into mkTop.v (as that is the name of the module in Top.bs).

@quark17
Copy link
Collaborator

quark17 commented Feb 11, 2020

I apologize that the user guide document is not yet available.

The -o flag is for naming the simulation executable generated during a linking call to BSC (bsc -e <topmod>). It would be reasonable to have BSC warn if you specify -o and are not linking into an executable.

Most tools that take Verilog files as input expect that a module M will be defined in a file called M.v, and BSC respects this convention by generated one file per module and named for the module. A single BSC package (like Top.bsv) can define many modules and therefore generate many Verilog outputs. A single -o would not be sufficient. In theory, a pragma in the source code could be used to rename the generated Verilog (or maybe a more complicated flag) but if someone really wants defy this convention, it's probably best that they rename the outputs themselves.

@cbiffle
Copy link
Contributor Author

cbiffle commented Feb 11, 2020

Rejecting the unused -o flag as incompatible with -verilog would be fine by me.

@bpfoley bpfoley added enhancement New feature or request good first issue Good for newcomers labels Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants