rahdirs
Advanced Member level 1
Hi everyone,
After running Spyglass, I'm seeing a couple of errors being reported on logical OR operation.
Posting an example here:
I had this code initially, so the initial error was that the operator || has a width mismatch on the operands. This was puzzling to me as Verilog usually is able to type-cast signal b automatically to 6 bit vector & the resulting output of the logical operation should be a 1 bit variable. Anyway, i did a manual casting & changed it to :
After manually extending b, i see a new error that logical operation (in this case ||) is not allowed on a vector. Does anyone know why Lint is reporting an error on logical operations on a vector ?
I can think of the below solution to this but it makes the code so messy.
Looking forward to your suggestions !!
After running Spyglass, I'm seeing a couple of errors being reported on logical OR operation.
Posting an example here:
Code Verilog - [expand] 1 2 3 4 wire [5:0] a; wire b, c, d; assign d = c & (a || b);
I had this code initially, so the initial error was that the operator || has a width mismatch on the operands. This was puzzling to me as Verilog usually is able to type-cast signal b automatically to 6 bit vector & the resulting output of the logical operation should be a 1 bit variable. Anyway, i did a manual casting & changed it to :
Code Verilog - [expand] 1 assign d = c & (a || ({5'b0,b}));
After manually extending b, i see a new error that logical operation (in this case ||) is not allowed on a vector. Does anyone know why Lint is reporting an error on logical operations on a vector ?
I can think of the below solution to this but it makes the code so messy.
Code Verilog - [expand] 1 assign d = c & (~(!(a | ({5'b0,b}))));
Looking forward to your suggestions !!