diff --git a/README.md b/README.md index ed8a581663..833813f860 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,12 @@ $ nix run .#t1..ip.emu-omreader -- run --dump-methods ##### `dlen` : Integer + ##### `extensionsJson` : Json + + | Field | Type | + |---------------------------------|--------| + | `[*]` | string | + ##### `decoderInstructionsJson` | `decoderInstructionsJsonPretty` : Json | Field | Type | diff --git a/omreader/src/Main.scala b/omreader/src/Main.scala index 78a3773493..dc783cd36f 100644 --- a/omreader/src/Main.scala +++ b/omreader/src/Main.scala @@ -47,6 +47,11 @@ object Main { println(simplyGetT1Reader(mlirbcFile).dlen) } + @main + def extensionsJson(@arg(name = "mlirbc-file") mlirbcFile: os.Path) = { + println(simplyGetT1Reader(mlirbcFile).extensionsJson) + } + @main def decoderInstructionsJson(@arg(name = "mlirbc-file") mlirbcFile: os.Path) = { println(simplyGetT1Reader(mlirbcFile).decoderInstructionsJson) diff --git a/omreaderlib/src/Interface.scala b/omreaderlib/src/Interface.scala index 56e5293f12..503a276fa4 100644 --- a/omreaderlib/src/Interface.scala +++ b/omreaderlib/src/Interface.scala @@ -69,6 +69,11 @@ class T1Reader private[omreaderlib](evaluator: PanamaCIRCTOMEvaluator, basePath: } def decoderInstructionsJson: String = ujson.write(decoderInstructionsJsonImpl) def decoderInstructionsJsonPretty: String = ujson.write(decoderInstructionsJsonImpl, 2) + def extensionsJson: String = { + val extensions = t1.field("extensions").asInstanceOf[PanamaCIRCTOMEvaluatorValueList] + val j = extensions.elements.map(_.asInstanceOf[PanamaCIRCTOMEvaluatorValuePrimitiveString].toString) + ujson.write(j) + } def dumpMethods(): Unit = { val mirror = runtimeMirror(getClass.getClassLoader).reflect(this) diff --git a/t1/src/T1.scala b/t1/src/T1.scala index 64daf2ddc4..3efd4ba48f 100644 --- a/t1/src/T1.scala +++ b/t1/src/T1.scala @@ -37,6 +37,12 @@ class T1OM extends Class { val dlenIn = IO(Input(Property[Int]())) dlen := dlenIn + @public + val extensions = IO(Output(Property[Seq[String]]())) + @public + val extensionsIn = IO(Input(Property[Seq[String]]())) + extensions := extensionsIn + @public val lanes = IO(Output(Property[Seq[AnyClassType]]())) @public @@ -340,6 +346,7 @@ class T1(val parameter: T1Parameter) omInstance.vlenIn := Property(parameter.vLen) omInstance.dlenIn := Property(parameter.dLen) + omInstance.extensionsIn := Property(parameter.extensions) /** the LSU Module */