1
0

Stop using deprecated FileSystemUtilities to create files

This commit is contained in:
Andrew Waterman 2016-07-31 18:04:56 -07:00
parent 832e56d3c7
commit fe670e5421
6 changed files with 16 additions and 13 deletions

@ -1 +1 @@
Subproject commit 54cd58cbb435170dd2ed67dafe1cb1d769a799e8 Subproject commit ce42ef15128a626e723249ae7b129fb5a370fa9c

2
firrtl

@ -1 +1 @@
Subproject commit b7de40e23161a7346fea90576f07b5c200c2675b Subproject commit 81f631bc87aa22fff8569e96ae5c4e429df9e1d4

@ -1 +1 @@
Subproject commit 45f346678d0d6acfe894daa6321058b5857dfc72 Subproject commit a07029b8dbaa4385f94130da238b26b69f89b539

View File

@ -6,7 +6,7 @@ import Chisel._
import cde.Parameters import cde.Parameters
import uncore.devices.{DbBusConsts, DMKey} import uncore.devices.{DbBusConsts, DMKey}
object TestBenchGeneration extends FileSystemUtilities { object TestBenchGeneration {
def generateVerilogFragment( def generateVerilogFragment(
topModuleName: String, configClassName: String, p: Parameters) = { topModuleName: String, configClassName: String, p: Parameters) = {
val nMemChannel = p(NMemoryChannels) val nMemChannel = p(NMemoryChannels)
@ -298,7 +298,7 @@ object TestBenchGeneration extends FileSystemUtilities {
end end
""" } mkString """ } mkString
val f = createOutputFile(s"$topModuleName.$configClassName.tb.vfrag") val f = TestGeneration.createOutputFile(s"$topModuleName.$configClassName.tb.vfrag")
f.write(debugDefs + nasti_defs + nasti_delays + instantiation + ticks) f.write(debugDefs + nasti_defs + nasti_delays + instantiation + ticks)
f.close f.close
} }
@ -391,7 +391,7 @@ object TestBenchGeneration extends FileSystemUtilities {
#endif #endif
""" } mkString """ } mkString
val f = createOutputFile(s"$topModuleName.$configClassName.tb.cpp") val f = TestGeneration.createOutputFile(s"$topModuleName.$configClassName.tb.cpp")
f.write(assigns) f.write(assigns)
f.write(interrupts) f.write(interrupts)
f.close f.close

View File

@ -41,7 +41,7 @@ class BenchmarkTestSuite(makePrefix: String, val dir: String, val names: LinkedH
override def toString = s"$makeTargetName = \\\n" + names.map(n => s"\t$n.riscv").mkString(" \\\n") + postScript override def toString = s"$makeTargetName = \\\n" + names.map(n => s"\t$n.riscv").mkString(" \\\n") + postScript
} }
object TestGeneration extends FileSystemUtilities{ object TestGeneration {
import scala.collection.mutable.HashMap import scala.collection.mutable.HashMap
val asmSuites = new LinkedHashMap[String,AssemblyTestSuite]() val asmSuites = new LinkedHashMap[String,AssemblyTestSuite]()
val bmarkSuites = new HashMap[String,BenchmarkTestSuite]() val bmarkSuites = new HashMap[String,BenchmarkTestSuite]()
@ -90,6 +90,9 @@ run-$kind-tests-fast: $$(addprefix $$(output_dir)/, $$(addsuffix .run, $targets)
).mkString("\n")) ).mkString("\n"))
f.close f.close
} }
def createOutputFile(name: String) =
new java.io.FileWriter(s"${Driver.targetDir}/$name")
} }
object DefaultTestSuites { object DefaultTestSuites {
@ -170,7 +173,7 @@ object DefaultTestSuites {
"cm","cs","cv","cy","dc","df","dm","do","dr","ds","du","dv").map(_+"_matmul")): _*)) "cm","cs","cv","cy","dc","df","dm","do","dr","ds","du","dv").map(_+"_matmul")): _*))
} }
object TestGenerator extends App with FileSystemUtilities { object TestGenerator extends App {
val projectName = args(0) val projectName = args(0)
val topModuleName = args(1) val topModuleName = args(1)
val configClassName = args(2) val configClassName = args(2)
@ -199,16 +202,16 @@ object TestGenerator extends App with FileSystemUtilities {
TestBenchGeneration.generateCPPFragment( TestBenchGeneration.generateCPPFragment(
topModuleName, configClassName, paramsFromConfig) topModuleName, configClassName, paramsFromConfig)
val pdFile = createOutputFile(s"$topModuleName.$configClassName.prm") val pdFile = TestGeneration.createOutputFile(s"$topModuleName.$configClassName.prm")
pdFile.write(ParameterDump.getDump) pdFile.write(ParameterDump.getDump)
pdFile.close pdFile.close
val v = createOutputFile(configClassName + ".knb") val v = TestGeneration.createOutputFile(configClassName + ".knb")
v.write(world.getKnobs) v.write(world.getKnobs)
v.close v.close
val d = new java.io.FileOutputStream(Driver.targetDir + "/" + configClassName + ".cfg") val d = new java.io.FileOutputStream(Driver.targetDir + "/" + configClassName + ".cfg")
d.write(paramsFromConfig(ConfigString)) d.write(paramsFromConfig(ConfigString))
d.close d.close
val w = createOutputFile(configClassName + ".cst") val w = TestGeneration.createOutputFile(configClassName + ".cst")
w.write(world.getConstraints) w.write(world.getConstraints)
w.close w.close
} }

View File

@ -7,7 +7,7 @@ import uncore.tilelink._
import uncore.agents._ import uncore.agents._
import uncore.coherence._ import uncore.coherence._
object UncoreBuilder extends App with FileSystemUtilities { object UncoreBuilder extends App {
val topModuleName = args(0) val topModuleName = args(0)
val configClassName = args(1) val configClassName = args(1)
val config = try { val config = try {
@ -28,7 +28,7 @@ object UncoreBuilder extends App with FileSystemUtilities {
chiselMain.run(args.drop(2), gen) chiselMain.run(args.drop(2), gen)
val pdFile = createOutputFile(s"$topModuleName.prm") val pdFile = new java.io.FileWriter(s"${Driver.targetDir}/$topModuleName.prm")
pdFile.write(ParameterDump.getDump) pdFile.write(ParameterDump.getDump)
pdFile.close pdFile.close