Skip to content

Commit

Permalink
Added a final newline to .prm files and added --configDump flag to
Browse files Browse the repository at this point in the history
enable dumping parameter key/values to .prm file
  • Loading branch information
Adam Izraelevitz authored and Adam Izraelevitz committed Sep 10, 2014
1 parent fda3c68 commit 94650da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/scala/Driver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ object Driver extends FileSystemUtilities{
Driver.backend.initBackannotation
/* Params - If dumping design, dump space to pDir*/
if (Driver.chiselConfigMode == None || Driver.chiselConfigMode.get == "instance") {
if(!Dump.dump.isEmpty) {
if(Driver.chiselConfigDump && !Dump.dump.isEmpty) {
val w = createOutputFile(Driver.chiselConfigClassName.get + ".prm")
w.write(Dump.getDump); w.close
}
Expand Down Expand Up @@ -231,6 +231,7 @@ object Driver extends FileSystemUtilities{
//Jackhammer Flags
case "--configCollect" => chiselConfigMode = Some("collect"); chiselConfigClassName = Some(args(i+1)); i+=1; //dump constraints in dse dir
case "--configInstance" => chiselConfigMode = Some("instance"); chiselConfigClassName = Some(args(i+1)); i+=1; //use ChiselConfig to supply parameters
case "--configDump" => chiselConfigDump = true; //when using --configInstance, write Dump parameters to .prm file in targetDir
case "--dumpTestInput" => dumpTestInput = true
case "--testerSeed" => {
testerSeedValid = true
Expand Down Expand Up @@ -307,6 +308,7 @@ object Driver extends FileSystemUtilities{
/* ChiselConfig flags */
var chiselConfigClassName: Option[String] = None
var chiselConfigMode: Option[String] = None
var chiselConfigDump: Boolean = false

// Setting this to TRUE will case the test harness to print its
// standard input stream to a file.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/Parameters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ object Dump {
def apply[T](key:Any,value:T):T = {addToDump(key,value); value}
def apply[T](knob:Knob[T]):Knob[T] = {knobList += knob.name; knob}
def addToDump(key:Any,value:Any) = dump += ((key,value))
def getDump:String = dump.map(_.toString).reduce(_+"\n"+_)
def getDump:String = dump.map(_.toString).reduce(_+"\n"+_) + "\n"
}

// objects given to the user in mask functions (site,here,up)
Expand Down

0 comments on commit 94650da

Please sign in to comment.