Skip to content

Commit

Permalink
[om] retime FloatAdder in Permutation
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Dec 13, 2024
1 parent d94e76d commit ac124e7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion omreaderlib/src/t1/T1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ class T1(val mlirbc: Array[Byte]) extends T1OMReaderAPI {
def instructions: Seq[Instruction] = t1("decoder").obj("instructions").list.elements().map(_.obj).map(getInstruction)
def sram: Seq[SRAM] =
t1("lanes").list.elements().map(_.obj("vrf").obj).flatMap(getSRAM)
def retime: Seq[Retime] =

def floatAdder = {
val reduceUnit = t1("permutatuon").obj("reduceUnit").obj
// TODO: need fieldOpt(name: String)
Option.when(reduceUnit.fieldNames().contains("floatAdder"))(reduceUnit("floatAdder").obj).flatMap(getRetime)
}

def vfus: Seq[Retime] =
t1("lanes").list.elements().map(_.obj("vfus")).flatMap(_.list.elements().map(_.obj)).flatMap(getRetime)

def retime = (vfus ++ floatAdder).distinct
}
8 changes: 7 additions & 1 deletion omreaderlib/src/t1rocketv/T1RocketTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ class T1RocketTile(val mlirbc: Array[Byte]) extends T1OMReaderAPI {
Seq(tile("frontend").obj("icache").obj, tile("hellaCache").obj).flatMap(getSRAM)
def vfu: Seq[Retime] =
t1("lanes").list.elements().map(_.obj("vfus")).flatMap(_.list.elements().map(_.obj)).flatMap(getRetime)
def retime = vfu
def floatAdder = {
val reduceUnit = t1("permutatuon").obj("reduceUnit").obj
// TODO: need fieldOpt(name: String)
Option.when(reduceUnit.fieldNames().contains("floatAdder"))(reduceUnit("floatAdder").obj).flatMap(getRetime)
}

def retime = (vfu ++ floatAdder).distinct
def sram = vrf ++ cache
}

0 comments on commit ac124e7

Please sign in to comment.