-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 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]>
- Loading branch information
1 parent
b6b76eb
commit f59f391
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package chiselTests.util | ||
|
||
import chisel3._ | ||
import chisel3.stage.ChiselStage | ||
import chisel3.util.Cat | ||
|
||
import chiselTests.ChiselFlatSpec | ||
|
||
object CatSpec { | ||
|
||
class JackIsATypeSystemGod extends MultiIOModule { | ||
val in = IO(Input (Vec(0, UInt(8.W)))) | ||
val out = IO(Output(UInt(8.W))) | ||
|
||
out := Cat(in) | ||
} | ||
|
||
} | ||
|
||
class CatSpec extends ChiselFlatSpec { | ||
|
||
import CatSpec._ | ||
|
||
behavior of "util.Cat" | ||
|
||
it should "not fail to elaborate a zero-element Vec" in { | ||
|
||
ChiselStage.elaborate(new JackIsATypeSystemGod) | ||
|
||
} | ||
|
||
} |