Skip to content

roundrobinCollect Parallel is not a round-robin arbiter, but a priority arbiter. #129

@christiaanb

Description

@christiaanb

Looking at:

roundrobinCollect Parallel =
Circuit (B.first C.unbundle . C.unbundle . fmap go . C.bundle . B.first C.bundle)
where
go (dats0, ack) = (acks, dat1)
where
nacks = C.repeat (Ack False)
acks = Maybe.fromMaybe nacks ((\i -> C.replace i ack nacks) <$> iM)
dat1 = Maybe.fromMaybe NoData dat0
(iM, dat0) = Data.List.NonEmpty.unzip dats1
dats1 = C.fold @(n C.- 1) (<|>) (C.zipWith goDat C.indicesI dats0)
goDat i dat
| Maybe.isJust (dataToMaybe dat) = Just (i, dat)
| otherwise = Nothing

it doesn't actually have the roundrobin properties that I would expect from an roundrobin arbiter: that regardless of the conditions, all inputs will get a chance to propagate. Instead, it's a priority arbiter which, from left-to-right, gives right the highest priority. I think the functions should be renamed to arbiter and highlight how the different scheduling "collect" strategies affect the arbitration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions