czip¶
Zips two or more Queue -s together
-
czip(*din)¶ Example shows how to form a
Queueof points from the twoQueue-s, one withxcoordinates[10, 11, 12], and the other withycoordinates[20, 21, 22].x = drv(t=Queue[Uint[5]], seq=[[10, 11, 12]]) y = drv(t=Queue[Uint[5]], seq=[[20, 21, 22]]) czip(x, y) | check(ref=[[(10, 20), (11, 21), (12, 22)]])
Next example demonstrates how
czip()waits for its inputs. The producer of thexcoordinate outputs the data only once every three cycles. Checkout howczip.din1is acknowledged only whenczip.din0also becomes available:x = drv(t=Queue[Uint[5]], seq=[[10, 11, 12]]) | delay(2) y = drv(t=Queue[Uint[5]], seq=[[20, 21, 22]]) czip(x, y) | check(ref=[[(10, 20), (11, 21), (12, 22)]])