This project involves the design and verification of a custom keyboard using SystemVerilog. The keyboard uses a Mealy Finite State Machine to model keypress states and a synchronizer and decoder for scan code conversion. A class-based testbench and custom driver code were implemented to handle a variety of test cases, including normal and edge cases such as key changes and multiple key presses. This comprehensive testing approach ensures the robustness and reliability of the keyboard design.
- 3x3 Keyboard
- List of supported keys:
- 0,1,2,3,4,5,6,7,8
- Matrix keyboard scanner
- Display key pressed
Invalid cases (2 or more keys pressed)
- 2 keys pressed in the same column
- 2 keys presses in different columns
- Completely random number generated
Valid (only 1 key pressed)
- Single valid key pressed
- Key changed when scanning
- Key removed during scanning
graph LR;
Sensitive-- Key Pressed --> Shift
Sensitive-- Key Not Pressed --> Sensitive
Shift-- Found --> Hold
Shift-- Not Found --> Shift
Shift-- Not Found at all --> Sensitive
Hold-- Key Pressed --> Hold
Hold-- Key Released --> Sensitive
- DUT.sv
- Interface.sv
- Packet.sv
- TestCases.sv
- Generator.sv
- Driver.sv
- Monitor.sv
- Scoreboard.sv
- Environment.sv
- Test.sv
- Top.sv
graph TD;
Top.sv --> Test.sv
Test.sv --> Environment.sv
Environment.sv --> Generator.sv
Environment.sv --> Driver.sv
Environment.sv --> Monitor.sv
Environment.sv --> Scoreboard.sv
Environment.sv --> TestCases.sv
TestCases.sv -- Packet.sv --> Generator.sv
Generator.sv -- Packet.sv --> Driver.sv
Monitor.sv -- Packet.sv --> Scoreboard.sv
Driver.sv <-- Interface.sv --> DUT.sv
DUT.sv <-- Interface.sv --> Monitor.sv
DUT.sv --> Top.sv
SystemVerilog coding guidelines
Branch Education on the working of a keyboard
Computerphile on the working of a keyboard
Ben Eater on PS2 Keyboard interfacing
Ben Eater on Keyboard Interfacing
Ben Eater on USB Keyboard Encoding
Hexadecimal Keyboard Scanner and Encoder
Generating random numbers in Verilog
Made with ❤️ by Eloquencere and spacebiz24