我想在Chisel3中反转输入信号。例如,如果输入是12345678,我希望输出是87654321。有谁能帮我一下吗?
代码:
import chisel3._
import chisel3.util._
import chisel3.iotesters.{ChiselFlatSpec, Driver, PeekPokeTester}
import chisel3.util.Reverse
class Length extends Module {
val in = Input(UInt(64.W))
val out = Output(UInt(8.W))
out := Reverse(in.x)}
发布于 2018-07-05 20:28:32
在评论中讨论的解决方案:
import chisel3._
import chisel3.util.Reverse
class Length extends Module {
val io = IO(
new Bundle {
val in = Input(UInt(64.W))
val out = Output(UInt(8.W))
}
)
io.out := Reverse(io.in)
}https://stackoverflow.com/questions/51188898
复制相似问题