-
Notifications
You must be signed in to change notification settings - Fork 43
SKARAB Front Panel LED Manager
Functionality has been added to both the Toolflow and casperfpga
to manage the signals that drive the Front Panel LEDs on SKARAB boards. This page serves as a short introduction to how this can be managed in casperfpga
. The following points are worth noting before continuing:
- These additions were made as of this mlib_devel commit - F/W v2.7 - and this
casperfpga
commit - Images built/compiled for SKARAB default to LED control via the BSP, and not the DSP design. This is (obviously) subject to change.
For your (and my) convenience, this document describes this in some detail. I would definitely recommend giving this a read before proceeding. It outlines what each LED signifies and what controls it (albeit at a high level). That being said if all you're concerned with is function-calls, soldier on.
Of course, this control of the Front Panel LEDs is specific to the SKARAB platform, therefore the methods required to enact this control is done via the SKARAB Transport layer - transport_skarab.py. Here, the reading and writing of the wishbone register, aptly named dsp_override
, that dictates this control is packaged neatly into two functions.
This function reads the previously-mentioned wishbone register (at address 0x34) and returns 'who' is in control of the Front Panel LEDs, e.g.:
$ ipython
*
In [1]: import casperfpga
In [2]: skarab = casperfpga.SkarabFpga('skarab010103')
In [3]: skarab.transport.control_front_panel_leds_read()
Board Support Package is controlling FrontPanel LEDs...
*
This function writes a zero or one (0/1) to the wishbone register at address 0x34, depending on the parameter it is given. The dsp_override parameter has a default value of True, meaning a function call with no arguments (or manually dsp_override=True) will instruct the board to switch the LEDs' driving signals to those specified in the DSP Simulink Design. No need to pay too much attention to the returned Boolean, it is just there to confirm that the function call was successful:
*
In [4]: skarab.transport.control_front_panel_leds_write()
Successfully changed control of FrontPanel LEDs to DSP Design...
Out [4]: True
In [5]: skarab.transport.control_front_panel_leds_read()
DSP Design is controlling FrontPanel LEDs...
*
Conversely, giving the function an argument of False
will switch the LEDs' driving signals to those of the inherent Board Support Package (BSP):
*
In [6]: skarab.transport.control_front_panel_leds_write(dsp_override=False)
Successfully changed control of FrontPanel LEDs to Board Support Package...
Out [6]: True
*