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

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

Open
veripoolbot opened this issue Mar 8, 2018 · 6 comments
Open
Labels
area: data-types Issue involves data-types area: lint Issue involves SystemVerilog lint checking effort: days Expect this issue to require roughly days of invested effort to resolve

Comments

@veripoolbot
Copy link
Contributor


Author Name: Joel Holdsworth
Original Redmine Issue: 1288 from https://www.veripool.org


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

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-03-09T05:07:13Z


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.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Joel Holdsworth
Original Date: 2018-03-10T01:43:23Z


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

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-03-10T17:51:57Z


Use -Wno-BLKANDNBLK

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Joel Holdsworth
Original Date: 2018-03-10T19:00:34Z


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.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-03-10T19:17:21Z


Good point, similar suggested comments added to git.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Joel Holdsworth
Original Date: 2018-03-10T20:32:17Z


Perfect- thansk!

@veripoolbot veripoolbot added area: data-types Issue involves data-types area: lint Issue involves SystemVerilog lint checking effort: days Expect this issue to require roughly days of invested effort to resolve labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: data-types Issue involves data-types area: lint Issue involves SystemVerilog lint checking effort: days Expect this issue to require roughly days of invested effort to resolve
Projects
None yet
Development

No branches or pull requests

1 participant