Scientific Users' Guide

Kiwi Substrate

Figure: Kiwi Substrate: Typical Structure of the Kiwi FPGA.
\includegraphics[width=17cm]{images/kiwi-substrate.eps}

Figure: Kiwi Substrate: Structure of the Kiwi Ksubs3 Zynq Substrate.
\includegraphics[width=17cm]{images/kiwi-zynq-ksubs3-general-structure.eps}

We use the term substrate to refer to an FPGA board or set of server blades that is/are loaded with various standard parts of the Kiwi system. The most important substrate facilities are access to DRAM memory, a disk filesystem and a console/debug channel. Basic run/stop/error status output to LEDs via GPIO is also provided.

The substrate is like an operating system on the FPGA. It supports connection to more than one application loaded in FGPA at once (cite farming paper).

There is some basic information on the Zynq substrate here:

http://www.cl.cam.ac.uk/research/srg/han/hprls/orangepath/kiwic-demos/zynq-pio-dma


Console and LCD stdout I/O and LED GPIO


Run-time Exception Handler

Run-time exceptions include integer divide-by-zero and null pointer de-reference, array bounds fail and runtime fail of Debug.Assert(). Floating point overflow is normally handled by returning IEEE Inf or NaN.

CIL bytecode has overflow trapping versions of the arithmetic operators that raise exceptions. We generate these from C# using checked keyword. Numeric casts can also be out of range, as in (ushort)0x10000 (a CIL conv_ovf.u2 assembly instruction is used.) In the future KiwiC can trap these overflows as run-time errors.

CIL bytecode has overflow trapping versions of the arithmetic operators that raise exceptions. We generate these from C# using checked keyword. Numeric casts can also be out of range, as in (ushort)0x10000 (a CIL conv_ovf.u2 assembly instruction is used.) In the future KiwiC can trap these overflows as run-time errors.

Convert exceptions for casting a value to an illegal value with respect to the target type range, as raised by the conv.ovf CLR instruction, ... please explain.

Array bounds checking can also give a run-time error.

TODO: explain here about a per-clock domain error net generated by KiwiC as part of control wires.

The C# Try construct is partially implemented - it does not do anything - no C# exception handling is supported at the moment.


DRAM

DRAM and Caches are described in §8.4.


Watchpoints and Start/Stop Control


Framestore

Having very high bandwidth for writes to the framestore is an intrinsic feature of FPGA computing. The framestore can be part of the compute engine and used for high-performance visualisation. Or it might just be used for a progress indicator - e.g. percentage of the job processed and final output.


Profiling

Certain basic block visit counts are collected and the results fed back to the performance counters...

Tick counter ... for tnow. Kiwi.tnow.

There is a simple version of System.Diagnostics.Stopwatch that is built trivially on top of the Kiwi.tnow mechanisms. It has the methods: Reset, Start and Stop . The current reading is via a getter for Stopwatch.ElapsedMilliseconds.



Subsections
David Greaves 2019-11-14