Skip to content

Commit

Permalink
Remove HasRocketChipStageUtils since it is dead (#3418)
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer authored Jul 12, 2023
1 parent b8dad7f commit 9b91787
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/main/scala/util/GeneratorUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,6 @@

package freechips.rocketchip.util

import java.io.{File, FileWriter}

import Chisel.throwException
import org.chipsalliance.cde.config.{Config, Parameters}
import chisel3.internal.firrtl.Circuit

trait HasRocketChipStageUtils {

def getConfig(fullConfigClassNames: Seq[String]): Config = {
new Config(fullConfigClassNames.foldRight(Parameters.empty) { case (currentName, config) =>
val currentConfig = try {
Class.forName(currentName).newInstance.asInstanceOf[Config]
} catch {
case e: java.lang.ClassNotFoundException =>
throwException(s"""Unable to find part "$currentName" from "$fullConfigClassNames", did you misspell it or specify the wrong package path?""", e)
}
currentConfig ++ config
})
}

def enumerateROMs(circuit: Circuit): String = {
val res = new StringBuilder
val configs =
circuit.components flatMap { m =>
m.id match {
case rom: BlackBoxedROM => Some((rom.name, ROMGenerator.lookup(rom)))
case _ => None
}
}
configs foreach { case (name, c) =>
res append s"name ${name} depth ${c.depth} width ${c.width}\n"
}
res.toString
}

def writeOutputFile(targetDir: String, fname: String, contents: String): File = {
val f = new File(targetDir, fname)
val fw = new FileWriter(f)
fw.write(contents)
fw.close
f
}

}

object ElaborationArtefacts {
var files: Seq[(String, () => String)] = Nil

Expand Down

0 comments on commit 9b91787

Please sign in to comment.