Introduction

btl is the raw cycle-accurate simulator. It matches the hardware behaviour exactly (although
the sizes of rams and number of tiles can be configured), but has added debugging functionality.
The original goal of btl was to develop the architecture. Then, btl's purpose was to aid
in the verification of the Raw processor.

Now, btl's purpose is to:
1) assist people in debugging and performance tuning their applications,
2) permit simulation of Raw processors at future technology points and
3) simulate Raw with different I/O devices than the existing Raw motherboard provides.

btl features a interpretive pipeline simulation engine, around which is wrapped the
bC extension language
interpreter. bC is a reflective, cooperatively-multithreaded, interpreted
dialect of C. The interpreter automatically translates bC code into x86 assembly on the fly.
The bug user interface, motherboard hardware devices, and
machine-level
debugging support layer of the simulator are all written in bC. It is very easy to

add your own commands and devices by writing your own .bc code. In fact,
I recommend that you do so.

btl replaces rawsim,  which was much less accurate. if you should see references
to rawsim in a document, it is likely that you are reading an outdated version..

For more information about the Raw architecture, please refer to the
Raw specification, on the Raw website.

Creating an executable

The process of building a btl executable is exciting enough that one should not attempt it by hand.

Fortunately, the makefiles provided in the starsearch/starbuild directory
will do all of the work for you.

Note that there are two types of executable:

.rbf - the raw boot format. Technically for tests and the OS boot rom only.
However, in practice, it's the fastest way to directly to your code, so many people use this.
This uses the snakeboot boot process.


.rexe - a standard Raw executable, loaded after the OS.

Firing it Up

We recommend that you make use of the starsearch/starbuild infrastructure for
configuring your btl session. It invokes btl with all of the necessary
parameters the describe the environment around the raw chip that you
are simulating.

gmake debug
will do the trick if you are using starsearch/starbuild (and you should.)

In general, btl allows you to configure the number of X and Y tiles,
the devices that sit on the outside of the tiles, the sizes of the rams,
any debugging/performance counting features that you may want to add, and much more.

What you see

btl checks to see if the input tty is interactive. If it is not, then it will not bother setting up
the pretty interface. Thus, you can specify an input .bC file to script btl and an output file to
capture the output.

If you do run btl interactively, two windows will appear:

The Code Window

The Shunt Window

The Vis Window

Other useful commands

Use help("name") on these commands for description of their arguments.

Passing GO