Next: Procedures and variables, Previous: Boot sequence, Up: Running THUD
Some say everything is code, while others say everything is data. This section describes where and how THUD makes the distinction between the driver (code) and the design (data).
The drivers are Scheme files that are run from within the THUD environment. First, change into the particular directory and then invoke the driver. This can be done in two ways:
A driver is simply Scheme code that makes use of THUD primitives to do some work. The aforementioned environment restriction ensures that the driver has access to the proper definitions. This is done during THUD booting, which is different from THUD loading.
[It may be possible to merely “load” THUD into a Guile session and then `load' a driver, but that usage is discouraged because loading THUD does not boot it. Do not depend on this behavior; it may change in the future.]
To make a driver into a "standalone executable", do the following:
#!/some/path/to/thud -x
!#
Designs are expressed as Scheme-based RTL files that are “added” into the workspace, where they are instantiated and linked as needed before simulation. These files typically have extension .th (for THUD HDL). Adding files can be done in five ways:
Note that all these forms can take multiple .th files, as indicated by the ellipses.
The add-only construct (see Data procedures) tells THUD that
you probably won't be adding any other files – thus, THUD is free to
instantiate and link after adding those files. If you do add other
.th files afterwards, don't worry, THUD can handle it. (THUD
always makes sure instantiation and linking is done before simulation;
add-only is a hint that may save time but is not necessary.)