The anynet option in BookSim 2.0 allows for the setup of arbitrary network topologies using a listing file. This file describes the connections between modules (routers and nodes) in the network.
Listing File Syntax
Each line in the listing file describes the connections for a specific module.
Router Connections:
A line starting with router followed by an ID defines its neighbors. For example:
router 0 node 0 node 1 node 2 router 1
This indicates that router 0 is connected to node 0, node 1, node 2, and router 1.
Implicit Connectivity:
Connections are bidirectional. If router 0 is connected to router 1, you do not need to explicitly list router 0 in the connection list for router 1.
Constraints:
- Router and node IDs must be unique.
- A node can only be connected to a single router.
Link Weights (Latency)
The updated anynet parser supports link weights to specify channel latency. The format is:
[Module ID] [Module ID] [Weight] ...
Example:
Router 0 Router 1 10 Router 2 5
This means Router 0 is connected to Router 1 with a 10-cycle channel and to Router 2 with a 5-cycle channel. If a weight is not provided, it defaults to a single-cycle channel.
Note on Directionality:
Channel latency specifications between routers are not bi-directional. In the example Router 0 Router 1 10, the channel from Router 1 back to Router 0 remains a single-cycle channel unless explicitly specified in the line describing Router 1's connections.
Routing Behavior
By default, after parsing the listing file, BookSim builds a routing table in each router describing the minimal path between any two nodes. This results in no path diversity (only a single path exists between any two nodes). To enable path diversity, you must implement a custom routing function.