IL2207_Lab3_WormholeNetworks_Spring2010x

foregoinggowpenSoftware and s/w Development

Nov 4, 2013 (3 years and 11 months ago)

67 views

IL2207

S
O
C

A
RCHITECTURES

Laboratory
3

Wormhole Networks

5 November 2013

1

Objective
s

The topic of this laboratory is
networks conducting wormhole or virtual channel flow control.
The laboratory shall deepen the understanding of
buffe
red flow control, in particular
, the impact
of flow control buffer dimensioning on network performance. The second objective is to help
students to
understand the
influence

of different traffi
c
patterns, and
furthermore, to
quantify

the
network performance

in terms of delay, throughput with re
s
pect to
increasing
workload until
saturation
.
As a pre
-
requisite, t
he students should

understand the mechanisms of wormhole
networks

and traffic patterns
.

2

Preparation

We

shall use

an in
-
house developed
Network
-
on
-
Chip Simulator
,

called
nocsim
,

in this
laboratory.
This simulator is written in functional
language

Haskell.
You can download
nocsim

from the course home page
www.ict.kth.se/courses/IL2207

and install it on your computer.
Nocsim

can run on Linux and Windows.

You can use one of the following ways to install and
run
nocsim
:

1)

Linux.
After

downloading the simulator, the package includes the simulator manual,
where instructions about how to install and execute can be found.

Make sure that you
have
Glasgow Haskell Compiler

(GHC) installed
.

You may download
GHC

from
http://www.haskell.org/ghc/download.html
. Not all
GHC

versions have been tested. But
versions
6.2.1,
6.
4
.1 work
.

2)

Windows XP. You can download
an executable for Windows XP and
instruction
s

on
how to install and run
the simulator
from the course web page.

3)

Other hybrid
environments
. For example, if you prefer using
Windows + Cygwin (or

similar)
,

y
ou can log on to one of our
Linux
servers
, install the simulator and
remotely
execute the simulator.


When the simulator
nocsim

is installed, you should be able to run it with


nocsim
-
h


to get a short list of switches. You should also have access to the simulator manual.


The simulator can execute many commands, but all of them fall into two categories:

simulation

commands and
plotting

commands. The command to execute is given with

the
-
C
option. We only nee
d one simulator command in this lab
: CycleData. And

we will only use one
plotting command: MkCycleDelayCycPlot.


Before you start executing a simulati
on command, create a subdirectory


mkdir SimWD


SimWD will be the directory where all the simulation output files will be stored and

where the
plotter looks for them.

Then you are ready to run your first command:


nocsim
-
C CycleData


which

generates something like this as output:

+ Current working directory: /home/axel/Exp/SimWD

+ CycleData (100 cycles) generates simfile.cyc: 0 sec. executed;

Command execution done


This
informs

you where the working directory of the simulator is, a
nd that one simulation

has
been run for 100 cycles. The output has been written to file simfile.cyc in

the working directory.
It is a text file; hence you can inspect and process it further. You

can also use it to make plots.

For instance,



nocsim
-
C
MkCycleDelayCycPlot
-
f simfile.cyc


will produce a plot on screen
similar

to the one shown in figure 1.


Figure 1: A plot showing the packet latency during a simulation of 100 cycles.


The other command line options, that can be listed with nocsim

-
h, are used to

configure the
network and steer the simulation. For instance, the command



nocsim
-
C CycleData
-
x 4
-
y 6
-
c 1024
-
m 10
-
r resU
-
E 5
-
s WH


runs a 1024 cycle
simulation

of a 4 × 6 network, which you will need in lab 1 below.

Essentially
,
you are now ready to start with
the laboratory

but note the following.




Calculate the average delay from the simulation output files, but always also

examine the
plots because they will give you a quick impression of the network

behavior
, e.
g. if it is
saturated or
not.



Use a smoothing factor of 10 (option
-
m 10) to make the plots easier to read.




Plan the experiments carefully. Carefully planned experiments save time.



Use scripts to run the simulation; use scripts to pos
t
-
process the simulator output

files.
Since you will re
-
run the simulations frequently, well written scripts

save time.
awk
, a
suitable post
-
processing program, is briefly introduced in appendix

A.

