Download Preface - The Computer Laboratory

Transcript
c 2011-17 DJ Greaves + S Singh
4.3
String Handling
Verilog and SystemC have 8-bit chars but C# and dotnet have 16-bit chars. KiwiC maps all 16bit chars to the closest 8-bit char. UTF-8 escapes could easily be supported in this process but are
missing at the moment.
Strings are supported a little, but there is currently no run-time concatenation or creation of new
strings, so all such string creation operations must be elaborated at KiwiC compile time and hence
be applied to constant strings.
4.4
Supported Operators
All standard arithmetic and logical operators are supported. Some operators, especially floatingpoint converts and floating-point arithmetic result in components being instantiated from the cvgates.v library. Integer mod, divide and larger multiplies also result in ALU instantiation, unless
arguments are constant identity values or powers of two that are easily converted to shifts. Divide
and multiply by a constant may result in adders being generated.
4.5
Supported Class Features
Classes can be statically and dynamically allocated. Constructor code is executed.
Static classes have their constructor code called at compile time (although it is perhaps possible for
the lasoo stem to end partly through the last one one of them.) The same goes for dynamic classes
that are converted to static within the lasoo stem.
Class and array instance handles can be manipulated at run time. KiwiC (repack stage) will allocate
a small integer for each one in each equivalence group where handles are interchanged or shared.
KiwiC checks whether the null value requires a code point in each group. Run-time null dereference
errors will be reported in the abend code register at some point soon.
Many class and array handles are never changed (the group has just one member) and hence are
merely an artefact of the C# language. Such handles are optimised away inside KiwiC and have
no run-time overhead. Class and array instance handles can be manipulated at run time. KiwiC
(repack stage) will allocate a small integer for each one in each equivalence class where handles are
interchanged. KiwiC checks whether the null value requires a code point. Run-time null de-reference
errors will be reported in the abend code register at some point soon.
4.6
Supported I/O with Kiwi
Kiwi supports a number of forms of I/O:
• Net-level RTL-style I/O through peeking and poking of static variables that are shared with
the outside world is the most basic form of I/O. Please see §7.10.
• Methods can also be designated as remotely-callable. Communication between separatelycompiled hardware modules is then analogous to method calls between software components.
This is explained in §7.1.
Kiwi Scientific Acceleration Manual
Rough Draft User Manual (KiwiC Version Alpha 0.3.2e) (Sept 2017)
21