> build_npc_VKeyboard_nvboard
ysyx_22040000 李心杨 Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux 17:33:36 up 2 days 16:34, 2 users, load average: 2.88, 1.66, 1.14
This commit is contained in:
parent
285a079b55
commit
d3812b75e3
1 changed files with 2 additions and 3 deletions
|
@ -62,8 +62,6 @@ class SegGenerator(seg_count: Int) extends Module {
|
||||||
val keycode = Flipped(Decoupled(UInt(8.W)))
|
val keycode = Flipped(Decoupled(UInt(8.W)))
|
||||||
val segs = Output(Vec(seg_count, UInt(8.W)))
|
val segs = Output(Vec(seg_count, UInt(8.W)))
|
||||||
})
|
})
|
||||||
val counter = Counter(0xFF)
|
|
||||||
|
|
||||||
io.keycode.ready := false.B
|
io.keycode.ready := false.B
|
||||||
when(io.keycode.valid) {
|
when(io.keycode.valid) {
|
||||||
io.keycode.ready := true.B
|
io.keycode.ready := true.B
|
||||||
|
@ -94,7 +92,8 @@ class SegGenerator(seg_count: Int) extends Module {
|
||||||
val ascii = MuxLookup(keycode, 0.U)(keycode_to_ascii)
|
val ascii = MuxLookup(keycode, 0.U)(keycode_to_ascii)
|
||||||
val ascii_digits = VecInit(ascii(3,0)) ++ VecInit(ascii(6,4))
|
val ascii_digits = VecInit(ascii(3,0)) ++ VecInit(ascii(6,4))
|
||||||
val ascii_seg = ascii_digits.map(MuxLookup(_, 0xFF.U)(digit_to_seg))
|
val ascii_seg = ascii_digits.map(MuxLookup(_, 0xFF.U)(digit_to_seg))
|
||||||
val count_digits = VecInit(counter.value(3,0)) ++ VecInit(counter.value(7,4))
|
val (counter, _) = Counter(io.keycode.valid && io.keycode.ready && io.keycode.bits =/= keycode, 0xFF)
|
||||||
|
val count_digits = VecInit(counter(3,0)) ++ VecInit(counter(7,4))
|
||||||
val count_seg = count_digits.map(MuxLookup(_, 0xFF.U)(digit_to_seg))
|
val count_seg = count_digits.map(MuxLookup(_, 0xFF.U)(digit_to_seg))
|
||||||
|
|
||||||
seg_regs := keycode_seg ++ ascii_seg ++ count_seg ++ Seq(0xFF.U, 0xFF.U)
|
seg_regs := keycode_seg ++ ascii_seg ++ count_seg ++ Seq(0xFF.U, 0xFF.U)
|
||||||
|
|
Loading…
Reference in a new issue