Skip to content
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

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Refactor simd test #5

merged 2 commits into from
Jan 22, 2024

Conversation

xiaoling-yi
Copy link
Contributor

@xiaoling-yi xiaoling-yi commented Jan 22, 2024

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 check
  • reverse the Cat input because Cat put the lowest index to highest bits

Copy link

@rgantonio rgantonio left a 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())

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

// give input data big bus to dut
def giveInputData[T <: SIMD](dut: T, input: BigInt) = {
// giving input data
dut.clock.step()

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.

Copy link
Contributor Author

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)?

No!

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.

Ok!

dut.clock.step()
}
// set test number
val testNum = 1

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed!

@xiaoling-yi xiaoling-yi merged commit 382770a into main Jan 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants