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

How to implement support for arrays on ports #507

Closed
fl4shk opened this issue Oct 18, 2020 · 4 comments
Closed

How to implement support for arrays on ports #507

fl4shk opened this issue Oct 18, 2020 · 4 comments
Labels

Comments

@fl4shk
Copy link

fl4shk commented Oct 18, 2020

So, Verilog doesn't support arrays on ports, only vectors. The best way to get around this limitation in Verilog, in my opinion, is to encode the array into a vector. This works even for Arrays of Records.

I suggest perhaps making a PackedArray class (like in SV), derived from Value, that takes a shape and a size. I believe this would also solve the issue of not being able to place an Array inside of a Record.

I'll work on developing an example of it.

@fl4shk
Copy link
Author

fl4shk commented Oct 18, 2020

I have decided to wait for ValueCastable to be merged before I build this.

@whitequark
Copy link
Member

I don't think that any changes related to Records should be done before the Record redesign (#342). In general, I would prefer to enable you to use ValueCastable to do this change localized in your codebase than to add it to the core language.

@fl4shk
Copy link
Author

fl4shk commented Oct 18, 2020

Sounds good to me.

@whitequark
Copy link
Member

I believe this question got resolved on IRC, so closing.

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

No branches or pull requests

2 participants