diff options
| author | Jim Lawson | 2015-11-04 15:48:23 -0800 |
|---|---|---|
| committer | Jim Lawson | 2015-11-04 15:48:23 -0800 |
| commit | 730c951f4271120931062df674a9cd1303d226ad (patch) | |
| tree | ff4aadca6f21979ccbc321111236eb2485f8204a /src | |
| parent | 56db490d1395aa5603e2688906d5a4f227b187e1 (diff) | |
| parent | 42de6d9c42730cbce5659e821e9d9e04fe2ce925 (diff) | |
Merge pull request #57 from ucb-bar/stylechisel
Fix new style errors
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/Chisel/Driver.scala | 6 | ||||
| -rw-r--r-- | src/main/scala/Chisel/testers/BasicTester.scala | 2 | ||||
| -rw-r--r-- | src/main/scala/Chisel/testers/TesterDriver.scala | 6 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/main/scala/Chisel/Driver.scala b/src/main/scala/Chisel/Driver.scala index 64356b21..dd78ab8d 100644 --- a/src/main/scala/Chisel/Driver.scala +++ b/src/main/scala/Chisel/Driver.scala @@ -55,7 +55,7 @@ trait BackendCompilationUtilities { "--Wno-fatal", "--trace", "-O2", - "+define+TOP_TYPE=V"+prefix, + "+define+TOP_TYPE=V" + prefix, "-CFLAGS", s"""-Wno-undefined-bool-conversion -O2 -DTOP_TYPE=V$prefix -include ${vH.toString}""", "-Mdir", dir.toString, "--exe", cppHarness.toString) @@ -81,14 +81,14 @@ trait BackendCompilationUtilities { object Driver extends FileSystemUtilities with BackendCompilationUtilities { - /** Elaborates the Module specified in the gen function into a Circuit + /** Elaborates the Module specified in the gen function into a Circuit * * @param gen a function that creates a Module hierarchy * * @return the resulting Chisel IR in the form of a Circuit (TODO: Should be FIRRTL IR) */ def elaborate[T <: Module](gen: () => T): Circuit = Builder.build(Module(gen())) - + def emit[T <: Module](gen: () => T): String = elaborate(gen).emit def dumpFirrtl(ir: Circuit, optName: Option[File]): File = { diff --git a/src/main/scala/Chisel/testers/BasicTester.scala b/src/main/scala/Chisel/testers/BasicTester.scala index dbb269bb..398e49e7 100644 --- a/src/main/scala/Chisel/testers/BasicTester.scala +++ b/src/main/scala/Chisel/testers/BasicTester.scala @@ -11,5 +11,5 @@ class BasicTester extends Module { io.done := Bool(false) io.error := UInt(0) - def popCount(n: Long) = n.toBinaryString.count(_=='1') + def popCount(n: Long): Int = n.toBinaryString.count(_=='1') } diff --git a/src/main/scala/Chisel/testers/TesterDriver.scala b/src/main/scala/Chisel/testers/TesterDriver.scala index 657f7d37..d104782a 100644 --- a/src/main/scala/Chisel/testers/TesterDriver.scala +++ b/src/main/scala/Chisel/testers/TesterDriver.scala @@ -27,11 +27,13 @@ object TesterDriver extends BackendCompilationUtilities with FileSystemUtilities Driver.dumpFirrtl(circuit, Some(new File(fname.toString + ".fir"))) // Use sys.Process to invoke a bunch of backend stuff, then run the resulting exe - if(((new File(System.getProperty("user.dir") + "/src/main/resources/top.cpp") #> cppHarness) #&& + if (((new File(System.getProperty("user.dir") + "/src/main/resources/top.cpp") #> cppHarness) #&& firrtlToVerilog(prefix, dir) #&& verilogToCpp(prefix, dir, vDut, cppHarness, vH) #&& cppToExe(prefix, dir)).! == 0) { executeExpectingSuccess(prefix, dir) - } else false + } else { + false + } } } |
