-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR makes progress towards #1810. It implements the python oracle for PIFOs generalized to n flows, now known as Round Robin queues. Just as with the PIFO, if a flow falls silent, the remaining flows will take their turns. That flow effectively skips its turn. To re-generate the test files with 20000 commands and a max length of 16, type in the command line after navigating to the directory calyx/calyx-py/calyx ``` ./gen_queue_data_expect.sh ``` Additionally, this PR also implements the Calyx version of Round Robin queues in rr_queue.py. This was originally supposed to be its own PR, but I thought it might be more complicated if I branched off a branch. To run these tests, type in the command line ``` runt -i "rr_queue" ``` --------- Co-authored-by: Cassandra Nicole Sziklai <[email protected]> Co-authored-by: Anshuman Mohan <[email protected]> Co-authored-by: Anshuman Mohan <[email protected]>
- Loading branch information
1 parent
ecf05cc
commit ba0d5f0
Showing
24 changed files
with
720,651 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# For usage, see gen_queue_data_expect.sh | ||
import sys | ||
import calyx.queues as queues | ||
from calyx import queue_util | ||
|
||
if __name__ == "__main__": | ||
num_cmds, len, numflows = int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]) | ||
keepgoing = "--keepgoing" in sys.argv | ||
commands, values, _ = queue_util.parse_json() | ||
|
||
# In reality, we would allow the user to specify the boundaries via | ||
# command line arguments or a configuration file. For now, we hardcode them | ||
# as a function of the number of flows. | ||
if numflows == 2: | ||
boundaries = [200, 400] | ||
elif numflows == 3: | ||
boundaries = [133, 266, 400] | ||
elif numflows == 4: | ||
boundaries = [100, 200, 300, 400] | ||
elif numflows == 5: | ||
boundaries = [80, 160, 240, 320, 400] | ||
elif numflows == 6: | ||
boundaries = [66, 100, 200, 220, 300, 400] | ||
elif numflows == 7: | ||
boundaries = [50, 100, 150, 200, 250, 300, 400] | ||
else: | ||
raise ValueError("Unsupported number of flows") | ||
|
||
# Our Round Robin Queue orchestrates n FIFOs, in this case provided as | ||
# a command line argument. It orchestrates the FIFOs in a round-robin fashion. | ||
pifo = queues.RRQueue(numflows, boundaries, len) | ||
|
||
ans = queues.operate_queue(pifo, num_cmds, commands, values, keepgoing=keepgoing) | ||
|
||
queue_util.dump_json(ans, commands, values) |
Oops, something went wrong.