diff options
| author | jackkoenig | 2016-02-25 00:06:17 -0800 |
|---|---|---|
| committer | jackkoenig | 2016-02-25 00:06:17 -0800 |
| commit | ecd54ba32059a60789ee68abe9264f80a4992074 (patch) | |
| tree | 1cc764184a9c0e94c277438fd2965d30155a1ae1 /src | |
| parent | 5901c57caab635c0d5c1a7ac6502ea7872f44001 (diff) | |
Remove unused code in Driver, update help message
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/firrtl/Driver.scala | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/src/main/scala/firrtl/Driver.scala b/src/main/scala/firrtl/Driver.scala index 1e0d9cf1..f397a2ac 100644 --- a/src/main/scala/firrtl/Driver.scala +++ b/src/main/scala/firrtl/Driver.scala @@ -39,7 +39,11 @@ import DebugUtils._ object Driver extends LazyLogging { private val usage = """ - Usage: java -cp utils/bin/firrtl.jar firrtl.Driver [options] -i <input> -o <output> +Usage: sbt "run-main firrtl.Driver -i <input_file> -o <output_file> -X <compiler>" + firrtl -i <input_file> -o <output_file> -X <compiler> +Options: + -X <compiler> Specify the target language + Currently supported: verilog firrtl """ private val defaultOptions = Map[Symbol, Any]().withDefaultValue(false) @@ -56,34 +60,11 @@ object Driver extends LazyLogging { val arglist = args.toList type OptionMap = Map[Symbol, Any] - // Default debug mode is 'debug - def decodeDebugMode(mode: Any): Symbol = - mode match { - case s: String => Symbol(s) - case _ => 'debug - } - - def nextPrintVar(syms: List[Symbol], chars: List[Char]): List[Symbol] = - chars match { - case Nil => syms - case 't' :: tail => nextPrintVar(syms ++ List('types), tail) - case 'k' :: tail => nextPrintVar(syms ++ List('kinds), tail) - case 'w' :: tail => nextPrintVar(syms ++ List('widths), tail) - case 'T' :: tail => nextPrintVar(syms ++ List('twidths), tail) - case 'g' :: tail => nextPrintVar(syms ++ List('genders), tail) - case 'c' :: tail => nextPrintVar(syms ++ List('circuit), tail) - case 'd' :: tail => nextPrintVar(syms ++ List('debug), tail) - case 'i' :: tail => nextPrintVar(syms ++ List('info), tail) - case char :: tail => throw new Exception("Unknown print option " + char) - } - def nextOption(map: OptionMap, list: List[String]): OptionMap = { list match { case Nil => map case "-X" :: value :: tail => nextOption(map ++ Map('compiler -> value), tail) - case "-p" :: value :: tail => - nextOption(map ++ Map('printVars -> value), tail) case "-i" :: value :: tail => nextOption(map ++ Map('input -> value), tail) case "-o" :: value :: tail => @@ -109,17 +90,6 @@ object Driver extends LazyLogging { case s: String => s case false => throw new Exception("No output file provided!" + usage) } - val printVars = options('printVars) match { - case s: String => nextPrintVar(List(), s.toList) - case false => List() - } - - if (!printVars.isEmpty) { - logger.warn("-p options currently ignored") - if (!logger.underlying.isDebugEnabled) { - logger.warn("-p options will only print at DEBUG log level, logging configuration can be edited in src/main/resources/logback.xml") - } - } options('compiler) match { case "verilog" => compile(input, output, VerilogCompiler) @@ -127,12 +97,4 @@ object Driver extends LazyLogging { case other => throw new Exception("Invalid compiler! " + other) } } - - def time[R](str: String)(block: => R): R = { - val t0 = System.currentTimeMillis() - val result = block // call-by-name - val t1 = System.currentTimeMillis() - logger.info(s"Time to ${str}: ${t1 - t0} ms") - result - } } |
