blob: d77dbaf1c346f2b5451a963d69aa63df5e24e63c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// See LICENSE for license details.
package chiselTests
import chisel3._
import org.scalatest.{Matchers, FreeSpec}
class DummyModule extends Module {
val io = IO(new Bundle {
val in = Input(UInt(1.W))
val out = Output(UInt(1.W))
})
io.out := io.in
}
class DriverSpec extends FreeSpec with Matchers {
"Driver's execute methods are used to run chisel and firrtl" - {
"options can be picked up from comand line with no args" in {
Driver.execute(Array.empty[String], () => new DummyModule)
}
"options can be picked up from comand line setting top name" in {
Driver.execute(Array("-tn", "dm", "-td", "local-build"), () => new DummyModule)
}
"execute returns a chisel execution result" in {
val args = Array("--compiler", "low")
val result = Driver.execute(Array.empty[String], () => new DummyModule)
result shouldBe a[ChiselExecutionSucccess]
val successResult = result.asInstanceOf[ChiselExecutionSucccess]
successResult.emitted should include ("circuit DummyModule")
}
}
}
|