Skip to content

Commit 2209056

Browse files
Running Alu tests
1 parent f8163ac commit 2209056

7 files changed

Lines changed: 30 additions & 76 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ target/
44
generated/
55
project/
66
test_run_dir/
7-
quartus/
7+
quartus/
8+
.bsp/
9+
.bloop/

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ doit:
66
test:
77
sbt test
88

9-
clean:
10-
git clean -fd
11-

src/main/scala/empty/Add.scala

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
//> using scala "2.13.12"
2-
//> using dep "org.chipsalliance::chisel:6.7.0"
3-
//> using plugin "org.chipsalliance:::chisel-plugin:6.7.0"
4-
//> using options "-unchecked", "-deprecation", "-language:reflectiveCalls", "-feature", "-Xcheckinit", "-Xfatal-warnings", "-Ywarn-dead-code", "-Ywarn-unused", "-Ymacro-annotations"
5-
61
import chisel3._
72
import chisel3.util._
83
import _root_.circt.stage.ChiselStage
@@ -54,12 +49,3 @@ class Alu extends Module {
5449
}
5550
}
5651
}
57-
58-
object Main extends App {
59-
println(
60-
ChiselStage.emitSystemVerilog(
61-
gen = new Alu,
62-
firtoolOpts = Array("-disable-all-randomization", "-strip-debug-info")
63-
)
64-
)
65-
}

src/main/scala/main/Main.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import chisel3._
2+
import chisel3.util._
3+
import _root_.circt.stage.ChiselStage
4+
5+
object Main extends App {
6+
println("Generating Alu")
7+
emitVerilog(new Alu(), Array("--target-dir", "generated"))
8+
}

src/test/scala/empty/AddTester.scala

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/test/scala/main/AluTest.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import chisel3._
2+
import chiseltest._
3+
import org.scalatest.flatspec.AnyFlatSpec
4+
5+
class AluTest extends AnyFlatSpec with ChiselScalatestTester {
6+
"Alu" should "work" in {
7+
test(new Alu) { dut =>
8+
for (a <- 0 to 2) {
9+
for (b <- 0 to 3) {
10+
// val result = a + b
11+
// dut.io.a.poke(a.U)
12+
// dut.io.b.poke(b.U)
13+
// dut.clock.step(1)
14+
// dut.io.c.expect(result.U)
15+
}
16+
}
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)