From c03db677e8eb3081d1bb54146d60c06e21f52c91 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Wed, 10 Jan 2024 16:34:44 +0800 Subject: [PATCH] =?UTF-8?q?>=20build=5Fnpc=5FVSegHandler=5Fnvboard=20=20ys?= =?UTF-8?q?yx=5F22040000=20=E6=9D=8E=E5=BF=83=E6=9D=A8=20=20Linux=20calcit?= =?UTF-8?q?e=206.1.69=20#1-NixOS=20SMP=20PREEMPT=5FDYNAMIC=20Wed=20Dec=202?= =?UTF-8?q?0=2016:00:29=20UTC=202023=20x86=5F64=20GNU/Linux=20=20=2016:34:?= =?UTF-8?q?44=20=20up=202=20days=2015:35,=20=202=20users,=20=20load=20aver?= =?UTF-8?q?age:=202.26,=201.39,=201.34?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- npc/core/src/main/scala/Keyboard.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/npc/core/src/main/scala/Keyboard.scala b/npc/core/src/main/scala/Keyboard.scala index e66d705..7fd22ab 100644 --- a/npc/core/src/main/scala/Keyboard.scala +++ b/npc/core/src/main/scala/Keyboard.scala @@ -66,7 +66,7 @@ class SegGenerator(seg_count: Int) extends Module { val seg_regs = RegInit(VecInit(Seq.fill(seg_count)(0.U(8.W)))) val last_keycode = RegInit(0.U(8.W)) - val counter = Counter(0xFF) + val (counter, _) = Counter(0 to 0xFF, clock.asBool, reset.asBool) val digit_to_seg = ((0 until 16).map(_.U)).zip(Seq( "b00000011".U, "b10011111".U, "b00100101".U, "b00001101".U, "b10011001".U, "b01001001".U, "b01000001".U, "b00011111".U, @@ -89,10 +89,10 @@ class SegGenerator(seg_count: Int) extends Module { val ascii = MuxLookup(keycode, 0.U)(keycode_to_ascii) val ascii_digits = VecInit(ascii(3,0)) ++ VecInit(ascii(6,4)) 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 count_digits = VecInit(counter(3,0)) ++ VecInit(counter(7,4)) val count_seg = count_digits.map(MuxLookup(_, 0xFF.U)(digit_to_seg)) - seg_regs := count_seg ++ ascii_seg ++ keycode_seg ++ Seq(0xFF.U, 0xFF.U) + seg_regs := keycode_seg ++ ascii_seg ++ count_seg ++ Seq(0xFF.U, 0xFF.U) io.segs := seg_regs }