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

fixed problem where runMain gbvga.GbVgaDriver failed #1

Merged
merged 1 commit into from Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions chisel/build.sbt
Expand Up @@ -42,8 +42,8 @@ resolvers ++= Seq(

// Provide a managed dependency on X if -DXVersion="" is supplied on the command line.
val defaultVersions = Map(
"chisel3" -> "3.4.0-RC1",
"chisel-iotesters" -> "1.5.0-RC1",
"chisel3" -> "3.4-SNAPSHOT",
"chisel-iotesters" -> "1.5-SNAPSHOT",
"chisel-formal" -> "0.1-SNAPSHOT",
)

Expand Down
2 changes: 1 addition & 1 deletion chisel/src/main/scala/gbvga/gbinclude.scala
Expand Up @@ -17,7 +17,7 @@ class Gb extends Bundle {
val data = UInt(2.W)
}

object GbConst {
trait GbConst { self: RawModule =>
val GBWIDTH = 160
val GBHEIGHT = 144

Expand Down
2 changes: 0 additions & 2 deletions chisel/src/main/scala/gbvga/gbvga.scala
Expand Up @@ -4,8 +4,6 @@ import chisel3._
import chisel3.util._
import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}

import GbConst._

class GbVga extends Module {
val io = IO(new Bundle {
/* Game boy input signals */
Expand Down
4 changes: 1 addition & 3 deletions chisel/src/main/scala/gbvga/gbwrite.scala
Expand Up @@ -5,11 +5,9 @@ import chisel3.util._
import chisel3.formal._
import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}

import GbConst._

class GbWrite (val datawidth: Int = 2,
val debug_simu: Boolean = true,
val aformal: Boolean = false) extends Module {//with Formal {
val aformal: Boolean = false) extends Module with GbConst {//with Formal {
val io = IO(new Bundle {
/* GameBoy input */
val gb = Input(new Gb())
Expand Down
2 changes: 0 additions & 2 deletions chisel/src/main/scala/gbvga/hvsync.scala
Expand Up @@ -11,8 +11,6 @@ import chisel3.util._
import chisel3.formal.Formal
import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}

import GbConst._

class HVSync extends Module { // with Formal { scala version problem
val io = IO(new Bundle {
val hsync = Output(Bool())
Expand Down
33 changes: 16 additions & 17 deletions chisel/src/main/scala/gbvga/memvga.scala
Expand Up @@ -4,9 +4,8 @@ import chisel3._
import chisel3.util._
import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}

import GbConst._

class MemVga extends Module {
class MemVga extends Module with GbConst {
val io = IO(new Bundle {
/* memory read interface */
val mem_addr = Output(UInt((log2Ceil(GBWIDTH*GBHEIGHT)).W))
Expand Down Expand Up @@ -84,21 +83,21 @@ class MemVga extends Module {
/* Vga colors */
io.vga_color := VGA_BLACK
when(hvsync.io.display_on && (state===sPixInc)){
// io.vga_color := GbColors(io.mem_data)
switch(io.mem_data) {
is("b00".U) {
io.vga_color := GB_GREEN0
}
is("b01".U) {
io.vga_color := GB_GREEN1
}
is("b10".U) {
io.vga_color := GB_GREEN2
}
is("b11".U) {
io.vga_color := GB_GREEN3
}
}
io.vga_color := GbColors(io.mem_data)
// switch(io.mem_data) {
// is("b00".U) {
// io.vga_color := GB_GREEN0
// }
// is("b01".U) {
// io.vga_color := GB_GREEN1
// }
// is("b10".U) {
// io.vga_color := GB_GREEN2
// }
// is("b11".U) {
// io.vga_color := GB_GREEN3
// }
// }
}

/* Memory interface */
Expand Down
4 changes: 1 addition & 3 deletions chisel/src/main/scala/gbvga/rawgbvga.scala
Expand Up @@ -9,9 +9,7 @@ import chisel3.util._
import chisel3.formal.Formal
import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}

import GbConst._

class RawGbVga extends RawModule {
class RawGbVga extends RawModule with GbConst {

/************/
/** outputs */
Expand Down
2 changes: 0 additions & 2 deletions chisel/src/main/scala/gbvga/simplevga.scala
Expand Up @@ -9,8 +9,6 @@ import chisel3.util._
import chisel3.formal.Formal
import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}

import GbConst._

class SimpleVGA extends RawModule {
/************/
/** outputs */
Expand Down