Skip to content

ESYSim Develop Library : Network Configuration

wangeddie67 edited this page Aug 11, 2019 · 21 revisions

This chapter introduces the network configuration library for ESYSim. This library provides a data structure storing the network configuration used by ESYNet and VisualNoC.

The following sections are organized as follow:

Terminology

This section introduces the terminologies used to describe the topology. The common topologies for NoC include: switch, ring, mesh/torus and tree. These topology can be described in different models.

Topology

The network topology defines the connection of network components (routers and interface).

In ESYSim, network topology are divided into 2 category: regular topology and irregular topology. Regular topology means that routers have homogeneous configuration. For example, all routers in ring and mesh/torus network can be the same. In ESYSim, regular topologes include switch, ring and mesh/torus. Therefore the configuration of each routers and NIs can be generated by copying configurations from the template or by rules according to topology. The regular topology can be described by a set of simple parameters.

Except regular topologes, all other topologies are categoried as irregular topologies. If a topology is based on a regular topology but there is one or more routers with heteregenous configuration, the topology in this case is also recognized as irregular topology. Tree topology is categoried as an irregular topology because the tree topology is various and cannot be described in a unified model with ring/mesh/torus topology.

Network configuration library can generate the regular topology based on several simple parameters. Moreover, network configuration library can describe the irregular topology as well but users have to modify the configuration of each router and NI.

Diamension

The concept of diamension, which is adapted from geometry, is very important to describe regular topologies in ESYSim. Ring, mesh/torus can also be abstracted to a cube as shown below:

Diamension Cannot loop in one axis Can loop in one axis
1 Bus Ring
2 2D-Mesh 2D-Torus
3 3D-Mesh 3D-Torus
>=4 Multi-diamension Mesh Multi-diamension Torus

The routers are labeled through lower axis to higher axis. Take 2D mesh/torus topology as example, router 0-7 have the same coordinate on Y axis and different coordinates on X axis. Router 0/8/16 have the same coordinate on X axis but different coordinates on Y axis. For 2D/3D topology, axis 0 is renamed as X, axis 1 is renamed as Y, and axis 2 is renamed as Z.

Unless the port connects to a NI, ports are assigned to different axises. For example, port 1 and 2 are assigned to axis 0, port 3 and 4 are assigned to axis 1, and so on. Ports can only connect to other ports on the same axis. There are up and down directions on one axis. Up direction means the port connects to the router with higher coordinate on this axis; down direction means the port connects to the router with lower coordinate on this axis. For example, port 1 of router 0 connects to port 2 of router 1 while port 2 of router 0 connects to port 1 of router 7 in a 8-router ring network.

Rules to Build Regular Topology

ESYNet supports regular topolgies generated by options, including switch, ring, mesh/torus and diamension mesh/torus.

Switch

Switch topology always appears in micro-controllers (MCU) to connect peripherals together with the core. The network only has one router with several ports connecting with NI.

Example:

Topology=Switch
Size={1}

    Router    |                    Port                     |               NI
              |       In  In   Out  Out Neig Neig      Axis |              Conn Conn        Int
  ID   Pipe   |  ID   VC  Buf  VC   Buf R/NI Port Axis Dir  |  ID   Pipe   Rout Port  Buf  Delay
--------------|---------------------------------------------|--------------------------------------
   0 1.000000 |   0    1   10    1   10    0    0   NI      |   0 1.000000    0    0   10 100.000000 
              |   1    1   10    1   10    1    0   NI      |   1 1.000000    0    1   10 100.000000 
              |   2    1   10    1   10    2    0   NI      |   2 1.000000    0    2   10 100.000000 
              |   3    1   10    1   10    3    0   NI      |   3 1.000000    0    3   10 100.000000 
              |   4    1   10    1   10    4    0   NI      |   4 1.000000    0    4   10 100.000000 

Ring

Ring topology is very common in multi-core processors. Each router connects a cluster of cores, part of memories or interface to faster peripherals. Ring topology only has 1 diamension. The number of routers in one ring topology should be specified. Each router has one physical channel assigned to the network interface. Hence, the number of NIs is as same as the number of routers.

One router must have 2n+1 (n>=1) physical channels. Channel 0 is assigned to NI. Channel 2i+1 (0<=i<n) (e.g. 1, 3, etc.) is assigned to the up direction on axis 0; channel 2i+2 (0<=i<n) (e.g. 2, 4, etc.) is assigned to the down direction on axis 0. The ports are connected according their axis and direction on axis.

Example:

Topology=Ring
Size={6}

    Router    |                    Port                     |               NI
              |       In  In   Out  Out Neig Neig      Axis |              Conn Conn        Int
  ID   Pipe   |  ID   VC  Buf  VC   Buf R/NI Port Axis Dir  |  ID   Pipe   Rout Port  Buf  Delay
