From 3b03aee93770df71c1c71dafdd08beb8b858a158 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Wed, 10 Jan 2024 17:29:22 +0800 Subject: [PATCH] =?UTF-8?q?>=20configure(npc)=20=20ysyx=5F22040000=20?= =?UTF-8?q?=E6=9D=8E=E5=BF=83=E6=9D=A8=20=20Linux=20calcite=206.1.69=20#1-?= =?UTF-8?q?NixOS=20SMP=20PREEMPT=5FDYNAMIC=20Wed=20Dec=2020=2016:00:29=20U?= =?UTF-8?q?TC=202023=20x86=5F64=20GNU/Linux=20=20=2017:29:22=20=20up=202?= =?UTF-8?q?=20days=2016:30,=20=202=20users,=20=20load=20average:=201.28,?= =?UTF-8?q?=200.94,=200.82?= 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 98c0c36..80c25e2 100644 --- a/npc/core/src/main/scala/Keyboard.scala +++ b/npc/core/src/main/scala/Keyboard.scala @@ -78,17 +78,17 @@ class SegGenerator(seg_count: Int) extends Module { "b01100011".U, "b10000101".U, "b01100001".U, "b01110001".U, )) - val keycode_to_ascii = (((0x41 to 0x5A) ++ (0x30 to 0x39)).map(_.U)).zip(Seq( + val keycode_to_ascii = Seq( 0x1C.U, 0x32.U, 0x21.U, 0x23.U, 0x24.U, 0x2B.U, 0x34.U, 0x33.U, 0x43.U, 0x3B.U, 0x42.U, 0x4B.U, 0x3A.U, 0x31.U, 0x44.U, 0x4D.U, 0x15.U, 0x2D.U, 0x1B.U, 0x2C.U, 0x3C.U, 0x2A.U, 0x1D.U, 0x22.U, 0x35.U, 0x1A.U, 0x45.U, 0x16.U, 0x1E.U, 0x26.U, 0x25.U, 0x2E.U, 0x36.U, 0x3D.U, 0x3E.U, 0x46.U, - )) + ).zip(((0x41 to 0x5A) ++ (0x30 to 0x39)).map(_.U)) // val keycode = Mux(io.keycode.ready && io.keycode.valid, io.keycode.bits, keycode) - val keycode = RegEnable(io.keycode.bits, 0.U, io.keycode.ready && io.keycode.valid) + val keycode = RegEnable(io.keycode.bits, io.keycode.ready && io.keycode.valid) val keycode_digits = VecInit(keycode(3,0)) ++ VecInit(keycode(7,4)) val keycode_seg = keycode_digits.map(MuxLookup(_, 0xFF.U)(digit_to_seg)) val ascii = MuxLookup(keycode, 0.U)(keycode_to_ascii)