freechipsproject / chisel-bootcamp

Generator Bootcamp Material: Learn Chisel the Right Way
Apache License 2.0
976 stars 277 forks source link

doubt about 2.6 Chiseltest #166

Closed cnjsdfcy closed 2 years ago

cnjsdfcy commented 2 years ago

Hi,

In the Fork and Join in ChiselTest section, the testVector's size (300) is larger than Queue's depth (200), which would NOT cause a error. But in upper EnqueueSeq and DequeueSeq section, this setting will run error. How does this happen? Besides run concurrently with the help of fork/join, what else does fork/join bring in?

Thanks, Jason

chick commented 2 years ago

I am not certain I understand your question

In the Enq/Deq section the enqueueSeq and dequeueSeq are run sequentially not in parallel, so when the data set size is greater than the queue size the the enqueueSeq cannot complete because the dequeueSeq has not been started yet. Because enqueueSeq cannot complete, the test eventually times out

In the Fork and join forks allow the enqueueSeq and deqeueSeq to run in paralllel so the dequeueSeq can clear the module so more enqueues can happen, and the test can complete

cnjsdfcy commented 2 years ago

Okay, the key is parallelization between enqueue and dequeue, thx~