-
Notifications
You must be signed in to change notification settings - Fork 212
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
Make uart_rx a verification component #89
Conversation
Awesome work! 👍
Tu be hones, I am a little bit lost here 😅 |
@stnolting There is an easy fix and a harder fix. I'm noticing that the testbench is expecting 37 tests when it should be 44. That's the easy fix. The harder fix is that the testbench is expecting the test result on UART1 after those initial NUL characters. Now the result is simply printed so the testbench keeps waiting until it times out. |
The problem is that the actual number of tests depends on the implemented hardware modules. For the testbench, all optional modules should be implemented. However, this number will change when new modules are introduced. But adapting a single line in the testbench should not be too hard 😉
Ah ok, I think I now understand what you mean 😄 Printing the "whole" test result via the pysical UART takes quite some time in simulation. How about modifying the |
That I can improve in the next PR. The expected number of tests can be an argument to the run script just like
Now it only outputs Nevertheless, just printing the number of passing test would be even faster. However, I think the total number of tests should be output as well. Otherwise it would be easy to add a test that doesn't work and also forgetting to increase that magic number in the testbench. The result would be a passing test. |
That would be great 👍
So how about this:
|
@stnolting That sounds reasonable. The important thing is that something is printed to the physical UART. That something should be significant enough to give some confidence that everything that needed to happen within the DUT, that we do not see, actually did happen. That's why I didn't like just printing the zero return code because a zero can easily be printed by mistake. |
Great! So I will implement that as soon as possible - but before I have to fix a small bug I have found in the simulation output mode. |
Correct! |
I have changed the test program in |
Setup message passing communication to uart_rx. Message passing is asynchronous which means that the two uart_rx instances can be commanded to receive the expected data concurrently
Create a cleaner interface to uart_rx and prepare for uart_rx to handle several different types of messages.
Use standard message passing interfaces for handling synchronization with uart_rx and determine when to terminate the testbench.
@stnolting Great! I rebased the PR and now all tests are green. |
This PR makes the uart_rx a VUnit verification component. It also means that there is a mechanism for making sure that all expected data has been seen before the testbench is allowed to exit. This means that the current limitation of just checking data that is received is removed and the bug causing data not to be emitted on UART1 is exposed.
@stnolting I would need help finding that bug but once that has been solved it would be harder to get it re-introduced now that the testbench is less forgiving.