Skip to content

Commit

Permalink
Use rJoinDecendingUrgency instead of <+ to avoid blocking simultaneou…
Browse files Browse the repository at this point in the history
…s tx/rx
  • Loading branch information
krame505 committed Jan 31, 2024
1 parent d6d791b commit 9be9d98
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Libraries/GenC/GenCMsg/GenCMsg.bs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ instance (FIFOs fifos rxBytes rxCount txBytes txCount,

let handleCreditsOnly =
rules
"handle_rx_credits_only": when any (\ cr -> cr.isGreaterThan 0) rxCredits ==> enq 0 List.nil
"handle_tx_credits_only": when rxTagEq 0 ==> deq
addRules $ rs <+ handleCreditsOnly
"handle_tx_credits_only": when any (\ cr -> cr.isGreaterThan 0) rxCredits ==> enq 0 List.nil
"handle_rx_credits_only": when rxTagEq 0 ==> deq
addRules $ rs `rJoinDescendingUrgency` handleCreditsOnly

interface
fifos = fifos
Expand Down Expand Up @@ -198,7 +198,7 @@ mkCounter init = module

rules
"update": when True ==> value := value + inc - dec

interface
value = value
inc = inc._write
Expand Down Expand Up @@ -292,7 +292,7 @@ instance (FIFOs' a brx1 nrx1 btx1 ntx1, FIFOs' b brx2 nrx2 btx2 ntx2,
(fifos2, rs2) <- mkFIFOs'
(takeTail rxCredits) rxTagEq rxBody deq
(takeTail txCredits) (\ txTag txBody -> enq txTag txBody)
return ((fifos1, fifos2), rs1 <+ rs2)
return ((fifos1, fifos2), rs1 `rJoinDescendingUrgency` rs2)

genCMsgTypeHeaderDcls' _ = liftM2 strConcat (genCMsgTypeHeaderDcls' (_ :: a)) (genCMsgTypeHeaderDcls' (_ :: b))
genCMsgTypeImplDcls' _ = liftM2 strConcat (genCMsgTypeImplDcls' (_ :: a)) (genCMsgTypeImplDcls' (_ :: b))
Expand Down

0 comments on commit 9be9d98

Please sign in to comment.