--------------|---------------------------------------------|--------------------------------------
   0 1.000000 |   0    1   10    1   10    0    0   NI      |   0 1.000000    0    0   10 100.000000 
              |   1    1   10    1   10    5    2    0 Downward
              |   2    1   10    1   10    1    1    0   Upward
   1 1.000000 |   0    1   10    1   10    1    0   NI      |   1 1.000000    1    0   10 100.000000 
              |   1    1   10    1   10    0    2    0 Downward
              |   2    1   10    1   10    2    1    0   Upward
   2 1.000000 |   0    1   10    1   10    2    0   NI      |   2 1.000000    2    0   10 100.000000 
              |   1    1   10    1   10    1    2    0 Downward
              |   2    1   10    1   10    3    1    0   Upward
   3 1.000000 |   0    1   10    1   10    3    0   NI      |   3 1.000000    3    0   10 100.000000 
              |   1    1   10    1   10    2    2    0 Downward
              |   2    1   10    1   10    4    1    0   Upward
   4 1.000000 |   0    1   10    1   10    4    0   NI      |   4 1.000000    4    0   10 100.000000 
              |   1    1   10    1   10    3    2    0 Downward
              |   2    1   10    1   10    5    1    0   Upward
   5 1.000000 |   0    1   10    1   10    5    0   NI      |   5 1.000000    5    0   10 100.000000 
              |   1    1   10    1   10    4    2    0 Downward
              |   2    1   10    1   10    0    1    0   Upward

2D Mesh/Torus

2D mesh topology became more and more popular in many-core processors because the high bandwidth and flexibility. Each router connects a cluster of process elements, includes cores, memories or peripherals. Each router connects to its north, south, west and east neighbor routers as well as the local network interface.

One router must have 2n+1 (n>=2) physical channels. Channel 0 is assigned to NI. The number of ports on one axis must be even. Meanwhile, both axis 0 and axis 1 must have ports. Thus, one router must have more than 5 ports. By default, channel 4i+1 (0<=i<n) (e.g. 1, 5, etc.) is assigned to the up direction on axis 0; channel 4i+2 (0<=i<n) (e.g. 2, 6, etc.) is assigned to the down direction on axis 0; channel 4i+3 (0<=i<n) (e.g. 3, 7, etc.) is assigned to the up direction on axis 1; channel 4i+4 (0<=i<n) (e.g. 4, 8, etc.) is assigned to the down direction on axis 1. The ports are connected according their axis and direction on axis.

Example:

Topology=2D-Torus
Size={4,4}

    Router    |                    Port                     |               NI
              |       In  In   Out  Out Neig Neig      Axis |              Conn Conn        Int
  ID   Pipe   |  ID   VC  Buf  VC   Buf R/NI Port Axis Dir  |  ID   Pipe   Rout Port  Buf  Delay
--------------|---------------------------------------------|--------------------------------------
   0 1.000000 |   0    1   10    1   10    0    0   NI      |   0 1.000000    0    0   10 100.000000 
              |   1    1   10    1   10   12    2    1 Downward
              |   2    1   10    1   10    4    1    1   Upward
              |   3    1   10    1   10    3    4    0 Downward
              |   4    1   10    1   10    1    3    0   Upward
   1 1.000000 |   0    1   10    1   10    1    0   NI      |   1 1.000000    1    0   10 100.000000 
              |   1    1   10    1   10   13    2    1 Downward
              |   2    1   10    1   10    5    1    1   Upward
              |   3    1   10    1   10    0    4    0 Downward
              |   4    1   10    1   10    2    3    0   Upward
   2 1.000000 |   0    1   10    1   10    2    0   NI      |   2 1.000000    2    0   10 100.000000 
              |   1    1   10    1   10   14    2    1 Downward
              |   2    1   10    1   10    6    1    1   Upward
              |   3    1   10    1   10    1    4    0 Downward
              |   4    1   10    1   10    3    3    0   Upward
   3 1.000000 |   0    1   10    1   10    3    0   NI      |   3 1.000000    3    0   10 100.000000 
              |   1    1   10    1   10   15    2    1 Downward
              |   2    1   10    1   10    7    1    1   Upward
              |   3    1   10    1   10    2    4    0 Downward
              |   4    1   10    1   10    0    3    0   Upward
   4 1.000000 |   0    1   10    1   10    4    0   NI      |   4 1.000000    4    0   10 100.000000 
              |   1    1   10    1   10    0    2    1 Downward
              |   2    1   10    1   10    8    1    1   Upward
              |   3    1   10    1   10    7    4    0 Downward
              |   4    1   10    1   10    5    3    0   Upward
   5 1.000000 |   0    1   10    1   10    5    0   NI      |   5 1.000000    5    0   10 100.000000 
              |   1    1   10    1   10    1    2    1 Downward
              |   2    1   10    1   10    9    1    1   Upward
              |   3    1   10    1   10    4    4    0 Downward
              |   4    1   10    1   10    6    3    0   Upward
   6 1.000000 |   0    1   10    1   10    6    0   NI      |   6 1.000000    6    0   10 100.000000 
              |   1    1   10    1   10    2    2    1 Downward
              |   2    1   10    1   10   10    1    1   Upward
              |   3    1   10    1   10    5    4    0 Downward
              |   4    1   10    1   10    7    3    0   Upward
   7 1.000000 |   0    1   10    1   10    7    0   NI      |   7 1.000000    7    0   10 100.000000 
              |   1    1   10    1   10    3    2    1 Downward
              |   2    1   10    1   10   11    1    1   Upward
              |   3    1   10    1   10    6    4    0 Downward
              |   4    1   10    1   10    4    3    0   Upward
   8 1.000000 |   0    1   10    1   10    8    0   NI      |   8 1.000000    8    0   10 100.000000 
              |   1    1   10    1   10    4    2    1 Downward
              |   2    1   10    1   10   12    1    1   Upward
              |   3    1   10    1   10   11    4    0 Downward
              |   4    1   10    1   10    9    3    0   Upward
   9 1.000000 |   0    1   10    1   10    9    0   NI      |   9 1.000000    9    0   10 100.000000 
              |   1    1   10    1   10    5    2    1 Downward
              |   2    1   10    1   10   13    1    1   Upward
              |   3    1   10    1   10    8    4    0 Downward
              |   4    1   10    1   10   10    3    0   Upward
  10 1.000000 |   0    1   10    1   10   10    0   NI      |  10 1.000000   10    0   10 100.000000 
              |   1    1   10    1   10    6    2    1 Downward
              |   2    1   10    1   10   14    1    1   Upward
              |   3    1   10    1   10    9    4    0 Downward
              |   4    1   10    1   10   11    3    0   Upward
  11 1.000000 |   0    1   10    1   10   11    0   NI      |  11 1.000000   11    0   10 100.000000 
              |   1    1   10    1   10    7    2    1 Downward
              |   2    1   10    1   10   15    1    1   Upward
              |   3    1   10    1   10   10    4    0 Downward
              |   4    1   10    1   10    8    3    0   Upward
  12 1.000000 |   0    1   10    1   10   12    0   NI      |  12 1.000000   12    0   10 100.000000 
              |   1    1   10    1   10    8    2    1 Downward
              |   2    1   10    1   10    0    1    1   Upward
              |   3    1   10    1   10   15    4    0 Downward
              |   4    1   10    1   10   13    3    0   Upward
  13 1.000000 |   0    1   10    1   10   13    0   NI      |  13 1.000000   13    0   10 100.000000 
              |   1    1   10    1   10    9    2    1 Downward
              |   2    1   10    1   10    1    1    1   Upward
              |   3    1   10    1   10   12    4    0 Downward
              |   4    1   10    1   10   14    3    0   Upward
  14 1.000000 |   0    1   10    1   10   14    0   NI      |  14 1.000000   14    0   10 100.000000 
              |   1    1   10    1   10   10    2    1 Downward
              |   2    1   10    1   10    2    1    1   Upward
              |   3    1   10    1   10   13    4    0 Downward
              |   4    1   10    1   10   15    3    0   Upward
  15 1.000000 |   0    1   10    1   10   15    0   NI      |  15 1.000000   15    0   10 100.000000 
              |   1    1   10    1   10   11    2    1 Downward
              |   2    1   10    1   10    3    1    1   Upward
              |   3    1   10    1   10   14    4    0 Downward
              |   4    1   10    1   10   12    3    0   Upward

Diamension Mesh/Torus

Diamension mesh and diamension torus is an abstraction of pipeline bus, ring, mesh, torus and cube topology. It is majorly used to simulate 3D topology, which is very popular in researches since 3D stack technology becomes more and more realiable.

The port connection is an extension of 2D mesh/torus. Channel 0 is assigned to NI. Thus, one router must have more than 2n+1 ports, n is the number of diamension. By default, channel (2n)*i+2k+1 (i>=0) is assigned to the up direction on axis k; channel (2n)*i+2k+2 (i>=0) is assigned to the down direction on axis k. The ports are connected according their axis and direction on axis.

Example:

Topology=MD-Mesh
Size={3,3,2}

    Router    |                    Port                     |               NI
              |       In  In   Out  Out Neig Neig      Axis |              Conn Conn        Int
  ID   Pipe   |  ID   VC  Buf  VC   Buf R/NI Port Axis Dir  |  ID   Pipe   Rout Port  Buf  Delay
