-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Comment re: usage * Basic script for queue gen * Maxlen and queue size no longer in queue_util * Slightly simplify datagen for ans mem * Rename flag * Simplify FIFO init * queue_len not a const * Stray file * queue len as cli * Queue size as CLI * Neaten * Numver of cmds as CLI * Max cmds as CLI * num cmds as CLI for eDSL programs too * Comment
- Loading branch information
1 parent
76cc300
commit 16e1835
Showing
13 changed files
with
116 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
# For usage, see gen_queue_data_expect.sh | ||
|
||
import sys | ||
import calyx.queues as queues | ||
from calyx import queue_util | ||
|
||
if __name__ == "__main__": | ||
max_cmds, len = int(sys.argv[1]), int(sys.argv[2]) | ||
commands, values = queue_util.parse_json() | ||
fifo = queues.Fifo([], False) | ||
ans = queues.operate_queue(commands, values, fifo) | ||
fifo = queues.Fifo(len) | ||
ans = queues.operate_queue(commands, values, fifo, max_cmds) | ||
queue_util.dump_json(commands, values, ans) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/bash | ||
|
||
# For SDN, we use piezo mode when making the data file and | ||
# use pifotree_oracle to generate the expected output | ||
python3 queue_data_gen.py 20000 --no-err 16 > ../test/correctness/queues/sdn.data | ||
cat ../test/correctness/queues/sdn.data | python3 pifo_tree_oracle.py 20000 16 > ../test/correctness/queues/sdn.expect | ||
|
||
# For the others, we drop piezo mode for data gen, and we use the appropriate | ||
# oracle, which is one of the following: | ||
# - fifo_oracle.py | ||
# - pifo_oracle.py | ||
# - pifo_tree_oracle.py | ||
|
||
for queue_kind in fifo pifo pifo_tree; do | ||
python3 queue_data_gen.py 20000 --no-err 16 > ../test/correctness/queues/$queue_kind.data | ||
cat ../test/correctness/queues/$queue_kind.data | python3 ${queue_kind}_oracle.py 20000 16 > ../test/correctness/queues/$queue_kind.expect | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# For usage, see gen_queue_data_expect.sh | ||
|
||
import sys | ||
import calyx.queues as queues | ||
from calyx import queue_util | ||
|
||
if __name__ == "__main__": | ||
max_cmds, len = int(sys.argv[1]), int(sys.argv[2]) | ||
commands, values = queue_util.parse_json() | ||
|
||
# Our PIFO is simple: it just orchestrates two FIFOs. The boundary is 200. | ||
pifo = queues.Pifo(queues.Fifo([]), queues.Fifo([]), 200, False) | ||
pifo = queues.Pifo(queues.Fifo(len), queues.Fifo(len), 200, len) | ||
|
||
ans = queues.operate_queue(commands, values, pifo) | ||
ans = queues.operate_queue(commands, values, pifo, max_cmds) | ||
queue_util.dump_json(commands, values, ans) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.