Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify ReadyValidIO noenq to set the data payload to DontCare. #902

Merged
merged 2 commits into from
Oct 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/main/scala/chisel3/util/Decoupled.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object ReadyValidIO {
implicit class AddMethodsToReadyValid[T<:Data](target: ReadyValidIO[T]) {
def fire(): Bool = target.ready && target.valid

/** push dat onto the output bits of this interface to let the consumer know it has happened.
/** Push dat onto the output bits of this interface to let the consumer know it has happened.
* @param dat the values to assign to bits.
* @return dat.
*/
Expand All @@ -47,22 +47,23 @@ object ReadyValidIO {
}

/** Indicate no enqueue occurs. Valid is set to false, and bits are
* connected to an uninitialized wire
* connected to an uninitialized wire.
*/
def noenq(): Unit = {
target.valid := false.B
target.bits := DontCare
}

/** Assert ready on this port and return the associated data bits.
* This is typically used when valid has been asserted by the producer side.
* @return the data for this device,
* @return The data bits.
*/
def deq(): T = {
target.ready := true.B
target.bits
}

/** Indicate no dequeue occurs. Ready is set to false
/** Indicate no dequeue occurs. Ready is set to false.
*/
def nodeq(): Unit = {
target.ready := false.B
Expand Down