-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor simd test #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiaoling-yi sugoi desu! Can you please check also my comments first? But overall I think it's good enough!
At least we cover many cases and most likely after many runs maybe the test is already rigorous enough.
// generate random input data sequence | ||
def InputSeqGen(): Seq[Int] = { | ||
// Initialize random seed | ||
val random = new Random(System.currentTimeMillis()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL, randomization is based on time. Interesting haha
src/test/scala/simd/SIMDTest.scala
Outdated
// give input data big bus to dut | ||
def giveInputData[T <: SIMD](dut: T, input: BigInt) = { | ||
// giving input data | ||
dut.clock.step() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference between dut.clock.step()
and dut.clock.step(1)
?
I think to make it "explicit" and "idiomatic" if dut.clock.step()
is just the same as dut.clock.step(1)
maybe we put dut.clock.step(1)
as the default for a single clock pulse. Just to make it clear for everyone.
BTW "idiomatic" means it's implicit in the code what we want to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference between
dut.clock.step()
anddut.clock.step(1)
?
No!
I think to make it "explicit" and "idiomatic" if
dut.clock.step()
is just the same asdut.clock.step(1)
maybe we putdut.clock.step(1)
as the default for a single clock pulse. Just to make it clear for everyone.BTW "idiomatic" means it's implicit in the code what we want to happen.
Ok!
src/test/scala/simd/SIMDTest.scala
Outdated
dut.clock.step() | ||
} | ||
// set test number | ||
val testNum = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 only? not 100? haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed!
In this PR, we provide more comprehensive unit test for the post-processing simd, addressing this issue #4
More specifically, we add:
HasSIMDTestUtils
trait to contain the utils functions, including test data gen and result check etc.SIMDAutoTest
test class to do the test and checkCat
input becauseCat
put the lowest index to highest bits