-
Notifications
You must be signed in to change notification settings - Fork 52
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
fifo
: better testing
#1762
fifo
: better testing
#1762
Conversation
@calebmkim requesting a review from you since we talked about this recently. I think this is actually a teeny bit more sophisticated that the systolic stuff, since I do have the ability to generate new "problems" for myself, and the oracle reads the new problem every time. This is as opposed to "knowing" the problem beforehand. I pipe the oracle's output to an expect file and then leave the testing of the answer to the usual |
…into fifo-better-testing
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.
I think this all lgtm!
Doesn't have to be in this PR, but I can imagine a future version of this that allows you to set MAX_CMDS
and ANS_MEM_LEN
user command line inputs to the python program.
This PR adds a slightly more sophisticated testing setup for the FIFO queues.
Before
fifo.data
.fifo.expect
.fifo.py
: the eDSL implementation.runt
, we'd automatically:fifo.py
to get Calyx code.fifo.data
.fifo.expect
.After
fifo_data_gen.py
that prints pseudorandom information to populate three lists:commands
,values
,ans_mem
. These contain the formatting info that Calyx expects, and can be piped into a filefifo.data
.fifo_oracle.py
that:.data
-like thing from stdin (the .data thing will havecommands
,values
, andans_mem
, but we care only about the first two).ans
list.ans
list along with thecommands
andvalues
to screen, in an.expect
-like format.fifo.expect
.fifo.py
is unchanged..data
file and a.expect
file that was created by a clever oracle and not a tired grad student.What this PR is not doing
Just to be clear, this PR is not running the Python scripts every time in any clever way. The data-generating Python script is seeded with a constant, and after some brute-force searching I've found a constant (
5
) that generates data that runs the queue through its paces a little. I've run the two new scripts, piped their results intofifo.data
andfifo.expect
, and committed those new files. The commands I ran were:and
If you want to try it with new data, you'll need to change the random seed in
fifo_data_gen.py
, run these two scripts to clobber the.data
and.expect
files, and then runrunt
as usual.