What is wrong?
My English is a bit bad so I would appreciate it if they were simple in the answer.
=====================================================================
package examples
import chisel3._
class POr() extends Module {
val io = IO ( new Bundle {
val a = Input(UInt(1.W))
val b = Input(UInt(1.W))
val x = Output(UInt(1.W))
})
io.x := (io.a | io.b)
}
=========================================================================
package examples
import chisel3.iotesters.{PeekPokeTester, Driver, ChiselFlatSpec}
class POrTests(c: POr) extends PeekPokeTester© {
for( i <- 0 to 1) {
for( j <- 0 to 1) {
poke(c.io.a, i)
poke(c.io.b, j)
step(1)
val res = (i | j)
expect(c.io.x, res & 1)
}
}
}
class POrTester extends ChiselFlatSpec {
behavior of “POr"
backends foreach {backend =>
it should s"operou corretamente os bit gerados no $backend” in {
Driver(() => new POr, backend)(c => new POrTests©) should be (true)
}
}
}
====================================================================
Thank you for your attention!