The number of buttons, switches, LEDs etc. supported by Embedded Project Oberon is summarised in the
Supported FPGA Development Boards section on the
Astrobe RISC5 - Embedded Project Oberon page on the Astrobe website.
Although the Nexys A7 board has 16 switches, only 8 are enabled because that is the most used by Project Oberon. However, if you need to use some more you can enable them yourself by modifying the Verilog files that we supply. If you are new to Verilog it would make an excellent exercise for you to gain some hands-on experience.
Hence, rather than give you a ready-made solution, here are some steps that should help get you started:
1. Using a text editor, add additional entries for swi[8], swi[9] etc. to the
##Switches section of the
NexysA7-100.xdc file
HINT: You can find out which pin is associated with which switch (e.g.
swi[8] = PACKAGE_PIN T8) by inspecting the
'Master' Nexys A7 XDC file or Sheet 7 of the schematic of the board which can be downloaded from Digilent's website.
2. Using a text editor, edit the two lines that reference the array
swi in the Verilog file
RISC5Top.v:
a) Increase the size of the swi array from 8 to 16 elements.
b) Reduce the number of zero bits in the
assign inbus statement to allow for the increased size of swi (e.g. from
20'b0 to
12'b0)
3. Regenerate the BitStream file
RISC5Top.bit and use it to reprogram the Nexys A7 board.
You should now be able to run the SwitchTest example with SwitchCount = 16
NOTE: As the buttons and switches share the same hardware register the change in 2b above also affects the ButtonTest example because the bits that represent the buttons (b) and switches (s) have now changed:
Code: Select all
00000000000000000000bbbbssssssss (4 buttons, 8 switches, button0 = bit 8)
000000000000bbbbssssssssssssssss (4 buttons, 16 switches, button0 = bit 16)