> configure(npc)

ysyx_22040000 李心杨
 Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux
  20:40:32  up 1 day 19:41,  2 users,  load average: 2.01, 1.24, 0.95
This commit is contained in:
tracer-ysyx 2024-01-09 20:40:32 +08:00 committed by xinyangli
parent f715cbd941
commit 3ccbccee77
No known key found for this signature in database
4 changed files with 9 additions and 13 deletions

View file

@ -63,7 +63,7 @@ class SegHandler(seg_count: Int) extends Module {
})
val seg_regs = RegInit(VecInit(Seq.fill(seg_count)(0.U(4.W))))
val seg_regs = RegInit(VecInit(Seq.fill(seg_count / 2)(0.U(8.W))))
val last_keycode = RegInit(0.U(8.W))
val counter = Counter(0xFF)
val digit_to_seg = Seq(

View file

@ -85,14 +85,14 @@ import npc.keyboard._
class Keyboard extends Module {
val io = IO(new Bundle {
val ps2 = PS2Port()
val segs = Output(Vec(6, UInt(4.W)))
val segs = Output(Vec(3, UInt(8.W)))
})
val keyboard_controller = Module(new KeyboardController)
val seg_handler = Module(new SegHandler(6))
val keyboard_controller = Module(new KeyboardController)
seg_handler.io.keycode <> keyboard_controller.io.out
io <> keyboard_controller.io
io <> seg_handler.io
keyboard_controller.io.ps2 := io.ps2
io.segs := seg_handler.io.segs
}

View file

@ -57,6 +57,7 @@ class KeyboardControllerSpec extends AnyFreeSpec with ChiselScalatestTester {
})
}
}
import npc.Keyboard
"Keyboard Simulation" in {
test(new Keyboard) { c =>
}