-
Notifications
You must be signed in to change notification settings - Fork 6
Incomplete Testbench #23
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| TEST_CASE("SimpleDecoder, Basic Functionality") { | ||
| VSimpleDecoder_tl* decoder = new VSimpleDecoder_tl; | ||
| Verilated::traceEverOn(true); |
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.
Unnecessary, if you want waveforms, add TRACE_FST in nyu_target_verilate()
| TEST_CASE("SimpleDecoder, Dummy Test") {} | ||
|
|
||
| TEST_CASE("SimpleDecoder, Basic Functionality") { | ||
| VSimpleDecoder_tl* decoder = new VSimpleDecoder_tl; |
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.
Why is this a heap allocation?
| decoder->clk = 0; | ||
| decoder->nReset = 1; | ||
| decoder->eval(); | ||
| decoder->clk = 1; | ||
| decoder->eval(); | ||
| decoder->clk = 0; | ||
| decoder->eval(); | ||
| decoder->nReset = 0; | ||
| decoder->eval(); | ||
| decoder->clk = 1; | ||
| decoder->eval(); |
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.
nyu-util offers basic utilities like reset and tick. Should be replaced with nyu::reset(decoder)
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.
You also miss the test for 0 where the selector will return 0.
| decoder->eval(); | ||
| decoder->clk = 0; //falling edge | ||
| decoder->eval(); | ||
| decoder->clk = 1; //rising edge | ||
| decoder->eval(); |
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.
replace with nyu::tick(decoder)
| decoder->clk = 1; //rising edge | ||
| decoder->eval(); | ||
|
|
||
| CAPTURE(address, expected_sel); //capture the values |
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.
Why are you CAPTUREing the values?
rishyak
left a comment
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.
@dpcarry code revied. Please get back to me with questions.
| decoder->clk = 0; | ||
| decoder->nReset = 1; | ||
| decoder->eval(); | ||
| decoder->clk = 1; | ||
| decoder->eval(); | ||
| decoder->clk = 0; | ||
| decoder->eval(); | ||
| decoder->nReset = 0; | ||
| decoder->eval(); | ||
| decoder->clk = 1; | ||
| decoder->eval(); |
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.
You also miss the test for 0 where the selector will return 0.
|
|
||
| //test for addresses 1 to 20 | ||
| for (int address = 1; address <= 3; ++address) { | ||
| int expected_sel = 1 << (address - 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.
Why are you subtracting?
rishyak
left a comment
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.
Will be merged when it is cleaned up.
No description provided.