Skip to content

Commit

Permalink
Queues: scheduling policies (#2164)
Browse files Browse the repository at this point in the history
* A few scheduling transactions

- WARNING: the pifo is broken; it doesn't pass the big random test

* Make heaps bigger!

- both pifo and fifo tests pass with large heaps

* Queues all working!

* More docs, fewer magic numbers, simpler control

- slightly refactor control logic in binheap.py
- make rank and value widths arguments to `insert_binheap`
- add docs to stable_binheap, binheap, and fifo. TBD: pifo

* Add pifo docs

* full -> is_full

* Switch to non-piezo tests

* No more magic numbers in gen_queue_data

* Fix error handling logic in binheap and pifo

* A little tidying

* Move flow_out inference one if-check deeper

---------

Co-authored-by: Anshuman Mohan <[email protected]>
  • Loading branch information
polybeandip and anshumanmohan authored Jun 20, 2024
1 parent 4b51009 commit 6c2d82c
Show file tree
Hide file tree
Showing 14 changed files with 240,688 additions and 87 deletions.
13 changes: 9 additions & 4 deletions calyx-py/calyx/gen_queue_data_expect.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/bash

num_cmds=20000
queue_size=16

# 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 --keepgoing > ../test/correctness/queues/sdn.expect
python3 queue_data_gen.py $num_cmds --no-err $queue_size > ../test/correctness/queues/sdn.data
cat ../test/correctness/queues/sdn.data | python3 pifo_tree_oracle.py $num_cmds $queue_size --keepgoing > ../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:
Expand All @@ -12,6 +15,8 @@ cat ../test/correctness/queues/sdn.data | python3 pifo_tree_oracle.py 20000 16 -
# - pifo_tree_oracle.py

for queue_kind in fifo pifo pifo_tree; do
python3 queue_data_gen.py 20000 > ../test/correctness/queues/$queue_kind.data
cat ../test/correctness/queues/$queue_kind.data | python3 ${queue_kind}_oracle.py 20000 16 --keepgoing > ../test/correctness/queues/$queue_kind.expect
python3 queue_data_gen.py $num_cmds > ../test/correctness/queues/$queue_kind.data
[[ "$queue_kind" != "pifo_tree" ]] && cp ../test/correctness/queues/$queue_kind.data ../test/correctness/queues/binheap/$queue_kind.data
cat ../test/correctness/queues/$queue_kind.data | python3 ${queue_kind}_oracle.py $num_cmds $queue_size --keepgoing > ../test/correctness/queues/$queue_kind.expect
[[ "$queue_kind" != "pifo_tree" ]] && cp ../test/correctness/queues/$queue_kind.expect ../test/correctness/queues/binheap/$queue_kind.expect
done
Loading

0 comments on commit 6c2d82c

Please sign in to comment.