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

Would you please implement those enum methods for SystemVerilog ? #263

Open
forthyen opened this issue Nov 16, 2023 · 1 comment
Open

Would you please implement those enum methods for SystemVerilog ? #263

forthyen opened this issue Nov 16, 2023 · 1 comment

Comments

@forthyen
Copy link

like this

// Element width
typedef enum logic [2:0] {
EW8 = 3'b000,
EW16 = 3'b001,
EW32 = 3'b010,
EW64 = 3'b011,
EW128 = 3'b100,
EW256 = 3'b101,
EW512 = 3'b110,
EW1024 = 3'b111
} vew_e;

// Vector type register
typedef struct packed {
logic vill;
logic vma;
logic vta;
vew_e vsew;
} vtype_t;

module top
(
);

vtype_t a;
vew_e b;

initial begin
a = 6'h0;
b = a.vsew;
b = a.vsew.next();
end;

endmodule;

Thanks,

@zachjs
Copy link
Owner

zachjs commented Dec 5, 2023

Thanks for filing this request! I have started work on adding support for this feature. It may be a week or so before it is ready.

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

No branches or pull requests

2 participants