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

Enable Cat of Zero Element Vec #1623

Merged
merged 2 commits into from
Oct 19, 2020
Merged

Enable Cat of Zero Element Vec #1623

merged 2 commits into from
Oct 19, 2020

Conversation

seldridge
Copy link
Member

Prevent an exception thrown if you apply Cat to a zero-element Vec. This will now return 0.U if you do that.

Fixes #1622

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • bug fix

API Impact

None. This enables new behavior which was previously an error.

Backend Code Generation Impact

No change to existing Verilog.

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference.

Release Notes

  • Cat of a zero-element Vec now returns 0.U

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (3.2.x, 3.3.x, 3.4.0, 3.5.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>
@seldridge seldridge requested a review from a team as a code owner October 15, 2020 15:14
@seldridge seldridge requested review from albertchen-sifive and removed request for a team October 15, 2020 15:14
@seldridge seldridge changed the title Enable Cat of Zero Element Verc Enable Cat of Zero Element Vec Oct 15, 2020

object CatSpec {

class JackIsATypeSystemGod extends MultiIOModule {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😑

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew the type system god. The type system god was a friend of mine. Senator, you're no type system god.

@azidar azidar added this to the 3.2.x milestone Oct 19, 2020
@azidar azidar added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Oct 19, 2020
@mergify mergify bot merged commit ac641fb into master Oct 19, 2020
mergify bot pushed a commit that referenced this pull request Oct 19, 2020
* Return 0.U for asUInt of a zero-element Seq

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>

* Test elaboration of Cat on zero-element Seq

Signed-off-by: Schuyler Eldridge <[email protected]>
(cherry picked from commit ac641fb)
mergify bot pushed a commit that referenced this pull request Oct 19, 2020
* Return 0.U for asUInt of a zero-element Seq

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>

* Test elaboration of Cat on zero-element Seq

Signed-off-by: Schuyler Eldridge <[email protected]>
(cherry picked from commit ac641fb)
mergify bot pushed a commit that referenced this pull request Oct 19, 2020
* Return 0.U for asUInt of a zero-element Seq

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>

* Test elaboration of Cat on zero-element Seq

Signed-off-by: Schuyler Eldridge <[email protected]>
(cherry picked from commit ac641fb)
@mergify mergify bot added the Backported This PR has been backported label Oct 19, 2020
mergify bot added a commit that referenced this pull request Oct 19, 2020
* Return 0.U for asUInt of a zero-element Seq

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>

* Test elaboration of Cat on zero-element Seq

Signed-off-by: Schuyler Eldridge <[email protected]>
(cherry picked from commit ac641fb)

Co-authored-by: Schuyler Eldridge <[email protected]>
mergify bot added a commit that referenced this pull request Oct 19, 2020
* Return 0.U for asUInt of a zero-element Seq

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>

* Test elaboration of Cat on zero-element Seq

Signed-off-by: Schuyler Eldridge <[email protected]>
(cherry picked from commit ac641fb)

Co-authored-by: Schuyler Eldridge <[email protected]>
seldridge added a commit that referenced this pull request Nov 13, 2020
* Return 0.U for asUInt of a zero-element Seq

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>

* Test elaboration of Cat on zero-element Seq

Signed-off-by: Schuyler Eldridge <[email protected]>
(cherry picked from commit ac641fb)
mergify bot added a commit that referenced this pull request Nov 13, 2020
* Return 0.U for asUInt of a zero-element Seq

Add a condition to SeqUtils.asUInt to have it return an unspecified
width 0.U when applied to an empty sequence. This enables the ability
to do a Cat of a zero-element sequence.

Signed-off-by: Schuyler Eldridge <[email protected]>

* Test elaboration of Cat on zero-element Seq

Signed-off-by: Schuyler Eldridge <[email protected]>
(cherry picked from commit ac641fb)

Co-authored-by: Schuyler Eldridge <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@jackkoenig jackkoenig deleted the issue-1622 branch June 9, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cat of 0 element Vec throws exception on empty.tail
5 participants