diff options
| author | Aditya Naik | 2023-11-23 03:11:56 -0800 |
|---|---|---|
| committer | Aditya Naik | 2023-11-23 03:11:56 -0800 |
| commit | af415532cf160e63e971ceb301833b8433c18a50 (patch) | |
| tree | 1fef70139846f57298c8e24a590490a74249f7dd /src/test/scala/chiselTests/BitwiseOps.scala | |
| parent | 8200c0cdf1d471453946d5ae24bc99757b2ef02d (diff) | |
cleanup
Diffstat (limited to 'src/test/scala/chiselTests/BitwiseOps.scala')
| -rw-r--r-- | src/test/scala/chiselTests/BitwiseOps.scala | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/test/scala/chiselTests/BitwiseOps.scala b/src/test/scala/chiselTests/BitwiseOps.scala deleted file mode 100644 index 2c050bfa..00000000 --- a/src/test/scala/chiselTests/BitwiseOps.scala +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -package chiselTests - -import chisel3._ -import chisel3.testers.BasicTester - -class BitwiseOpsTester(w: Int, _a: Int, _b: Int) extends BasicTester { - val mask = (1 << w) - 1 - val a = _a.asUInt(w.W) - val b = _b.asUInt(w.W) - assert(~a === (mask & ~_a).asUInt) - assert((a & b) === (_a & _b).asUInt) - assert((a | b) === (_a | _b).asUInt) - assert((a ^ b) === (_a ^ _b).asUInt) - assert((a.orR) === (_a != 0).asBool) - assert((a.andR) === (s"%${w}s".format(BigInt(_a).toString(2)).foldLeft(true)(_ && _ == '1')).asBool) - stop() -} - -class BitwiseOpsSpec extends ChiselPropSpec { - property("All bit-wise ops should return the correct result") { - forAll(safeUIntPair) { - case (w: Int, a: Int, b: Int) => - assertTesterPasses { new BitwiseOpsTester(w, a, b) } - } - } -} |
