The code for this example lives in the directory
$SPLASH2/tutorial/MEMADDR and consists of the following
required files:
memaddr.vhd
system.vhd
$SPLASH2/simulator/system/system.vhd.
config.vhd
xinput
xmemory
xoutput
memaddr.vhd
contains the VHDL code. It has been commented to indicate required
elements. There are two main differences between this code and the
LED example. First, a memory interface has been added. Note that
only the first 16 locations in the memory are ever addressed. Second,
the data is only processed when the valid bit in the tag is set.
Each PE takes the incoming valid data, adds a value from memory to it, and passes it on. Thus, each input file data element is added to 32 different memory values as it makes it way around the 32 element PE array.
config.vhd
contains the VHDL configuration to create a full SPLASH system for
simulation. It has been commented to show how it could be changed to
accomodate other designs. Unlike the LED example, this example uses 2
SPLASH boards. Also, the file xmemory has been specified
as the initial contents of each PE's memory.
memory[0] to the first input data item,
memory[1] to the second data item, and so on. Since
there are 32 PE's in the design the net result is that each output
item output[i] will equal 32 * memory[i%16] +
input[i].
Although you have control over whether xinput is decimal
or hex, there seems to be no corresponding way to control the format
of the xmemory - it is always decimal. This would be a
great mini-project for someone to do - simply find
the VHDL code for the memory interface and add that capability!
This will create the file
vhdlan system memaddr config
TOP.sim which is the file which
will be simulated using VHDLSIM.
vhdlsim TOP
The only command we need to execute this time is simply:
run 10000
to run for 10000 ns. Determining why xoutput contains
what it does is left as an exercise for the reader.
vhdl2xnf memaddr.vhd
If all goes well the above should result in the file
memaddr.xnf. Currently, I get warning messages
about multiple drivers on nets which seem to be harmless. My best
guess is that Synopsys is confused.
At this point you may finish the compilation process by typing:
which should result in the file
xnf2bit memaddr
memaddr.bit.
If you use XBLOX elements in your designs, you should refer to Processing Designs with XBLOX to find out how to process the designs.
memaddr.vhd, memaddr.bit,
memaddr.sym, xinput, and xmemory.
symtobsym memaddr.sym
The files memaddr.bsym and
memaddr.bsym.dis will result and may be used during
t2 execution to look up signal values in the SPLASH
array.
/usr/etc/modstat
and look to see if the SPLASH2 driver is listed as running. If not, you may execute:
/etc/splash2/reload
to load a new one. In order to avoid kicking another user off SPLASH,
you should only restart the driver if you are certain one is not
running or are certain no-one else is running on SPLASH.
robocop
$SPLASH2/bin/robocop -a
on splash. This will run diagnostics indefinitely so you will
have to kill it after a while of watching the results.
t2t2 is an interactive program allowing you to
execute your design on SPLASH. The alternative, which will be shown
later, is to write a C program to drive SPLASH.
A series of commands, contained in the file cmds.t2 which you may use to drive your
t2 execution is explained below (you run the commands by
executing: source cmds.t2 in t2):
t2 that you wish every processor on
boards 0 and 1 in SPLASH to execute the design found in
memaddr.bit.
memaddr.raw so that in subsequent runs you may simply
execute the command
LoadRaw * memaddr.raw rather than doing the association
and merging as shown above. Note that when you SaveRaw
the file only contains data for one SPLASH board. Thus, if you want
different configurations on each board, you must save two raw files and
load them separately.
Also, not all signals shown can be traced. For example, XP_RIGHT should be trace-able. It always shows 0's due to a bug in the setup. I hope we can come up with a fix for this soon.
xmemory.
xinput,
pump them into the array one data item per clock cycle, and write any
valid results that come
out of the array into the file xoutput. In this example,
this will be done 200 times or until the input file is exhausted.
Since I know of no way in t2 to clock the array and write
outputs to an output file, we must pad the end of the
xinput with dummy data values to flush the array.
Otherwise we may see no output.
xoutput.
t2 commands above (except for the readback which I
currently don't know how to do). The comments in the code should
explain its operation. A Makefile is also included
to compile the driver code to execute on splash.
t2 and the use of SPLASH
which haven't been explored. As you learn more about SPLASH, please
keep me informed via e-mail so that I can add to these tutorials for
everyone's benefit.