--------------|---------------------------------------------|--------------------------------------
   0 1.000000 |   0    1   10    1   10    0    0   NI      |   0 1.000000    0    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10    9    1    2   Upward
              |   3    0   10    0   10   -1   -1    1 Downward
              |   4    1   10    1   10    3    3    1   Upward
              |   5    0   10    0   10   -1   -1    0 Downward
              |   6    1   10    1   10    1    5    0   Upward
   1 1.000000 |   0    1   10    1   10    1    0   NI      |   1 1.000000    1    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   10    1    2   Upward
              |   3    0   10    0   10   -1   -1    1 Downward
              |   4    1   10    1   10    4    3    1   Upward
              |   5    1   10    1   10    0    6    0 Downward
              |   6    1   10    1   10    2    5    0   Upward
   2 1.000000 |   0    1   10    1   10    2    0   NI      |   2 1.000000    2    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   11    1    2   Upward
              |   3    0   10    0   10   -1   -1    1 Downward
              |   4    1   10    1   10    5    3    1   Upward
              |   5    1   10    1   10    1    6    0 Downward
              |   6    0   10    0   10   -1   -1    0   Upward
   3 1.000000 |   0    1   10    1   10    3    0   NI      |   3 1.000000    3    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   12    1    2   Upward
              |   3    1   10    1   10    0    4    1 Downward
              |   4    1   10    1   10    6    3    1   Upward
              |   5    0   10    0   10   -1   -1    0 Downward
              |   6    1   10    1   10    4    5    0   Upward
   4 1.000000 |   0    1   10    1   10    4    0   NI      |   4 1.000000    4    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   13    1    2   Upward
              |   3    1   10    1   10    1    4    1 Downward
              |   4    1   10    1   10    7    3    1   Upward
              |   5    1   10    1   10    3    6    0 Downward
              |   6    1   10    1   10    5    5    0   Upward
   5 1.000000 |   0    1   10    1   10    5    0   NI      |   5 1.000000    5    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   14    1    2   Upward
              |   3    1   10    1   10    2    4    1 Downward
              |   4    1   10    1   10    8    3    1   Upward
              |   5    1   10    1   10    4    6    0 Downward
              |   6    0   10    0   10   -1   -1    0   Upward
   6 1.000000 |   0    1   10    1   10    6    0   NI      |   6 1.000000    6    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   15    1    2   Upward
              |   3    1   10    1   10    3    4    1 Downward
              |   4    0   10    0   10   -1   -1    1   Upward
              |   5    0   10    0   10   -1   -1    0 Downward
              |   6    1   10    1   10    7    5    0   Upward
   7 1.000000 |   0    1   10    1   10    7    0   NI      |   7 1.000000    7    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   16    1    2   Upward
              |   3    1   10    1   10    4    4    1 Downward
              |   4    0   10    0   10   -1   -1    1   Upward
              |   5    1   10    1   10    6    6    0 Downward
              |   6    1   10    1   10    8    5    0   Upward
   8 1.000000 |   0    1   10    1   10    8    0   NI      |   8 1.000000    8    0   10 100.000000 
              |   1    0   10    0   10   -1   -1    2 Downward
              |   2    1   10    1   10   17    1    2   Upward
              |   3    1   10    1   10    5    4    1 Downward
              |   4    0   10    0   10   -1   -1    1   Upward
              |   5    1   10    1   10    7    6    0 Downward
              |   6    0   10    0   10   -1   -1    0   Upward
   9 1.000000 |   0    1   10    1   10    9    0   NI      |   9 1.000000    9    0   10 100.000000 
              |   1    1   10    1   10    0    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    0   10    0   10   -1   -1    1 Downward
              |   4    1   10    1   10   12    3    1   Upward
              |   5    0   10    0   10   -1   -1    0 Downward
              |   6    1   10    1   10   10    5    0   Upward
  10 1.000000 |   0    1   10    1   10   10    0   NI      |  10 1.000000   10    0   10 100.000000 
              |   1    1   10    1   10    1    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    0   10    0   10   -1   -1    1 Downward
              |   4    1   10    1   10   13    3    1   Upward
              |   5    1   10    1   10    9    6    0 Downward
              |   6    1   10    1   10   11    5    0   Upward
  11 1.000000 |   0    1   10    1   10   11    0   NI      |  11 1.000000   11    0   10 100.000000 
              |   1    1   10    1   10    2    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    0   10    0   10   -1   -1    1 Downward
              |   4    1   10    1   10   14    3    1   Upward
              |   5    1   10    1   10   10    6    0 Downward
              |   6    0   10    0   10   -1   -1    0   Upward
  12 1.000000 |   0    1   10    1   10   12    0   NI      |  12 1.000000   12    0   10 100.000000 
              |   1    1   10    1   10    3    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    1   10    1   10    9    4    1 Downward
              |   4    1   10    1   10   15    3    1   Upward
              |   5    0   10    0   10   -1   -1    0 Downward
              |   6    1   10    1   10   13    5    0   Upward
  13 1.000000 |   0    1   10    1   10   13    0   NI      |  13 1.000000   13    0   10 100.000000 
              |   1    1   10    1   10    4    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    1   10    1   10   10    4    1 Downward
              |   4    1   10    1   10   16    3    1   Upward
              |   5    1   10    1   10   12    6    0 Downward
              |   6    1   10    1   10   14    5    0   Upward
  14 1.000000 |   0    1   10    1   10   14    0   NI      |  14 1.000000   14    0   10 100.000000 
              |   1    1   10    1   10    5    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    1   10    1   10   11    4    1 Downward
              |   4    1   10    1   10   17    3    1   Upward
              |   5    1   10    1   10   13    6    0 Downward
              |   6    0   10    0   10   -1   -1    0   Upward
  15 1.000000 |   0    1   10    1   10   15    0   NI      |  15 1.000000   15    0   10 100.000000 
              |   1    1   10    1   10    6    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    1   10    1   10   12    4    1 Downward
              |   4    0   10    0   10   -1   -1    1   Upward
              |   5    0   10    0   10   -1   -1    0 Downward
              |   6    1   10    1   10   16    5    0   Upward
  16 1.000000 |   0    1   10    1   10   16    0   NI      |  16 1.000000   16    0   10 100.000000 
              |   1    1   10    1   10    7    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    1   10    1   10   13    4    1 Downward
              |   4    0   10    0   10   -1   -1    1   Upward
              |   5    1   10    1   10   15    6    0 Downward
              |   6    1   10    1   10   17    5    0   Upward
  17 1.000000 |   0    1   10    1   10   17    0   NI      |  17 1.000000   17    0   10 100.000000 
              |   1    1   10    1   10    8    2    2 Downward
              |   2    0   10    0   10   -1   -1    2   Upward
              |   3    1   10    1   10   14    4    1 Downward
              |   4    0   10    0   10   -1   -1    1   Upward
              |   5    1   10    1   10   16    6    0 Downward
              |   6    0   10    0   10   -1   -1    0   Upward

