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

Expand semantics of Array from MutableSequence to MutableMapping #73

Open
nmigen-issue-migration opened this issue May 12, 2019 · 4 comments
Labels

Comments

@nmigen-issue-migration
Copy link

@nmigen-issue-migration nmigen-issue-migration commented May 12, 2019

Issue by whitequark
Sunday May 12, 2019 at 13:25 GMT
Originally opened as m-labs/nmigen#66


An Array is essentially a mux, and there are several equally valid ways to drive a mux. Currently only straight binary is supported. It would be nice to also have one-hot and priority encodings, since all of these are trivially representable directly in RTLIL and Verilog.

One thing to note is that one-hot and priority are one and the same unless parallel_case is used.

@nmigen-issue-migration
Copy link
Author

@nmigen-issue-migration nmigen-issue-migration commented Sep 18, 2019

Comment by whitequark
Wednesday Sep 18, 2019 at 02:21 GMT


The most idiomatic way to do this is to make the Array associative, and make sure that initializing it with a list uses consecutive indices. (The indices still all have to be integers; possibly enums?)

@nmigen-issue-migration
Copy link
Author

@nmigen-issue-migration nmigen-issue-migration commented Oct 12, 2019

Comment by whitequark
Saturday Oct 12, 2019 at 23:29 GMT


This is a self-contained feature that doesn't have backwards compatibility concerns, so it doesn't have to be in 0.1.

@whitequark
Copy link
Member

@whitequark whitequark commented May 20, 2020

I've never seen anyone express any interest in this feature, and it's not trivial to implement because of the highly special treatment of ArrayProxy today. Because of that I'm closing the issue.

To implement this, Array should be rewritten so that ArrayProxy is a plain UserValue (perhaps we should call those CustomValue or something instead), and then it will be quite easy to expand its semantics, since it will no longer involve nMigen internals.

@whitequark
Copy link
Member

@whitequark whitequark commented Aug 17, 2020

This has been requested on the Aug 3rd meeting: https://freenode.irclog.whitequark.org/nmigen/2020-08-03#1596478574-1596478045; reopening since the reason for closing was that "seemingly no one wants this".

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