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

Error-BLKANDNBLK with nested modules in generate block #648

Open
veripoolbot opened this issue May 21, 2013 · 2 comments
Open

Error-BLKANDNBLK with nested modules in generate block #648

veripoolbot opened this issue May 21, 2013 · 2 comments

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented May 21, 2013


Author Name: Krzysztof Jankowski
Original Redmine Issue: 648 from https://www.veripool.org


The attached code gives error: ??%Error-BLKANDNBLK: condgen.sv:29: Unsupported: Blocked and non-blocking assignments to same variable: v.datat??.
When code gets pasted directly in place of module then the entire example compiles just fine.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented May 22, 2013


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-05-22T02:41:22Z


I'm not immediately sure how to fix this. The conflict is at that port since a single bit is selected that is effectively the same as an assignment, causing the message.

The good news is for now you can lint_off that error (it's an error because it can cause bad results if otherwise ignored)

// verilator lint_off BLKANDNBLK
logic [7:0] 	      datat;
// verilator lint_on BLKANDNBLK

Test added as t_param_if_blk.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jan 26, 2019


Original Redmine Comment
Author Name: Olivier D'Arcy
Original Date: 2019-01-26T04:28:27Z


Hi, I experience the same kind of issue with conditional generate statements.

Here (codegen2.sv attached) is another code example that highlights the problem.
You need to remove the lint pragmas. You will hit the Error BLKANDNBLK. Then if you add the lint pragmas for BLKANDNBLK, you get a MULTIDRIVEN warning which prevents the code from compiling. Adding the lint pragmas for the MULTIDRIVEN warning solves the problem.

I was able to go around it by using lint off pragmas.

Still my RISCV RTL codebase heavily uses the generate if/else constructs so I get tons of such BLKANDNBLK errors. Some RTL sources are from third party (memory models generated by memory compilers, etc) so inserting pragmas in these files is not an ideal solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.