Network Configuration File

The network configuration is described by the network configuration file. This file is accepted by ESYNet and VisualNoC. Moreover, it is part of the System-on-Chip configuration file. The parameters are organized in XML format. The file extension must be .netcfg.

Several methods can generate and modify the network configuration file.

  • The network configuration file can be created and modified as a text file.
  • ESYNet can generate a network configuration file for a regular network structure. The routers are homogeneous in regular network structures.
  • A seperate tool, netcfgeditor, is provided to create and modify the network configuration file for regular or irregular network structure.
  • VisualNoC provides graphic interface to create regular and irregular network structure intuitively.

File Head

The file head and top level tag are as follow:

<?xml version="1.0" encoding="UTF-8" ?>
<networkcfg>
    Network configuration parameters.
</networkcfg>

Network Configuration Parameters

Paramters to define network configuration are as follow:

<networkcfg>
    <topology>2</topology>
    <size size="2">
        <data index="0">4</data>
        <data index="1">4</data>
    </size>
    <template_router_cfg>
        Router configuration paramters.
    </template_router_cfg>
    <template_ni_cfg>
        NI configuration parameters.
    </template_ni_cfg>
    <router_cfg size="16">
        <data index="0">
            Router configuration paramters of router 0.
        </data>
        <data index="1">
            Router configuration paramters of router 1.
        </data>
        ...
    </router_cfg>
    <ni_cfg size="16">
        <data index="0">
            NI configuration parameters of NI 0.
        </data>
        <data index="1">
            NI configuration parameters of NI 1.
        </data>
        ...
    </ni_cfg >
</networkcfg>
  • topology: Specify the network topology by integar value. The map between integar value and topology is as follow.
Value Enumerate Topology Diamension
0 NT_SWITCH Single switch 0
1 NT_RING Double ring 1
2 NT_MESH_2D 2D Mesh 2
3 NT_TORUS_2D 2D Torus 2
4 NT_MESH_DIA Diamensional Mesh >=1
5 NT_TORUS_DIA Diamensional Torus >=1
6 NT_IRREGULAR Irregular topology 1
  • size: Specify the size of network. Attribute size is necessary to specify diamension as shown in above table. Tag data under tag size is used to specify the size of each diamension. Attribute index specifies the index of diamension (array index).
  • template_router_cfg: Configuration of the template router. The template router is used to generate regular network structures. When generate or re-generate a network structure, the configuration of each router is generated by copying the configuration of the template router and filling unspecified paramters based on the parameter topology and size. There are the paramters of one router under this tag.
  • template_ni_cfg: Configuration of the template NI. The template NI is used to generate regular network structures as template_router_cfg. There are the paramters of one NI under this tag.
  • router_cfg: Configuration of each router. Attribute size is necessary to specify the nubmer of routers. Tag data under tag router_cfg is used to specify the configuration of each router. Attribute index specifies the index of routers (array index). There are the parameters of one router under tag data.
  • ni_cfg: Configuration of each NI. Attribute size is necessary to specify the nubmer of NIs. The number of NIs are not necessary to be as same as the number of routers. Tag data under tag ni_cfg is used to specify the configuration of each router. Attribute index specifies the index of NIs (array index). There are the parameters of one NI under tag data.

Router Configuration Parameters

Paramters to define router configuration are as follow:

<id>0</id>
<position>
    <x>0</x>
    <y>0</y>
</position>
<port_cfg size="5">
    <data index="0">
        Port configuration parameters of port 0
    </data>
    <data index="1">
        Port configuration parameters of port 1
    </data>
    ...
</port_cfg>
<pipe_cycle>1</pipe_cycle>
  • id: Id of router.
  • position: The coordinate of the router in GUI. This parameter is only used in the visualization platform. position has two child parameter with tag of x and y. This parameter can only be modified by the visualization platform. ESYNet does not modify it. Network configuration editor netcfgeditor can modify this parameter but it is not suggest to do so because users cannot see the effect directly.
  • port_cfg: Configuration of each physical port. Attribute size is necessary to specify the nubmer of physical ports. Tag data under tag port_cfg is used to specify the configuration of each router. Attribute index specifies the index of NIs (array index). There are the parameters of one physical channel under tag data.
  • pipe_cycle: The cycle of pipeline in simulation resolution.

Physical Port Configuration Parameters

Paramters to define network interface configuration are as follow:

<input_vc>1</input_vc>
<output_vc>1</output_vc>
<port_dir>1</port_dir>
<port_axis>0</port_axis>
<port_axis_dir>0</port_axis_dir>
<neighbor_id>1</neighbor_id>
<neighbor_port>3</neighbor_port>
<input_buffer>10</input_buffer>
<output_buffer>10</output_buffer>
<ni>0</ni>
  • input_vc: The number of virtual channels of the input port.
  • output_vc: The number of virtual channels of the output port.
  • port_dir: Port direction. This direction is used to locate the port in the GUI graphics. Because a router is drawn as an octagon, the port can be located at 8 directions. port_dir can be specified by the topology or by users. The possible vaule is as follow.
Value Enumerate
0 ROUTER_PORT_NORTH
1 ROUTER_PORT_SOUTH
2 ROUTER_PORT_WEST
3 ROUTER_PORT_EAST
4 ROUTER_PORT_NORTHWEST
5 ROUTER_PORT_NORTHEAST
6 ROUTER_PORT_SOUTHWEST
7 ROUTER_PORT_SOUTHEAST
  • port_axis: The id of axis which the port belongs to. For example, the Mesh topology has 2 axis. Port 1 and 2 belong to axis 0; port 2 and 3 belong to axis 1.
  • port_axis_dir: The port direction on the axis. There are only 2 directions on the axis. The possible vaule is as follow. For example, the port 1 is on the up direction on axis 0 while the port 2 is on the down direction on axis 1. Therefore, the port 1 is connect to the port 2 of the router with higher id on the same axis while the port 2 connects to the port 1 of the router with lower id on the same axis.
Value Enumerate
0 AXDIR_UP
1 AXDIR_DOWN
  • neighbor_id: The id of the connected router if this physical port connects to a router, or the connected NI if this physical port connects to a NI.
  • neighbor_port: The id of connected physical port. If this physical port connects to NI, it is port 0 because the NI only has one port.
  • input_buffer: The size of input buffer for each input virtual channel.
  • output_buffer: The size of output buffer for each output virtual channel.
  • ni: 1 means this physical port connects to one network interface; 0 means this physical port connects to another router.

Network Interface Configuration Parameters

Paramters to define network interface configuration are as follow:

<id>15</id>
<connect_router>15</connect_router>
<connect_port>0</connect_port>
<pipe_cycle>1</pipe_cycle>
<buffer_size>10</buffer_size>
<interrupt_delay>100</interrupt_delay>
  • id: Id of network interface.
  • connect_router: The id of connected router. The id should point to a valid router.
  • connect_port: The id of connected physical port. The physical port should exist.

Template NI does not need to specify id, connect_router and connect_port. When construct network configuration based on template NI, the id, connect_router and connect_port are specified according to topology.

  • pipe_cycle: The cycle of pipeline in simulation resolution.
  • buffer_size: Size of ejection buffer. Used if interrupt_delay is not 0.
  • interrupt_delay: Delay to response interrupt triggered by NI in simulation resolution (not pipeline cycle). If interrupt_delay is not 0, packets is stored in the ejection buffer until time-out.

Network Configuration Interface

This section describes the program interface of network configuration library. For the detail description of data structures and functions, please check doxygen document.

Data Structures

Network configuration library contains several data structure:

  • EsyNetCfg contains the parameters of the network configuration.
    • EsyNetCfg also includes an entity of EsyNetCfgRouter and an entity of EsyNetCfgNI to define the paramters of the template router and NI.
    • EsyNetCfg also includes a vector of EsyNetCfgRouter and a vector of EsyNetCfgNI to define the paramters of routers and NIs.
  • EsyNetCfgRouter contains the parameters of the router configuration.
    • EsyNetCfgRouter also includes a vector of EsyNetCfgPort to define the parameters of all physical ports.
  • EsyNetCfgPort contains the paramters of the physical port configuration.
  • EsyNetCfgNI contains the paramters of the NI configuration.

Enumerate

Network configuration library contains several enumerate definition:

  • EsyNetCfgPort::PortDirection dominates the direction in GUI graphics.
  • EsyNetCfgPort::PortAxisDirection dominates the direction on the axis.
  • EsyNetCfg::NoCTopology dominates the network topology.

Network configuration library provides static methods to convert the enumerate value to string.

static std::string EsyNetCfg::nocTopologyStrVector( int i );
static std::string EsyNetCfgPort::portDirection2Str( int i );
static std::string EsyNetCfgPort::portDirection2ShortStr( int i );
static std::string EsyNetCfgPort::portAxisDirection2Str( int i );

portDirection2Str returns the full name of port direction, while portDirection2ShortStr returns the short name of directon, as N, S, E, W, NE, NW, SE, SW.

Create New Network Configuration

The general flow to create network configuration is as follow:

  • Create regular topology, template router and NI.
  • Update network configuration with template router and template NI.
  • Modify network configuration of irregular router and NI.

Create a Regular Topology

EsyNetCfg provides a construction function to create a topology as follow.

EsyNetCfg( NoCTopology topology, const std::vector< long >& size
    , double pipe_cycle, long phy_port, long input_vc_num, long output_vc_num, long input_buffer, long output_buffer
    , double ni_pipe_cycle, long ni_buffer, double ni_interrupt_delay
    );

This function provides all necessary parameters to create a regular network.

  • topology and size specify the network topology and size.
  • pipe_cycle, phy_port specify the parameters of the template router.
  • input_vc_num, output_vc_num, input_buffer and output_buffer specify the parameters of physical ports. All physical ports share these parameters.
  • ni_pipe_cycle, ni_buffer and ni_interrupt_delay specify the paramters of the template NI.

The configuration of the template router has not been completed because physical ports are not necessary to share the same configuration by input_vc_num, output_vc_num, input_buffer and output_buffer. Hence, EsyNetCfg provides methods to access the structure of the template router. For example:

EsyNetCfg netcfg(...)    // Create network configuration
EsyNetCfgRouter & template_router_cfg = netcfg.templateRouter()    // Get template router

for ( long i = 0; i < template_router_cfg.portNum(); i ++ )
{
    EsyNetCfgPort & port_cfg = template_router_cfg.port( i );
    ... // Modify parameters of one physical port in the template router.
}

EsyNetCfgRouter provides methods to access and set all parameters.

Update Network Configuration

After creating network topology, network size, template router and template NI, calling EsyNetCfg::updateNetwork() to generate the parameters are all routers and NIs. The flow of updateNetwork() is as follow:

  • Copy the configuration of each router from the template routers.
  • Disable empty ports in Mesh topology.
  • Connect ports according to topology. If one port is connected to network interface, one NI is created and the paramters are copied from the template NIs.

EsyNetCfg also provides another function updateNI() to update the parameters of NIs if the connection of network is changed.

Modify an Irregular Topology

EsyNetCfg provides methods to access the configuration of routers and NIs.

EsyNetCfg netcfg(...)    // Create network configuration
for ( long i = 0; i < netcfg.routerCount(); i ++ )
{
    EsyNetCfgRouter & router_cfg = netcfg.router( i );
    ... // Modify parameters of one router
}
for ( long i = 0; i < netcfg.niCount(); i ++ )
{
    EsyNetCfgNI & ni_cfg = netcfg.ni( i );
    ... // Modify parameters of one NI
}

It is worth to notice that, after modifying the parameter configurations of routers and NIs, the correct of connection should be guaranteed by the users rather than the library.

Because the number of NIs is accumulated by the number of NIs connected to each router, the total number of NIs as well as the router id to each NI and the NI id to each router will be changed if the connection is modified. Therefore, it is necessary to call updateNI() after modifying irregular topology.

Store and Read Network Configuration File

Write Network Configuration File

EsyNetCfg provides function writeXml to write the network configuration into the file specified by fname.

EsyXmlError writeXml( const std::string & fname );

The flow to write configuration file is as folllow:

  • Open file specified by argument fname.
  • Write network configuration paramter by EsyNetCfg::writeXml.
  • Write parameters of the template router configuration by EsyNetCfgRouter::writeXml.
    • Write parameters of configuration of each port by EsyNetCfgPort::writeXml.
  • Write parameters of the template NI configuration by EsyNetCfgNI::writeXml.
  • Write parameters of configuration of each router by EsyNetCfgRouter::writeXml.
    • Write parameters of configuration of each port by EsyNetCfgPort::writeXml.
  • Write parameters of configuration of each NI by EsyNetCfgNI::writeXml.

This function returns the XML structure.

Read Network Configuration File

EsyNetCfg provides function writeXml to write the network configuration into the file specified by fname.

EsyXmlError readXml( const std::string & fname );

The flow to write configuration file is as folllow:

  • Open file specified by argument fname.
  • Read network configuration paramter by EsyNetCfg::writeXml.
  • Read parameters of the template router configuration by EsyNetCfgRouter::writeXml.
    • Read parameters of configuration of each port by EsyNetCfgPort::writeXml.
  • Read parameters of the template NI configuration by EsyNetCfgNI::writeXml.
  • Read parameters of configuration of each router by EsyNetCfgRouter::writeXml.
    • Read parameters of configuration of each port by EsyNetCfgPort::writeXml.
  • Read parameters of configuration of each NI by EsyNetCfgNI::writeXml.

This function returns the XML structure.

XML Error Structure

EsyXmlError contains the information of error during parsing the XML file. EsyXmlError::hasError() can be used to check whether errors occur. EsyXmlError::title() and EsyXmlError::text() returns the information in string format.

bool EsyXmlError::hasError();
std::string EsyXmlError::title();
std::string EsyXmlError::text();

Network Configuration Editor

To make it easy to modify the network configuration file, network configuration editor is provided in the set of tools. The execution file can be found in the direction bin/networkcfgeditor.

Network configuration editor works on network configuration file. Each operation includes read file, modify configuration, and write file. The network configuration file is specified by the option -network_cfg_file_name. Network configuration editor provides following functions (function is selected by options):

  • Create network configuration (-create)
  • Print network configuration (-view)
  • Modify network configuration (-modify)
  • Search parameters of specified network/router/port/ni (-search)

Create network configuration

Option -create enbales the function to create network configuration. Meanwhile, following options are necessary to provide arguments for the construction function of EsyNetCfg:

-topology, -network_size, -pipe_cycle, -phy_number, -in_vc_number, -out_vc_number, -in_buffer_size, -out_buffer_size, -ni_pipe_cycle, -ni_buffer_size, -ni_interrupt_delay.

The generated network configuration is stored in the file specified by -network_cfg_file_name (no extension is necessary).

Print network configuration

Option -view enbales the function to print the network configuration in a simple table mode. Each line in the table demonstrates the configuration of one physical port in one router. The configuration of the template router and the template NI does not print out.

The network configuration comes from the file specified by -network_cfg_file_name (no extension is necessary).

Modify network configuration

Option -modify enables the function to change the configuration of specified router, port and NI.

The component to configurate is specified by following paramters.

-template_router -template_ni -router_id -port_id -ni_id Component
true valid index Port in template router
true not valid index Template router
false true Template NI
false false valid index valid index Specified router
false false valid index not valid index Port in specified router
false false not valid index valid index Specified NI

Only the modified parameters should be listed. The new value of parameters to change should be specified by options:

-pipe_cycle, -phy_number, -in_vc_number, -out_vc_number, -in_buffer_size, -out_buffer_size, -ni_pipe_cycle, -ni_buffer_size, -ni_interrupt_delay.

When the template router and template NI are modified, option -update enables updateNetwork() to update the configuration of routers and NIs. When the configuration of one router/port is modified, option -update enables updateNI() to udpate the configuration NIs and network connection.

The parameters for the network (topology and network size) cannot be modified by the network configuration editor. It is suggest to generate a new network configuration if users want to change the topology and network size.

The network configuration comes from the file specified by -network_cfg_file_name (no extension is necessary). After modification, the new network configuration is written into the same file specified by -network_cfg_file_name.

Print parameters

Option -search enables the function to print parameters of specified components.

The component to print is specified by following paramters.

-template_router -template_ni -router_id -port_id -ni_id Component
true valid index Port in template router
true not valid index Template router
false true Template NI
false false valid index valid index Specified router
false false valid index not valid index Port in specified router
false false not valid index valid index Specified NI
false false not valid index not valid index Network

The parameters are listed in expression <tag> = <value>. Each parameter print one variable.

  • Network: topology, net_size, router_count, ni_count
  • Port in template router: in_vc_num, out_vc_num, in_buf_size, out_buf_size, axis, axis_dir, ni
  • Template router: pipe_cycle, port_num
  • Template NI: ni_pipe_cycle, ni_buf_size, ni_int_delay
  • Port in specified router: in_vc_num, out_vc_num, in_buf_size, out_buf_size, axis, axis_dir, ni, conn_router, conn_port
  • Specified router: pipe_cycle, port_num
  • Specified NI: ni_pipe_cycle, ni_buf_size, ni_int_delay, ni_conn_router, ni_conn_port

The network configuration comes from the file specified by -network_cfg_file_name (no extension is necessary).

Graphic User Interface

In the folder tools/netcfgeditor-py, a command-line GUI script is provided for network configuration editor. The script can be run by following command:

./tools/netcfgeditor-py/netcfgeditor.py

Users can create and modify the network configuration file following the pages in the program.

The script needs the environment of python3. Except basic library, the script also needs pythondialog which needs linux library dialog.

netcfgedtior-py provides the graphic user interface. In the back-end, netcfgeditor-py calls netcfgeditor to create and modify the network configuration files.

Clone this wiki locally