OverviewThe ROUTER utility accepts netlist descriptions of architectures and generates routing tables. Routing tables list the pathways from each device to every other device in an architecture. The ROUTER and routing tables are intended for use with the Performance Model Library models. However, the ROUTER could be used for other applications as well which need routing information.During simulations, processor models reference the routing tables to send messages through the simulated networks. Building a routing table prior to simulation is more efficient than searching for pathways at runtime, because it finds all the paths once, instead of repetitively. This ROUTER is based on a breadth-first version of the Dijkstra shortest distance search algorithm. It is efficient, rapid, and general-pupose. Several heuristical improvements have been incorporated to balance usage of network resources. The ROUTER keeps track of how many paths have used each link. When two otherwise-equivalent pathways are found between PE's, the ROUTER chooses the least used path. This avoids the pathological case of mapping all routes to only one of multiple equidistant paths. After determining the routing table, the ROUTER produces a usage summary of statistics on how well the paths were balanced. It shows what links, if any, were not used in any path; what links were used by the most paths (potential hot-spots); and the average, peak, and minimum the number of paths using a given link. For many uses and architectures, the paths found by the automatic router are sufficient without further optimization. However for special cases, the resulting routing table can be manually edited. It is produced in an easy-to-read ASCII format. The ROUTER utility is a convenient starting-point for building optimal routing tables. UsageThe ROUTER builds the routing-table by reading the netinfo file produced by the CSIM simulator when first brought up with an new architecture. The following proceedure should be used:
Port Naming ConventionOnly the ports on multi-port devices need to be entered into the routing path. (Dual-port devices go straight through by default!). By convention, multi-port port-names should end in numbers, such as p7, or io_1, etc.. The ROUTER will extract these numbers and use them in naming each port in the routing path. Ports not ending in numbers will not be entered into the routing path. See the example topology in figure 1 below.
Figure 1 - Example architecture topology.
Device Name-to-Number BindingThe netinfo file establishes a name-to-logical-ID-number for each device in your modeled system. You are free to edit the name-to-ID-number bindings in the netinfo file prior to routing and software generation.Routing Table FileThe basic routing-table is a three-dimensional array. The pathway from any source device to any destination device is recorded, -and can be retrieved-, by placing the source device in the first index of the array and the destination device in the second index. The third index is used to retrieve the port assignment for each hop along the path.ROUTE_TABLE[ source, destination, hop ] The pathway from each source device to each destination device is listed in the routing table as follows: alt src_dev - dst_dev : x1 x2 x3 x4 x5This line specifies that the sequence of ports to pass-through to send a message from src_dev to dst_dev is {x1 x2 x3 x4 x5}, where x1 x2 x3 x4 x5 are the respective port numbers on the intermediate network elements. The first item on the line, alt, is the alternate path number. The primary path from a given source to a given destination is alternate path 0. If there are multiple pathways between a given source and destination, the alternate paths can be listed with lines having distinct alternate path numbers. Alternate pathways are described further below. The entry can be interpreted as, To send a message from src_dev to dst_dev, go through port x1, then port x2, ... and finally through port x5. Advanced Router AspectsThe description above covers the basic ROUTER functions. Additional router features include:
Multiple Path RoutingThe ROUTER finds multiple alternate paths, if they exist, between each source and destination. By default, it will attempt to find as many as two paths for every source-destination pair. You can find more alternate paths by using the -alt command-line option. For example:router -alt 5 netinfofinds as many as five (5) alternate paths, if they exist. The ROUTER generates a routing table containing four (4) indices, which can be thought of conceptually as the following multi-dimensional array: ROUTE_TABLE[ alternate, source, destination, hop ] The corresponding entry in the routing table for the hops in the given path, from a source, and to a destination is listed in the routing table as: alternate src_dev - dst_dev : x1 x2 x3 x4 x5The ROUTER orders the paths found according to their distance goodness or in other words, routing-cost. For example, if the ROUTER is instructed to find the 5-best paths, and for a given source-destination pair it finds:
Variable Cost RoutingThe ROUTER utility can consider non-unity routing-costs for each link while selecting pathways. By default, link-costs are normally equal to 1.0, but can be set to any floating-point value. A path distance is computed as the sum of its link costs. The Dijkstra router finds the lowest-cost (shortest-distance) pathways.The link-costs can be specified with the CSIM GUI. The cost is specifiable individually for each direction on each link. If the cost is identical in both directions, you only need to enter one number. If it is non-symmetrical, specify the two costs with a space between them. The link costs can be used to control the routing-paths chosen. For example, you may wish to avoid a particular link from being used. Then set its routing-cost to infinity (a large number). Conversely, you may not want an intermediate link to be considered as part of the routing-cost. Then set its cost to zero. Advanced Topics - Customizing Routing TablesSometimes you may need specialized routing tables. For example, suppose you have two types of messages in your network: control and data, and you want the control messages to use different pathways from those of the data messages. One way to do this is to build and use two routing tables: one for control and one for data messages.There are various ways to create custom routing tables. One way is to edit the routing-table file directly, since it is editable. However, this is usually very tedious because routing files can be very large. Another way is to write an adhoc program that explicitly writes the routings you wish to use for your architecture. However, we will look at a more automatic method that exploits spoofing the router by editing the netinfo file. This is much more managable than editing the routing-table. Because the router is a drone that simply finds the shortest way to get from point A to point B in any arbitrary network, there are often convenient and clever ways to trick the router to produce just the routes you want. For example, in the control/data example above, if you want all control messages to flow over a VME bus, but no application data should flow over the VME bus. Then create two copies of the netinfo file. Call them: netinfo_Control and netinfo_Data. To avoid the data messages from traversing the VME bus, remove the VME bus from the netinfo_Data file and run the ROUTER on it instead of the original netinfo file. Because you have broken the VME path, the router will find alternate pathways through which to route all data-messages. A convenient way of removing unique keywords is through the grep -v command which returns all lines from a file except those that contain a specified search-string. For example, grep -v VME netinfo > netinfo_Datawould build the netinfo_Data file. Such procedures can be put into a Make.com command script for automatically configuring the routing files whenever you change your model architecture. Likewise, dedicated pathways for the control messages can be forced by cutting any critical links that would otherwise provide shorter paths through links that are to be data-dedicated. Note that not-all the data-dedicated paths need to be cut as long as there is a shorter control-path to get to the same place. The router will simply ignore any paths that are longer. Reducing Routing-Table SizeMany devices do not ever originate or absorb messages. Therefore, they do not require entries in the routing table. Only the actual source and destination devices really matter, because these will be the source/destination indices of the routing-lookup table used to get messages to-or-from these devices. Such devices are usually the Processor-Elements or Memories in a modeled system. Intermediate devices such as buses and crossbar-swicthes do not need source/destination entries, because they are neither the sources nor the destinations of messages.Devices that can not be used as a source or destination, may be classified as such, thus reducing the size of the routing file. To classify a device as a non-source, non-destination or as both a non-source and destination, insert one of the following lines in the device behavioral description following the line DEFINE_DEVICE_TYPE: <device_type> DEVICE_CLASS=(nosource); DEVICE_CLASS=(nodest); DEVICE_CLASS=(nosrcdst); Routing Waypoints and Explicit RoutesThe CSIM tools allow you to guide the paths that messages are routed in the system when multiple alternate paths exist. This is done by specifying key hardware nodes (waypoints) that the message must pass through. See Routing Waypoints for more information.Command-Line OptionsThe ROUTER supports the following command-line options:
|