Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1288

scr1 test suite: In some cases mixed assignment to struct member fails

Added by Joel Holdsworth over 1 year ago. Updated over 1 year ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Lint
% Done:

0%


Description

This SystemVerilog code...

typedef struct packed {
  logic apples;
  logic oranges;
} type_test_struct_s;

module test(
  input clk,
  output type_test_struct_s mystruct_broken
);

type_test_struct_s mystruct_working;

assign mystruct_working.apples = 1'b0;
assign mystruct_broken.apples = 1'b0;

always_ff @(posedge clk) begin
  mystruct_working.oranges <= 1'b1;
  mystruct_broken.oranges <= 1'b1;
end

endmodule

...fails to parse with the following error...

%Error-BLKANDNBLK: test_mixed_assignment.sv:9: Unsupported: Blocked and non-blocking assignments to same variable: mystruct_broken
%Error: Exiting due to 1 error(s)
%Error: See the manual and http://www.veripool.org/verilator for more assistance.
%Error: Command Failed /usr/local/bin/verilator_bin -sv --cc test_mixed_assignment.sv

History

#1 Updated by Wilson Snyder over 1 year ago

  • Category changed from Parser to Lint
  • Status changed from New to Confirmed

Added this to the documentation of this error:

"It is generally safe to disable this error when one of the assignments is inside a public task, or when the blocked and non-blocking assignments have non-overlapping bits and structure members.

So for now just disable it. It would be desirable not to error on this case, this would require teaching V3Delayed to track each bit independently rather than the whole register.

#2 Updated by Joel Holdsworth over 1 year ago

Am I being obtuse? I can't see a way to disable the error at run-time.

#3 Updated by Wilson Snyder over 1 year ago

Use -Wno-BLKANDNBLK

#4 Updated by Joel Holdsworth over 1 year ago

Ok -- now I feel silly.

My feedback is that - expected that -Wno-XX would only affect warnings, not errors. Would it be possible to add that detail to the man page?

Also, could you add "(with the -Wno-BLKANDNBLK command line option)" after "It is generally safe to disable this error ..."? I think that would have saved me some confusion.

#5 Updated by Wilson Snyder over 1 year ago

Good point, similar suggested comments added to git.

#6 Updated by Joel Holdsworth over 1 year ago

Perfect- thansk!

Also available in: Atom