diff options
| author | jackkoenig | 2015-12-04 18:15:03 -0800 |
|---|---|---|
| committer | jackkoenig | 2015-12-04 18:15:03 -0800 |
| commit | e8ac783706cca1f7ee65d799b5d8be445b6a5c5d (patch) | |
| tree | f709f4f522f1e54c41c70ae733334646d2ef17af /src/main/scala/firrtl/Translator.scala | |
| parent | 4d88455c66bd3aa7fd549cdec4f1d05ede83fea2 (diff) | |
Everything is broken, need Translator to work on files without a circuit, need to parse queue module text in midas/Utils.scala, need to create (src, dst) -> Module mapping in midas/Fame.scala
Diffstat (limited to 'src/main/scala/firrtl/Translator.scala')
| -rw-r--r-- | src/main/scala/firrtl/Translator.scala | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main/scala/firrtl/Translator.scala b/src/main/scala/firrtl/Translator.scala index 152cd88e..e7bd6821 100644 --- a/src/main/scala/firrtl/Translator.scala +++ b/src/main/scala/firrtl/Translator.scala @@ -31,19 +31,21 @@ object Translator if( !it.hasNext ) throw new Exception("Empty file!") - // Find circuit before starting scope checks - var line = it.next - while ( it.hasNext && !line._1.contains("circuit") ) { - ret ++= line._1 + "\n" - line = it.next - } - ret ++= line._1 + " { \n" - if( !it.hasNext ) throw new Exception("No circuit in file!") + //// Find circuit before starting scope checks + //var line = it.next + //while ( it.hasNext && !line._1.contains("circuit") ) { + // ret ++= line._1 + "\n" + // line = it.next + //} + //ret ++= line._1 + " { \n" + //if( !it.hasNext ) throw new Exception("No circuit in file!") val scope = Stack[Int]() - scope.push(countSpaces(line._1)) - var newScope = true // indicates if increasing scope spacing is legal on next line + scope.push(0) + var newScope = false + //scope.push(countSpaces(line._1)) + //var newScope = true // indicates if increasing scope spacing is legal on next line while( it.hasNext ) { it.next match { case (lineText, lineNum) => @@ -52,7 +54,7 @@ object Translator val l = if (text.length > spaces ) { // Check that line has text in it if (newScope) { - if( spaces == scope.top ) scope.push(spaces+2) // Hack for one-line scopes + if( spaces <= scope.top ) scope.push(spaces+2) // Hack for one-line scopes else scope.push(spaces) } |
