Skip to content

Commit

Permalink
[omreader] expose whole sram hierarchy path
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Dec 8, 2024
1 parent 87aedde commit 93c7a26
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions omreaderlib/src/T1OMReaderAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -81,7 +81,6 @@ 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
}

/** Public Module under T1 should implement Modules below. */
Expand Down
2 changes: 1 addition & 1 deletion omreaderlib/src/t1/T1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions omreaderlib/src/t1rocketv/T1RocketTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 93c7a26

Please sign in to comment.