Download PDF1 - Greg Gibeling

Transcript
RDL supports declarations for host platforms
(e.g. an FPGA board or computer with specific input and output devices) and mappings of a toplevel unit onto a platform. Platform declarations
include the language (e.g. Verilog or Java) to generate and the specific facilities available for implementing channels on the host. A mapping from a
unit to a platform may also include more detailed
mappings to specify the exact implementation of
each channel. The back end of the compiler is easPackage: There is a package declaration placing
ily extensible to support new languages, and new
this in the root package (JavaShell) of the deimplementations.
sign. In a larger design, the package hierarchy
The RDLC2 map command will produce all of
will exactly mirror the RDL namespace hierthe necessary output to instantiate and connect the
archy.
various leaf units, in the desired set of host lanClass Declaration: We are declaring a class guages. The generated code is designed to be easnamed Counter, which implements the stan- ily readable, and structurally congruent with the
dard RDL unit interface, ramp.library.__Unit. original RDL description.
Notice that the unit interface is named as ramp
.library.__Unit indicating it is the interface 8.4.1 Map
simulations, but because it is easy to read, easy
to implement and has a superset of the features of
most other software languages. Thus we believe it
is an easy matter to write the output code for other
software languages by creating a new set of text renderings for the object oriented software abstraction
(see Section 9.4).
What follows is a list of the relevant statements
in the Java shell.
language=Java]!__Unit! in the \lstinline
language=Java]!ramp.library! package, which The RDLC2 -map:” inputfile dynamic autoshells
contains a number of other support classes plugins backends outputpath” command is will
generate a forest of directories, corresponding the
and interfaces.
static structure of the RDL namespaces being
Ports: There are declarations for an input and processed and containing all of the wrappers
an output port, as represented by the ramp (see Section 4.2) and links (see Section 4.3) in a
.library.__Input and ramp.library.__Output directory named after the map (see Section 6.4) as
interfaces. These interfaces take advantage of they are map specific. This process is illustrated
generics, a feature of Java 1.5, to use the Java as the bottom path in Figure 28. The point of
type-checker to ensure that only the appropri- this command is not to generate a specification
ate message types can be sent or received on of a mapping from a target to a host, but to
these ports.
generate the code which implements that mapping
Methods: There are empty method implemen- and thereby creating a working simulation or
tations for the two methods inherited from emulation. Mapping does not actually require
the ramp.library.__Unit interface, along with all the units to have implementations to map a
JavaDoc references to the original two meth- design, thought that is, of course a prerequisite for
running mapped design. There are a number of
ods.
arguments to this command documented below.
Implementing this unit is a matter of adding
state, some code in the public void Reset() inputfile: The RDL file in which the desired map
method to initialize it, and some code in the public
can be found. Of course this file may include
boolean Start() method which will simulate a sinothers (see Section 5.1.3).
gle target cycle! While in either method, the unit
will be able to send and receive messages on the dynamic: This is the static identifier of the map
to implement. The map must of course contwo channels: UpDown and Count.
tain an instance of the desired top level unit
In this section we have summarized the basic feaand platform, and may contain any number of
tures of the Java inside edge shells, as generated by
submaps as needed.
the RDLC.
8.4
autoshells: A boolean option (should be true or
false) which control whether shells for units
should be automatically included or generated.
As stated in Section 8.3.1, unit implementations (completed shells) are expected to be
found relative to the input RDL file using a file
path generated from the unit’s static identifier
Mapping
In this section we present some example code generated by the RDLC map command, as well as
documentation for the command itself (see Section 8.4.1).
64