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

[stevo]: shift register enable signal now enables ALL registers in th… #370

Merged
merged 3 commits into from
Nov 18, 2016
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
6 changes: 2 additions & 4 deletions src/main/scala/chisel3/util/Reg.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ object ShiftRegister
*/
def apply[T <: Data](in: T, n: Int, en: Bool = Bool(true)): T = {
// The order of tests reflects the expected use cases.
if (n == 1) {
RegEnable(in, en)
} else if (n != 0) {
RegNext(apply(in, n-1, en))
if (n != 0) {
RegEnable(apply(in, n-1, en), en)
} else {
in
}
Expand Down