Download Preface - The Computer Laboratory

Transcript
c 2011-17 DJ Greaves + S Singh
When an implemented or up-called method is marked as ‘Remote’, a protocol is given and KiwiC
generates additional I/O terminals on the generated RTL that implement a stub for the call. The
originally implemented protocol, HSIMPLE, was asynchronous, using a four-phase handshake and
a wide bus that carries all of the arguments in parallel. Another bus, of the reverse direction, conveys
the result where non-void. Further protocols can be added to the compiler in future, but we would
like to instead lift them so they can be specified with assertions in C# itself.
Over two runs, KiwiC will generate hardware both for the client and the server as separate RTL files.
In more-realistic examples, there will be multiple files, with one being the top-level that contains
client calls to some of the others which in turn make client calls to others, with the leaf modules in
the design hierarchy being servers only.
Basic procedure:
1. Mark a static method (or several of them) on a class with the Remote attribute.
2. Compile that class to a .dll file and compile that with KiwiC in a context where it is not
invoked (run). The code will not be run if there is no -root or HardwareEntryPoint defined
for this KiwiC invokation. For most non-trival cases, the entry point may be in another .dll
anyway, so avoiding running it is only an issue on toy examples. The result is a .v and some
.xml. This resulting RTL will be the server — an implementation of the method. It is described
in some generated IP-XACT files whose name starts with ‘AUTOMETA’.
3. For this step, a full implementation of the method(s) is not needed (they can have empty
method bodies), but identical signatures must be present somewhere in the .CIL code read
in for typechecking. Compile the class again (or a stub alternative with null body) but this
time with a thread that invokes the method. KiwiC can either read in the IP-XACTfiles from a
previous run (on the IP-ip-incdir search path) or else regenerate them from the encounted
implementation (stub or otherwise). The resulting RTL will be the client.
4. To use the result, combine the RTL from the two runs for an
either manually or using HPR System Integrator.
RTL
simulation or
FPGA
build,
5. (To package up the result for long-term library use, it is perhaps best manually rename the
files without the ‘AUTOMETA’ prefix and perhaps the attribute squirrelling suffix. The prefix
denotes automatically generated files that are likely to be regenerated, whereas without it
the files are intended for more-persistent deployment. The prefix is not put on the IP-XACT
component definition file, just in those it references. You will have to similarly delete such
sub-strings from inside IP-XACT ẋml descriptions too, perhaps using ‘sed’.)
One can also envision leaf modules in the design hierarchy making upcalls to parents, but this is not
currently implemented in Kiwi. Yes it is, sort of, via ‘externally-instantiated’ markup, where the
callee is outside the generated RTL module structurally. Please explain further.
class test10
{
static int limit = 10;
static int jvar;
// Note four-phase is old, predating HSIMPLE - we should now be
Kiwi Scientific Acceleration Manual
Rough Draft User Manual (KiwiC Version Alpha 0.3.2e) (Sept 2017)
42