ucb-bar / chisel-tutorial

chisel tutorial exercises and answers
Other
695 stars 197 forks source link

How to use Seq as Seq(0.U, 1.U, 2.U)(Cat(x(1),x(6,5))) in chisel? #153

Closed 245950258 closed 4 years ago

245950258 commented 4 years ago
I am learning chisel and rocket-chip.
Rocket-chip has a code using Seq and Cat as `val funct = Seq(0.U, 4.U, 6.U, 7.U, 0.U, 0.U, 2.U, 3.U)(Cat(x(12), x(6,5)))`.
When I try to write code like Seq(0.U, 1.U, ...)(x(2,1)), I met the following grammar error:

[error] found : chisel3.UInt [error] (which expands to) chisel3.core.UInt [error] required: Int

Is there any way to compile successfully?