Skip to content

Commit

Permalink
Fix locking of switch demo PE inputs
Browse files Browse the repository at this point in the history
Fix edge case where switch demo inputs are not locked when immediately
starting read or write operations.
  • Loading branch information
hiddemoll committed Feb 7, 2025
1 parent 8001616 commit 58ac6a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bittide/src/Bittide/SwitchDemoProcessingElement.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ switchDemoPe ::
switchDemoPe SNat localCounter linkIn maybeDna readStart readCycles writeStart writeCycles =
(linkOut, buffer)
where
readStartLocked = regEn maxBound (peState .==. pure Idle) readStart
readCyclesLocked = regEn maxBound (peState .==. pure Idle) ((* 3) . zeroExtend <$> readCycles)
writeStartLocked = regEn maxBound (peState .==. pure Idle) writeStart
writeCyclesLocked = regEn maxBound (peState .==. pure Idle) ((* 3) . zeroExtend <$> writeCycles)
readStartLocked = regEn maxBound (prevPeState .==. pure Idle) readStart
readCyclesLocked = regEn maxBound (prevPeState .==. pure Idle) ((* 3) . zeroExtend <$> readCycles)
writeStartLocked = regEn maxBound (prevPeState .==. pure Idle) writeStart
writeCyclesLocked = regEn maxBound (prevPeState .==. pure Idle) ((* 3) . zeroExtend <$> writeCycles)

localData :: Signal dom (Vec 3 (BitVector 64))
localData = bundle (unbundle dnaVec :< (pack <$> localCounter))
Expand Down

0 comments on commit 58ac6a6

Please sign in to comment.