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

Access bits of a Logic by Logic index #153

Closed
mkorbel1 opened this issue Aug 19, 2022 · 2 comments · Fixed by #171
Closed

Access bits of a Logic by Logic index #153

mkorbel1 opened this issue Aug 19, 2022 · 2 comments · Fixed by #171
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mkorbel1
Copy link
Contributor

Motivation

Sometimes it's desirable to access a bit of a Logic signal by another Logic. This is achievable with >> n and & Const(1), but it would be nice to just use [n] directly to generate that code for ease of use and readability.

Desired solution

Modify the overloaded operator[] on Logic so that it can accept either an int or another Logic, and appropriately generates hardware if necessary (if it's a Logic).

@mkorbel1 mkorbel1 added enhancement New feature or request good first issue Good for newcomers labels Aug 19, 2022
@akshay-wankhede
Copy link
Contributor

Hi, can I take this one next?

@mkorbel1
Copy link
Contributor Author

It might be a good idea to make a new custom module so that the generated output SystemVerilog has [] instead of << &1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants