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

reversed ranges #532

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

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.

None yet

1 participant