VHDL-verification
Package to ease directed testing of HDL entities
|
Architecture is based on multiple concurrent assignments to the same signal, but some of the drivers are weak (pullups), just like the real hardware. More...
Architecture is based on multiple concurrent assignments to the same signal, but some of the drivers are weak (pullups), just like the real hardware.
Each pressed key connects a row to a column, so we have a second driver for rows here. If multiple keys are pressed, we may have multiple strong drivers with different values for the same column, depending on what values the user puts in the rows, which could result in an 'X' in simulation. In the hardware, the internal resistances avoid a short-circuit, but the resulting value is not defined.
The keys in the physical keyboard are:
Col0 | Col1 | Col2 | Col3 | |
---|---|---|---|---|
Row0 | 1 | 2 | 3 | A |
Row1 | 4 | 5 | 6 | B |
Row2 | 7 | 8 | 9 | C |
Row3 | 0 | F | E | D |
(Please note that Digilent's schematics are slightly outdated and do not reflect the actual key layout. The correct key layout is in the table above)
The correspondence, for this simulation model, between the keys and the bits in the pressed_keys
input is:
pressed_keys(i) to Row/Col/Key
i | Row | Col | Key |
---|---|---|---|
0 | 0 | 0 | 1 |
1 | 0 | 1 | 2 |
2 | 0 | 2 | 3 |
3 | 0 | 3 | A |
4 | 1 | 0 | 4 |
5 | 1 | 1 | 5 |
6 | 1 | 2 | 6 |
7 | 1 | 3 | B |
8 | 2 | 0 | 7 |
9 | 2 | 1 | 8 |
10 | 2 | 2 | 9 |
11 | 2 | 3 | C |
12 | 3 | 0 | 0 |
13 | 3 | 1 | F |
14 | 3 | 2 | E |
15 | 3 | 3 | D |
Definition at line 82 of file keypad_emu.vhd.
Processes | |
PROCESS_0 | ( pressed_keys , keypad_columns ) |
Constants | |
keypad_table | char_vector := ( ' 1 ' , ' 2 ' , ' 3 ' , ' A ' , ' 4 ' , ' 5 ' , ' 6 ' , ' B ' , ' 7 ' , ' 8 ' , ' 9 ' , ' C ' , ' 0 ' , ' F ' , ' E ' , ' D ' ) |
Types | |
char_vector | ( 0 to 15 ) character |
Signals | |
last_pressed_keys | std_logic_vector ( 15 downto 0 ) |