czip

Zips two or more Queue -s together

czip(*din)

Example shows how to form a Queue of points from the two Queue -s, one with x coordinates [10, 11, 12], and the other with y coordinates [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 the x coordinate outputs the data only once every three cycles. Checkout how czip.din1 is acknowledged only when czip.din0 also 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)]])