Skip to content

Assignment to struct fields in different blocks are not supported #2103

Description

@bbawj

From the latest main:

6.0 (ebmc-6.0-227-gb11cd715)

Here is a minimal example

typedef struct {
  logic field1;
  logic field2;
} structure_t;

module debug (
    input wire clk,
    input wire rst
);
  structure_t s;
  always @(posedge clk) begin
    s.field1 <= 0;
  end
  always @(posedge clk) begin
    s.field2 <= 0;
  end

  initial assert (s.field1 == 0);
endmodule

Output:

EBMC version 6.10.0 (7483d0de) 64-bit x86_64 linux
Converting
Type-checking Verilog::debug
Synthesis Verilog::debug
file debug.sv line 15: conflict with previous assignment
CONVERSION ERROR

If i change the assert to the following property instead:

 property p;
    @(posedge clk) rst |=> ##1 s.field2 == 0;
  endproperty
  assert property (p);

Output:

EBMC version 6.10.0 (7483d0de) 64-bit x86_64 linux
Converting
Type-checking Verilog::debug
file debug.sv line 19: unknown identifier field1
CONVERSION ERROR

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions