Skip to content

Conversation

@wsipak
Copy link
Collaborator

@wsipak wsipak commented Jun 19, 2023

WIP follow-up to (and based on) #521

I think this might be fixed by #533 and not needed anymore.

Input:

typedef logic [3:0][7:0] my_struct_packed_t;
module single_range_dot_access (
    input  my_struct_packed_t x,
    output my_struct_packed_t y
);
   assign y[2][1] = x[0][0];
endmodule : single_range_dot_access

Output:

module single_range_dot_access(x, y);
  (* wiretype = "\my_struct_packed_t" *)
  input [31:0] x;
  (* wiretype = "\my_struct_packed_t" *)
  output [31:0] y;
  assign y[9:9] = x[0:0];
  /** AST_TYPEDEF **/
endmodule

The indexes in the assignment of y[2][1] = are calculated wrongly.
The reason is that the plugin reverses some ranges and then calculates 2*4+1 instead of 2*8+1.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant