On the Antminer S9, there is a red and a green LED and they are connected to MIO pins. This means we don't need to configure the FPGA to get access to them (like we do on the Ebaz). There are 4 other super bright green LEDs that are connected to the FPGA -- we will get to those later.
The bare metal mio.c and gpio.c files simply copied over and compiled. I put the top level code (that was main.c in the bare metal demo) into led.c and this led to exercising some basic Kyu features. The blinking gets run by a "repeating thread". When it is running, the Kyu thread list looks like so:
Thread: name ( &tp ) state sem pc sp pri Thread: shell (20071eb4) READY I 20004e5c 20534000 11 * Thread: led (20071cdc) REPEAT I 2000bb7c 20538000 25 Thread: idle (20071dc8) READY C 2000bbd0 20536000 1234The call to launch the "led" thread looks like this:
(void) thr_new_repeat ( "led", blinker, 0, 25, 0, 500 );Using this tests some important Kyu functionality. We launch a new thread, and we exercise the timer to reschedule it every 500 ticks.
Tom's Computer Info / tom@mmto.org