Skip to content

[Primitives] Add default=None for list_lookup#1154

Open
leonardt wants to merge 2 commits into
masterfrom
list-lookup-default
Open

[Primitives] Add default=None for list_lookup#1154
leonardt wants to merge 2 commits into
masterfrom
list-lookup-default

Conversation

@leonardt
Copy link
Copy Markdown
Collaborator

Rather than use an explicit default value as the standard pattern, it makes more sense to use the final element of the list since we're buildling a mux tree anyways. The existing explicit "default" value pattern might still be useful to emulate a certain "else" pattern that's different than the last element.

In adding this, I noticed the mux tree was being built forwards, which made the generated code a bit convoluted for this default case, so I reversed the tree instead to make it look more natural in the generated code.

Rather than use an explicit default value as the standard pattern, it
makes more sense to use the final element of the list since we're
buildling a mux tree anyways.  The existing explicit "default" value
pattern might still be useful to emulate a certain "else" pattern that's
different than the last element.

In adding this, I noticed the mux tree was being built forwards, which
made the generated code a bit convoluted for this default case, so I
reversed the tree instead to make it look more natural in the generated
code.
@leonardt leonardt requested a review from rsetaluri October 12, 2022 01:52
@rsetaluri rsetaluri changed the title [Primitives] Adds default=None for list_lookup [Primitives] Add default=None for list_lookup Oct 12, 2022
Comment thread magma/primitives/mux.py
Comment thread magma/primitives/mux.py
@leonardt leonardt requested a review from rsetaluri October 14, 2022 16:24
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 14, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.10%. Comparing base (0807db6) to head (7320ea4).
⚠️ Report is 246 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1154      +/-   ##
==========================================
+ Coverage   85.07%   85.10%   +0.03%     
==========================================
  Files         157      157              
  Lines       16532    16567      +35     
==========================================
+ Hits        14065    14100      +35     
  Misses       2467     2467              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants