-
Notifications
You must be signed in to change notification settings - Fork 53
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 #2226 by updating variable names and comments to account for the fact that round robin PIFOs can make n-way trees. Additionally, it implements a PIFO tree and a more complicated tree (`complicated_tree.py`) using round robin and strict queues. This accounts for the first three checkboxes of #2226. The docs have been updated to reflect the new PIFO style in #2223. To run the relevant tests, ``` runt -i "queues" ``` (For sdn.py, I removed the stats component stuff because I thought it was mentioned that this wasn't important and so the new style PIFOs are not equipped to do stats. If it needs to be there, let me know.) --------- Co-authored-by: Anshuman Mohan <[email protected]>
- Loading branch information
1 parent
e283961
commit d7b609d
Showing
13 changed files
with
240,260 additions
and
67 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 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]) | ||
keepgoing = "--keepgoing" in sys.argv | ||
commands, values, _, _ = queue_util.parse_json() | ||
|
||
# Our complex PIFO is a tree of queues. It has the shape | ||
# rr(strict(A, B, C), rr(D, E, F), strict(G, H)). | ||
|
||
subqueues3 = [queues.Fifo(len) for _ in range(3)] | ||
# a second subqueue copy is required, we cannot pass the same subqueue across more than one function call | ||
subqueues3s = [queues.Fifo(len) for _ in range(3)] | ||
subqueues2 = [queues.Fifo(len) for _ in range(2)] | ||
|
||
pifo = queues.RRQueue( | ||
3, | ||
[133, 266, 400], | ||
[ | ||
queues.StrictPifo(3, [44, 88, 133], [0, 1, 2], subqueues3s, len), | ||
queues.RRQueue(3, [177, 221, 266], subqueues3, len), | ||
queues.StrictPifo(2, [333, 400], [0, 1], subqueues2, len), | ||
], | ||
len, | ||
) | ||
|
||
ans = queues.operate_queue(pifo, max_cmds, commands, values, keepgoing=keepgoing) | ||
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
Oops, something went wrong.