From 4838af2f4c4483e47b23d4f97dcfe87165d08ef4 Mon Sep 17 00:00:00 2001 From: Avimitin Date: Tue, 3 Dec 2024 14:45:49 +0800 Subject: [PATCH] [omreader] expose whole sram hierarchy path Signed-off-by: Avimitin --- omreaderlib/src/T1OMReaderAPI.scala | 7 +++---- omreaderlib/src/t1/T1.scala | 2 +- omreaderlib/src/t1rocketv/T1RocketTile.scala | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/omreaderlib/src/T1OMReaderAPI.scala b/omreaderlib/src/T1OMReaderAPI.scala index 7e9eae34b..1bc1dcecb 100644 --- a/omreaderlib/src/T1OMReaderAPI.scala +++ b/omreaderlib/src/T1OMReaderAPI.scala @@ -12,7 +12,7 @@ object SRAM { /** The SRAM Module to be replaced. */ case class SRAM( moduleName: String, - instanceName: String, + fullPath: String, depth: Int, width: Int, read: Int, @@ -79,9 +79,8 @@ object Path { } case class Path(top: String, hierarchy: Seq[(String, String)], local: Option[String]) { - def module: String = hierarchy.last._2 - def path: String = hierarchy.map(_._1).mkString(".") - def instanceName: String = hierarchy.last._1 + def module: String = hierarchy.last._2 + def path: String = hierarchy.map(_._1).mkString(".") } /** Public Module under T1 should implement Modules below. */ diff --git a/omreaderlib/src/t1/T1.scala b/omreaderlib/src/t1/T1.scala index d5d549000..a859f4afe 100644 --- a/omreaderlib/src/t1/T1.scala +++ b/omreaderlib/src/t1/T1.scala @@ -57,7 +57,7 @@ class T1(val mlirbc: Array[Byte]) extends T1OMReaderAPI { val hierarchy = Path.parse(sram.field("hierarchy").asInstanceOf[PanamaCIRCTOMEvaluatorValuePath].toString) SRAM( moduleName = hierarchy.module, - instanceName = hierarchy.instanceName, + fullPath = hierarchy.path, depth = sram.field("depth").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, width = sram.field("width").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, read = sram.field("read").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, diff --git a/omreaderlib/src/t1rocketv/T1RocketTile.scala b/omreaderlib/src/t1rocketv/T1RocketTile.scala index 75f9df3e9..30cd89649 100644 --- a/omreaderlib/src/t1rocketv/T1RocketTile.scala +++ b/omreaderlib/src/t1rocketv/T1RocketTile.scala @@ -62,7 +62,7 @@ class T1RocketTile(val mlirbc: Array[Byte]) extends T1OMReaderAPI { val hierarchy = Path.parse(sram.field("hierarchy").asInstanceOf[PanamaCIRCTOMEvaluatorValuePath].toString) SRAM( moduleName = hierarchy.module, - instanceName = hierarchy.instanceName, + fullPath = hierarchy.path, depth = sram.field("depth").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, width = sram.field("width").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, read = sram.field("read").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, @@ -97,7 +97,7 @@ class T1RocketTile(val mlirbc: Array[Byte]) extends T1OMReaderAPI { val hierarchy = Path.parse(sram.field("hierarchy").asInstanceOf[PanamaCIRCTOMEvaluatorValuePath].toString) SRAM( moduleName = hierarchy.module, - instanceName = hierarchy.instanceName, + fullPath = hierarchy.path, depth = sram.field("depth").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, width = sram.field("width").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt, read = sram.field("read").asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveInteger].integer.toInt,