Queues: change in .expect
interface
#2170
Labels
C: calyx-py
Items that have to do with the builder library
C: Queues
One of the queue-style frontends
good first issue
Good issue to start contributing on Calyx
This is a bookmark for a change that we'd like to make across all our queues. I'm parking it here because two big changes to the queues, #2067 and #1810, are in flight and I don't want to create an unnecessarily large diff.
Right now
queue_call.py
starts up two counters,i
andj
, and then:commands[i]
andvalues[i]
to the queue it is driving. Incrementsi
.pop
orpeek
and the queue executed it successfully), it writes the answer to theans_mem
memory like so:ans_mem[j++] = answer
.This has a couple problems:
i
andj
are out of sync means that it's hard to debug the behavior of a queue by looking over theexpect
files.The new proposal is that
queue_call.py
should start up one counteri
, and:commands[i]
andvalues[i]
to the queue it is driving.pop
orpeek
and the queue executed it successfully), write the answer to theanswers
memory just as before:ans_mem[i] = answer
. If the queue returns an error, indicate this in the answer memory by writing some special value inans_mem[i]
. Similarly, put some special value intoans_mem[i]
in case the command was apush
and no output was expected.i
.The text was updated successfully, but these errors were encountered: