Simulator

From Bits

<-- ECE1373


Contents

[edit] Supported Systems

  • Visual C++ 2005
  • Linux-like systems

The simulator is located in sim/.

[edit] Command

sim <config_file_name> <ready_delta> <num_sim_time_steps> [Options]

Options

v: verbose
V <T>: verbose after timestamp > T
t <trace_addr2> <trace_filename>: generate a trace file for the node with address trace_addr2
tic <trace_bus> <trace_partition> s|d <trace_filename>: generate a trace file for the specified bus and partition
-daisy: the configuration file specified uses daisy format

[edit] Structure

class Node defines the interface of a "Node", and is inhereted by classes TrafficGen, Router, and PacketQueue. class Interconnect implements the on-chip network.

The cycle-driven simulation calls every object's tick() function every simulated cycle.

The simulator main loop is in sim.cpp. The tick() function for all Nodes are called, then the Interconnect's tick() function is called to deliver ready packets.

[edit] Files

sim.cpp, sim.h
Main program
trafficgen.[c/h], packetqueue.[c/h], router.[c/h]
Implementation of the TrafficGen, PacketQueue, and Router classes, respectively.
interconnect.[c/h]
Implementation of various interconnect schemes.
util.[c/h]
Collection of utility functions.

[edit] Global Variables

The following are declared in sim.h and instantiated in sim.cpp:

CLK
Clock cycle count since start of simulation.
T
The current simulation time.
DT
The change in T just before this clock cycle. Usually 0 or 1, 0 if T was not incremented this cycle. There are currently no plans to use DT > 1, but perhaps some future simulation scheme might use it.

[edit] Node

A Node has at least the following members:

addr2
Layer 2 ("physical") address for the node
void tick()
Called once per simulator clock cycle. Check DT to see whether the simulation time was incremented this cycle.
void push(const Packet *p)
Pushes a copy of Packet p to the Node. This function is called by the interconnect when it delivers a packet to the Node.
const Packet* ready()
Check (and get) a ready packet that is at the front of the Node's queue. Returns NULL if the queue is empty or if the Packet at the front of the queue is not yet "ready". The usual definition for "ready" is when a Packet's timestamp is earlier than T + ready_delta.
void Pop()
Remove a packet from the front of the Node's queue.

[edit] Packet

A packet's addr3 (layer 3 address) field is used for layer-3 routing. Routers look up the next hop of a Packet using the addr3 field. The addr2 field specifies the next hop for the packet. The Interconnect operates using the addr2 field.

[edit] Interconnect

The interconnect is called every clock cycle (calling Interconnect's tick()). It is responsible for querying all Nodes for ready packets (calling the ready() function for every node), then delivering the Packets according to the Interconnect scheme. (deliver = push() the ready() packet onto the destination Node, then pop() the packet off the source Node)

Ready packets may have timestamps in the future (> T) if ready_delta > 0.

[edit] Config File

A config file that describes the network setup to be simulated must be provided.

An example config file is shown below:

I ideal
T 0 1 6 30 88 30 88 30 2       # addr2, def_router, interval, psize, OQ latency, bandwidth, IQ ..., sendto
T 2 1 7 30 40 30 40 30 0
R 1 2 (0 0) (2 2)		# addr2, # of entries, (dest0, port0), (dest1, port1), ...
Q 88 30 3 3			# latency, bandwidth, next_hop, addr2

A single letter (T/R/Q) indicates the types of the node, followed by a sequence of numbers for the node parameters. A single line comment is marked by a #.

The interconnect is specified using the following format. Only one interconnect should be specified in each config file.

 I ideal
 I bus
 I dualbus
 I crossbar
 I dualthing1 [send_ahead_ideal | send_ahead_pessimistic | send_ahead_optimistic]
 I dualthing1b [send_ahead_ideal | send_ahead_pessimistic]
 I dualthing2
 I dualthing3
 I dualthing3pipe 5            # use max delivery delay limit = 5
 I dualthing3b

[edit] Misc

Verbose debug messages should be printed using myprintf. #define VERBOSE=0 turns off messages printed using myprintf.


[edit] Topology Generator

We use the Georgia Tech GT-ITM topology generator (homepage). GT-ITM creates a partially hierarchical network topology with transit and stub domains that resemble the characteristics of the Internet. The transit domain represents the backbone network of the Internet, while the stub domains model the smaller networks that form the rest of the Internet.

The output of GT-ITM is a connected graph of nodes. We treat each node as a router, and append to it a small number of leaf nodes that represent the hosts (traffic generators in the simulation). A Perl script (sim/scripts/parse_alt.pl) is written to manipulate the graph and also generate routing tables for each router based on shortest-paths. The script outputs a config file that can be used with the simulator. The output of GT-ITM needs to be converted using sgb2alt (included with the GT-ITM distribution) before it can be used with the script.

To use the script: parse_alt.pl <gt_itm_alt_file> <output_name> <num_leaves_to_append>

Example network generated (ts20-4.dat)

Example 60-node network

Personal tools