If you are familiar
with Perl or some other
suitable
scripting lan
guage, use that.



You only need to use the command CycleData for simu
la
tion and MkCycleDelayCycPlot

for plotting.



It will be sufficient to simulate for 1000
-
10000 cycles.



nocsim

is a flexible research and experimentation environment but not a

mature

industrial
tool. Many desirable features are not implemented and bugs certainly

are

n
u
merous.
F
eedback and suggestions

are welcome
,

so we can improve
the tool
.


3

L
aboratory Tasks


Wormhole switching is

the most common switching mechanism in
networks on chip. The
laboratory studies

the performance of wormhole switched networks with different buffer sizes.


3.1

Task 1


We investigate the impact of the number of
v
irtual
c
hannels (
VCs
)

against the depth of VCs per

physical channel on the network
performance.

Let L be the number of virtual channels, or lanes,
and let B be the size of a buffer

for each lane in each switch. Obviously, the minimal
configuration is (L = 1,

B = 1).

Two configurations (L = 2,

B = 4) and (L = 4,

B = 2) offer the
same amou
nt of

buffering.

For a 4 × 6 wormhole switched network find the (L,

B) configuration
with the

lowest buffer sizes for random uniform traffic, emission probability E = 50%, packet

size P = 1 for obtaining the lowest possible average packet latency.

Fill in
Table 1
.






3.2

Task 2


For a 4 × 6 wormhole switched network with 2 VCs determine the minimal VC buffer

size such
that, when increasing the buffer size by one, the latency will not decrease

by more than 10% for
a given traffic load. Determine these minimal

buffer sizes for a

combination of emission
probability and packet sizes given in
Table 2
.



3.2.1

Task 2a


Fill in
Table 2

for uniform random traffic. (
-
r resU
-
T Uniform)


3.2.2

Task 2b


Fill in
Table 2

for temporally bursty

but spatially uniform traffic based on the B
-
Model

with b =
0.1. (
-
r resB0.1
-
T Uniform)


3.2.3

Task 2c


Fill in
Table 2

for temporally uniform traffic which is spatially distributed according to

the
BitRotation model. (
-
r resU
-
T BitRotation)


4

Examination

In o
rder to pass this laboratory each student must
submit

a written document

with
the following:



the filled
-
in tables;



the relevant plots;



an interpretation and discussion of the results.

Results without
explanations

are not
acceptable.























A
ppendix:

Post processing with
awk


awk

is a scripting tool that allows to process simulator output files quickly and with

little effort. There are
two main variants,
awk
is the original program from AT&T Bell

Labs and Gnu’s
gawk
program, which has
some extended features. For our purpose,

both
awk
and
gawk
are similarly suitable. The
awk
primer
gives a fast overview.

awk
processes a file line by line. Each
awk
command consists of a PATTERN

-

COMMANDLIST pair. If the PATTERN is
omitted
, the COMMANDLIST will

be executed for each line.
For instance, assume that our simulation output file, as

generated by the CycleData command, looks as
follows.



We want to calculate the average packet delay count, which means we have to sum up

column 4 and
divide by the number of rows. An
awk
two
-
liner that accomplishes this

is:



In the first line the PATTERN is
omitted
, hence the command will be executed

for each line. It will
accumulate the values found in column 4 and it will count
the

number of rows. The second line starts with
the special pattern END, which means

the command will be executed after all lines have been processes.
It prints the average

delay. As you can see, commands use
syntax

similar to C. Many C structures such
as

if and for structures can be used.


The problem with our file is that the header lines should be ignored. We can do this

by specifying the
pattern for data lines.




The PATTERN is a regular expression enclosed in “/” characters. The “
ˆ
” character

matches

the
beginning of the line. The rest of the pattern says, there can be zero or

more spaces followed by one digit.
If the line matches this pattern, the corresponding

COMMANDLIST will be

executed, otherwise it will be
ignored.


We

hope this tiny tutorial gi
ves you an idea how to use
awk
or
gawk
for the labs. For

further details
please consult the man pages (
man awk
or
man gawk
), the on
-
line

prim
er
http://www.vectorsite.net/tsawk.html and the
gawk
home page

http://www.gnu.org/software/gawk which
contains an o
n
-
line manual.