Error-BLKANDNBLK with nested modules in generate block
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.
#1 Updated by Wilson Snyder almost 6 years ago
- Category set to Lint
- Status changed from New to Confirmed
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.
#2 Updated by Olivier D'Arcy 3 months ago
- File condgen2.sv added
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.
Also available in: Atom