From c2175f45004d5aab5d7384419c751b513f1af397 Mon Sep 17 00:00:00 2001 From: Tynan McAuley Date: Fri, 29 Dec 2023 21:22:34 -0800 Subject: [PATCH] Reduce CDE lookups for IOBinders --- generators/chipyard/src/main/scala/iobinders/IOBinders.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generators/chipyard/src/main/scala/iobinders/IOBinders.scala b/generators/chipyard/src/main/scala/iobinders/IOBinders.scala index 45f726410e..7695be7024 100644 --- a/generators/chipyard/src/main/scala/iobinders/IOBinders.scala +++ b/generators/chipyard/src/main/scala/iobinders/IOBinders.scala @@ -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](