Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chisel decoder. #2

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ lazy val chiselv = (project in file("."))

// Default library versions
lazy val versions = new {
val chisel3 = "3.5.0-RC2"
// val firrtl = "1.5-SNAPSHOT"
val chisel3 = "3.5-SNAPSHOT"
val chiseltest = "0.5.0-RC2"
val scalatest = "3.2.10"
val organizeimports = "0.5.0"
Expand All @@ -43,7 +42,6 @@ libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % versions.scalatest % "test",
"com.carlosedp" %% "scalautils" % versions.scalautils,
"com.lihaoyi" %% "os-lib" % versions.oslib
// "edu.berkeley.cs" %% "firrtl" % versions.firrtl // Force using SNAPSHOT until next RC is cut (memory synth)
)
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % versions.organizeimports
addCompilerPlugin(("edu.berkeley.cs" % "chisel3-plugin" % versions.chisel3).cross(CrossVersion.full))
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/CPUSingleCycle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CPUSingleCycle(

// Instantiate and initialize the ALU
val ALU = Module(new ALU(bitWidth))
ALU.io.ALUPort.inst := ERR_INST
ALU.io.ALUPort.inst := ERR
ALU.io.ALUPort.a := 0.U
ALU.io.ALUPort.b := 0.U

Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/Constants.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package chiselv

import chisel3.experimental.ChiselEnum
import chisel3.experimental.{ChiselEnum, ChiselEnum1H}

object Instruction extends ChiselEnum {
val ERR_INST,
val ERR,
// RV32I
ADD, ADDI, SUB, LUI, AUIPC, // Arithmetic
SLL, SLLI, SRL, SRLI, SRA, SRAI, // Shifts
Expand All @@ -20,6 +20,6 @@ object Instruction extends ChiselEnum {
= Value
}

object InstructionType extends ChiselEnum {
val IN_ERR, INST_R, INST_I, INST_S, INST_B, INST_U, INST_J, INST_Z = Value
object InstructionType extends ChiselEnum1H {
val INST_I, INST_S, INST_B, INST_U, INST_J, INST_Z, INST_R, IN_ERR = Value
}
Loading