davidepatti / noxim

Network on Chip Simulator
218 stars 118 forks source link

routing TABLE_BASED error #124

Closed frogxface closed 2 years ago

frogxface commented 3 years ago

I'm having some problems trying to use the routing table. First I learned from issue #64 and GlobaRoutingTable.cpp that the format of the routing table is

_%node_id in_src in_dst dst_id out_src outdst

node_id is the id of the current node in_src and in_dst are the ids of the input links dst_id is the id of the target node out_src and out_dst are the ids of the output links

To try to use the routing table, I first changed the traffic of the network to TRAFFIC_TABLE_BASED,the traffic table file is 0 5 In a 4x4 mesh, only packets are transmitted from node 0 to node 5. It can run successfully. Then the routing of the network is changed to TABLE_BASED and the routing table file is

0 0->0 5 0->4
4 0->4 5 4->5

After node 0 gets H0 Filt, the next cycle sends an error reporting.

1083 NoC.Tile[00][00]_(#0).Router::rxProcess() --> Filt (H0, 0->5 VC 0) collected from Input[4][0]
1084 Routing_TABLE_BASED::route() --> dir:4, (0,0) --> (1,1)
0->5
noxim: ... /src/routingAlgorithms/Routing_TABLE_BASED.cpp:28: virtual std::vector<int> Routing_TABLE_BASED::route(Router*, const RouteData&): Assertion 'ao.size() > 0' failed.

It looks like the file failed to be read or no available output port was found. What is going on here?

frogxface commented 3 years ago

My problem was solved, it was a problem with the routing table format. It was reporting the error because the routing table file was not being read correctly, the relevant code referenced is in GlobalRoutingTable.cpp at line 84. I changed the previous routing table file to start each line with ' ' and end with ','. Also changed the variable _COLUMNAOC (defined in GlobalRoutingTable.h) from 22 to 10. The routing table after the change is shown below.

 0 0->0 5 0->4,
 4 0->4 5 4->5,

This means that from Tile 1 goes through Tile 4 to Tile 5. If you add another path, for example, through Tile 1, the routing table will look like this.

 0 0->0 5 0->4,0->1,
 1 0->1 5 1->5, 
 4 0->4 5 4->5.