forked from chipsalliance/rocket-chip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request chipsalliance#2127 from chipsalliance/rational-cro…
…ssing-reset Allow a RationalCrossingSource to remain in reset longer than sink
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// See LICENSE.SiFive for license details. | ||
|
||
package freechips.rocketchip.util | ||
|
||
import chisel3._ | ||
import chisel3.util.DecoupledIO | ||
|
||
/** Blocks transactions until the cycle after reset. */ | ||
object BlockDuringReset | ||
{ | ||
def apply[T <: Data](enq: DecoupledIO[T]): DecoupledIO[T] = { | ||
val out_of_reset = RegNext(true.B, false.B) | ||
val res = Wire(enq.cloneType) | ||
res.valid := enq.valid | ||
enq.ready := res.ready | ||
res.bits := enq.bits | ||
when (!out_of_reset) { | ||
res.valid := false.B | ||
enq.ready := false.B | ||
} | ||
res | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters