To simulate a Network-on-Chip (NoC) Topology in OMNeT++ has needs to design the communication framework within a chip in which the numerous components like cores, memory units, and peripherals are organized. NoC is a scalable, packet-switched network architecture utilized to enhance data transmission in multi-core processors.
Here’s how you can simulate a Network-on-Chip Topology in OMNeT++ step-by-step:
Steps to Simulate Network on Chip Topology Projects in OMNeT++
- Understanding Network-on-Chip (NoC) Topology
In a Network-on-Chip, several processing elements (PEs), like cores, memory controllers, and accelerators, are associated through a packet-switched network. Common NoC topologies have contained:
- Mesh Topology: A 2D grid of nodes with each node associated to its neighbors.
- Torus Topology: Similar to a mesh but with wrap-around connections.
- Tree Topology: Nodes are organized in a tree-like structure.
- Ring Topology: Nodes are associated in a circular fashion.
The goal is to route data among these PEs using a router at each node, that forwards packets according to routing algorithms (e.g., XY routing).
- Define the Network-on-Chip Topology in NED (NED File)
Let’s describe 2D Mesh NoC Topology in OMNeT++. Each router is associated to a processing element (PE), and routers are linked to their neighbouring routers in the mesh.
Sample NED File (MeshNoCTopology.ned)
package noc;
import inet.node.inet.INetworkNode;
import inet.node.inet.Router;
network MeshNoCTopology
{
parameters:
int gridSizeX = default(3); // Number of routers in the X direction
int gridSizeY = default(3); // Number of routers in the Y direction
@display(“bgb=600,600”); // Set the display area size
submodules:
// Define routers for the NoC
router[gridSizeX][gridSizeY]: Router {
@display(“p=100,100;i=device/router”);
}
// Define processing elements (PEs) for the NoC
processingElement[gridSizeX][gridSizeY]: INetworkNode {
@display(“p=200,200;i=device/cpu”);
}
connections allowunconnected:
// Connect each router to its processing element (PE)
for (int i = 0; i < gridSizeX; i++) {
for (int j = 0; j < gridSizeY; j++) {
processingElement[i][j].out++ –> router[i][j].in++;
router[i][j].out++ –> processingElement[i][j].in++;
}
}
// Connect routers horizontally and vertically to form a mesh topology
for (int i = 0; i < gridSizeX; i++) {
for (int j = 0; j < gridSizeY – 1; j++) {
router[i][j].out++ –> router[i][j + 1].in++;
router[i][j + 1].out++ –> router[i][j].in++;
}
}
for (int i = 0; i < gridSizeX – 1; i++) {
for (int j = 0; j < gridSizeY; j++) {
router[i][j].out++ –> router[i + 1][j].in++;
router[i + 1][j].out++ –> router[i][j].in++;
}
}
}
In this NED file:
- Routers: Each router is linked to its neighbouring routers horizontally and vertically to form a mesh topology.
- Processing Elements (PEs): Each PE is associated to its respective router.
This is a simple 2D mesh in which the nodes (routers) are associated to their neighbours in both directions, forming a grid.
- Configure Node Behavior in omnetpp.ini
In the omnetpp.ini file, we will configure routing, traffic generation, and simulation parameters for the NoC.
Sample OMNeT++ Configuration (omnetpp.ini)
network = MeshNoCTopology
sim-time-limit = 100s # Simulation duration
gridSizeX = 3 # Mesh grid size (3×3 mesh)
gridSizeY = 3
# Enable traffic between processing elements (PEs)
*.processingElement[*].hasTcp = false
*.processingElement[*].hasUdp = true
*.processingElement[*].hasIpv4 = true
# Set up routing at the routers (XY routing is commonly used in mesh NoCs)
*.router[*].routingProtocol = “XYRouting”
# Set up network traffic between processing elements
*.processingElement[0][0].app[0].typename = “UdpBasicApp”
*.processingElement[0][0].app[0].destAddresses = “processingElement[2][2]” # Send data to PE (2, 2)
*.processingElement[0][0].app[0].messageLength = 1024B
*.processingElement[0][0].app[0].sendInterval = exponential(1s)
*.processingElement[2][2].app[0].typename = “UdpSink” # Node 2,2 acts as the sink
In this configuration:
- Traffic Generation: The processing element at position (0,0) sends UDP packets to the processing element at (2,2) through the NoC.
- Routing Protocol: Routers in the NoC can use XY routing, that is usually utilized in mesh networks.
- Implement Routing in Routers (XYRouting.cc)
In a NoC, routing is necessary for packet transmission among different nodes. The XY routing algorithm routes packets first along the X direction, then in the Y direction.
Sample XY Routing Algorithm Implementation (XYRouting.cc)
#include <omnetpp.h>
using namespace omnetpp;
class XYRouting : public cSimpleModule
{
private:
int xCoord, yCoord; // Coordinates of the current router in the mesh
int gridSizeX, gridSizeY; // Mesh grid dimensions
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
void routePacket(cMessage *msg, int destX, int destY); // Route packets based on XY routing
};
Define_Module(XYRouting);
void XYRouting::initialize()
{
// Initialize the coordinates of the router in the mesh
xCoord = par(“xCoord”);
yCoord = par(“yCoord”);
gridSizeX = par(“gridSizeX”);
gridSizeY = par(“gridSizeY”);
}
void XYRouting::handleMessage(cMessage *msg)
{
// Extract destination coordinates from the message
int destX = msg->par(“destX”);
int destY = msg->par(“destY”);
// Route the packet using XY routing
routePacket(msg, destX, destY);
}
void XYRouting::routePacket(cMessage *msg, int destX, int destY)
{
if (xCoord != destX) {
// Route the packet along the X direction
if (xCoord < destX)
send(msg, “outEast”); // Send east
else
send(msg, “outWest”); // Send west
} else if (yCoord != destY) {
// Route the packet along the Y direction
if (yCoord < destY)
send(msg, “outNorth”); // Send north
else
send(msg, “outSouth”); // Send south
} else {
// Deliver the packet to the local PE (destination reached)
send(msg, “localOut”);
}
}
In this implementation:
- XY Routing: The packet is routed first along the X direction and then along the Y direction until it reaches the destination.
- Grid Coordinates: Each router has its coordinates in the 2D mesh that supports in defining the routing path.
- Run the Simulation
After set up the network and routing logic, execute the simulation. In this scenario:
- Processing element (PE) at (0,0) will send packets to the PE at (2,2) through the NoC.
- Routers in the network will forward packets based on the XY routing algorithm.
We can monitor on how the packets travel from one PE to another via the routers.
- Visualize and Analyse the Simulation
- Traffic Flow: we can envision the flow of packets among processing elements via the routers.
- Routing Performance: Evaluate the performance of the NoC based on latency, throughput, and packet delivery.
- Scalability: Measure on how the NoC act as the number of nodes (processing elements) increases.
- Enhancements to the Simulation
- Dynamic Traffic Patterns
We incorporate more dynamic traffic patterns by having multiple processing elements interact with each other, or we can replicate burst traffic environment.
*.processingElement[1][1].app[0].typename = “UdpBasicApp”
*.processingElement[1][1].app[0].destAddresses = “processingElement[0][2]”
*.processingElement[1][1].app[0].messageLength = 512B
*.processingElement[1][1].app[0].sendInterval = uniform(0.5s, 2s)
- Fault Tolerance
We need to replicate router or link failures by enabling the specific nodes or links in the course of the simulation, and see how the NoC adjust to the failure.
# Simulate a failure in a router after 50 seconds
*.router[1][1].disabled = true
- Energy Consumption
Simulate energy consumption per packet routed to measure the power efficiency of the NoC.
*.router[*].energyUsage = 0.1J # Each packet transmission consumes 0.1 Joules
- Traffic Analysis
We need to expand the simulation to evaluate the parameters such as:
- Latency: Time taken for a packet to reach its destination.
- Throughput: Total amount of data successfully routed.
- Packet Loss: How many packets are dropped or lost because of congestion or failures.
In this setup, we had illustrated about how the Network-on-Chip projects will be simulated in OMNeT+ tool and also we provide the complete explanation to understand the Network-on-Chip project. More information regarding this process will also be shared.
Connect with phdprime.com for the best Network on Chip Topology Projects simulation using the omnet++ tool. We provide services that match your project requirements. Let us handle your comparison analysis, customized just for you. We also offer guidance on packet-switched network architecture for your projects, along with great project ideas and topics based on your interests.