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

Incomplete Testbench #23

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

dpcarry
Copy link

@dpcarry dpcarry commented Feb 21, 2024

No description provided.

@dpcarry dpcarry closed this Feb 21, 2024

TEST_CASE("SimpleDecoder, Basic Functionality") {
VSimpleDecoder_tl* decoder = new VSimpleDecoder_tl;
Verilated::traceEverOn(true);
Copy link
Member

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;
Copy link
Member

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?

Comment on lines +8 to +18
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();
Copy link
Member

@rishyak rishyak Feb 21, 2024

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)

Copy link
Member

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.

Comment on lines +25 to +29
decoder->eval();
decoder->clk = 0; //falling edge
decoder->eval();
decoder->clk = 1; //rising edge
decoder->eval();
Copy link
Member

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
Copy link
Member

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?

Copy link
Member

@rishyak rishyak left a 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.

Comment on lines +8 to +18
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();
Copy link
Member

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);
Copy link
Member

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 rishyak assigned rishyak and dpcarry and unassigned dpcarry Feb 21, 2024
@rishyak rishyak reopened this Feb 21, 2024
Copy link
Member

@rishyak rishyak left a 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.

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