Download Preface - The Computer Laboratory

Transcript
c 2011-17 DJ Greaves + S Singh
III Kiwi Supported Language Subset Limitations and Style Guide
19
4
20
General CSharp Language Features and Kiwi Coding Style
4.1
Supported Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2
Supported Constants and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3
String Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4
Supported Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.5
Supported Class Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.6
Supported I/O with Kiwi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.7
Data Structures with Kiwi 1/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.8
Data Structures with Kiwi 2/2 - more advanced and opaque temporary write up... . . 22
4.8.1
4.9
First Stage Processing (repack): . . . . . . . . . . . . . . . . . . . . . . . . 22
Dynamic Storage Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.10 Pointer Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.11 Garbage Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.12 Testing Execution Env: Whether I am running on the Workstation, RTL SIM or the FPGA blades. 2
4.13 Clone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.14 Varargs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.15 Delegates and Dynamic Free Variables . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.16 The ToString() Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.17 Accessing Numerical Value of Pointer Variables . . . . . . . . . . . . . . . . . . . . 27
4.18 Accessing Simulation Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.19 Run-time Status Monitoring, Waypoints and Exception Logging . . . . . . . . . . . 28
4.20 Exiting Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.20.1 Null pointer, Array bounds, Overflow, Divide-By-Zero and Similar Run-time Exceptions 2
4.20.2 Normal Thread and Program Exit . . . . . . . . . . . . . . . . . . . . . . . 29
4.20.3 User-defined C# Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.20.4 Debug.Assert or Trace.Assert . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.21 Pause Modes (within Sequencer HLS Mode) . . . . . . . . . . . . . . . . . . . . . . 30
4.22 Unwound Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.23 More-complex implied state machines . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.24 Inner loop unwound while outer loop not unwound. . . . . . . . . . . . . . . . . . . 33
4.25 Entry Point With Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5
Generate Loop Unwinding: Code Articulation Point
Kiwi Scientific Acceleration Manual
Rough Draft User Manual (KiwiC Version Alpha 0.3.2e) (Sept 2017)
33
3