Stop using deprecated FileSystemUtilities to create files
This commit is contained in:
		
							
								
								
									
										2
									
								
								chisel3
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								chisel3
									
									
									
									
									
								
							 Submodule chisel3 updated: 54cd58cbb4...ce42ef1512
									
								
							
							
								
								
									
										2
									
								
								firrtl
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								firrtl
									
									
									
									
									
								
							 Submodule firrtl updated: b7de40e231...81f631bc87
									
								
							 Submodule hardfloat updated: 45f346678d...a07029b8db
									
								
							@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user