Skip to content

Commit

Permalink
Merge pull request #1720 from tymcauley/faster-iobinders
Browse files Browse the repository at this point in the history
Reduce CDE lookups for IOBinders
  • Loading branch information
jerryz123 authored Dec 30, 2023
2 parents 8e4c972 + c2175f4 commit 4c245ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generators/chipyard/src/main/scala/iobinders/IOBinders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ object GetSystemParameters {
}

class IOBinder[T](composer: Seq[IOBinderFunction] => Seq[IOBinderFunction])(implicit tag: ClassTag[T]) extends Config((site, here, up) => {
case IOBinders => up(IOBinders, site) + (tag.runtimeClass.toString -> composer(up(IOBinders, site)(tag.runtimeClass.toString)))
case IOBinders => {
val upMap = up(IOBinders)
upMap + (tag.runtimeClass.toString -> composer(upMap(tag.runtimeClass.toString)))
}
})

class ConcreteIOBinder[T](composes: Boolean, fn: T => IOBinderTuple)(implicit tag: ClassTag[T]) extends IOBinder[T](
Expand Down

0 comments on commit 4c245ff

Please sign in to comment.