Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PIFO trees: better testing #1765

Merged
merged 23 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3c3079e
Oracle for FIFOs
anshumanmohan Nov 7, 2023
ab0408d
Good pseudorandom seed
anshumanmohan Nov 7, 2023
0b1e603
Move two files out of runt's way
anshumanmohan Nov 7, 2023
7a8bbb9
Use new, randomly generated data and expect files for actual testing
anshumanmohan Nov 7, 2023
0cab2c3
Merge branch 'master' into fifo-better-testing
anshumanmohan Nov 7, 2023
d7eca6e
Nits
anshumanmohan Nov 7, 2023
fc6982e
Merge branch 'fifo-better-testing' of https://github.com/cucapra/caly…
anshumanmohan Nov 7, 2023
70a69ee
Generalize fifo_data_gen to all kinds of queues
anshumanmohan Nov 7, 2023
61b43e5
Automatic generation of PIFO data and expect
anshumanmohan Nov 8, 2023
481f818
OO style for FIFO
anshumanmohan Nov 8, 2023
ca732ec
PIFOs in OO style
anshumanmohan Nov 8, 2023
3131c42
Merge branch 'master' into pifo-better-testing
anshumanmohan Nov 8, 2023
1a03b1e
Generalize PIFO to take any two queues
anshumanmohan Nov 8, 2023
5f9ca75
Lift the different queues into their own file
anshumanmohan Nov 8, 2023
d02103c
Lift the runner logic too
anshumanmohan Nov 8, 2023
0b9c600
Tidying
anshumanmohan Nov 8, 2023
8c32e72
Remove stray file
anshumanmohan Nov 8, 2023
84cf9c5
Tidying
anshumanmohan Nov 8, 2023
e388fdb
New data for PIFO tree
anshumanmohan Nov 8, 2023
d29de94
PIFO tree oracle!
anshumanmohan Nov 8, 2023
b1fb063
Merge branch 'master' into pifo-better-testing
anshumanmohan Nov 16, 2023
44ba7eb
Merge branch 'pifo-better-testing' into pifotree-better-testing
anshumanmohan Nov 16, 2023
7df6a0f
Merge branch 'master' into pifotree-better-testing
anshumanmohan Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions calyx-py/calyx/pifotree_oracle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import queues


if __name__ == "__main__":
commands, values = queues.parse_json()

# Our PIFO is a little complicated: it is a tree of queues.
# The root has two children, which are PIFOs.
# - PIFO_red is the left child.
# + PIFO_red itself has two children, which are FIFOs.
# * FIFO_purple is the left child.
# * FIFO_tangerine is the right child.
# * The boundary for this is 100.
# - FIFO_blue is the right child.
# - The boundary for this is 200.

pifo = queues.Pifo(
queues.Pifo(queues.Fifo([]), queues.Fifo([]), 100), queues.Fifo([]), 200
)

ans = queues.operate_queue(commands, values, pifo)
queues.dump_json(commands, values, ans)
40 changes: 20 additions & 20 deletions calyx-py/test/correctness/pifo_tree.data
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"commands": {
"data": [
2,
1,
2,
1,
2,
2,
2,
2,
0,
1,
0,
0,
0,
0,
0,
2,
0,
0,
0
Expand All @@ -25,21 +25,21 @@
},
"values": {
"data": [
11,
12,
201,
202,
203,
101,
0,
0,
0,
0,
0,
0,
0,
0,
0
190,
240,
126,
194,
278,
52,
293,
127,
6,
374,
110,
208,
143,
93,
392
],
"format": {
"is_signed": false,
Expand All @@ -66,4 +66,4 @@
"width": 32
}
}
}
}
54 changes: 27 additions & 27 deletions calyx-py/test/correctness/pifo_tree.expect
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
{
"ans_mem": [
11,
201,
101,
202,
12,
203,
0,
0,
190,
190,
52,
278,
278,
190,
293,
126,
0,
0
],
"commands": [
2,
1,
2,
1,
2,
2,
2,
2,
0,
1,
0,
0,
0,
0,
0,
2,
0,
0,
0
],
"values": [
11,
12,
201,
202,
203,
101,
0,
0,
0,
0,
0,
0,
0,
0,
0
190,
240,
126,
194,
278,
52,
293,
127,
6,
374,
110,
208,
143,
93,
392
]
}