Hi Yuhang,
msg_destination is basically a bit vector for the destination(s).
0 0 0 0 - 1 0 0 0 - 0 0 0 0
This represents the 4 directories, 4 L2s and 4 L1s.
In your example, this means that the destination is L2 #3, which will be
connected to Router #3.
Now, with regard to the code, the actual code in garnet also has an additional
line:
if (msg_destination.intersectionIsNotEmpty(m_routing_table[link]))
{
}
The basic idea is that the routing table carries the bit vector of all
destinations reachable by that output link.
And the code checks the intersection with the destination vector of the flit to
see if that destination is reachable via that output port, and then sends it
out of the output link with the minimum weight. XY routing uses a weight of 1
on X, and 2 on the Y links.
If the code chose the Y link, that probably means the X traversal for that path
is over.
Garnet models contention more accurately than the simple network. The "link"
itself will not be full. You will have to check the status of the VCs at the
next router connected via that output link.
The credits for the neighbor's input port are held by the OutVCstate. You could
probably poll that when deciding which output link to choose, instead of using
the weights.
- Tushar
On Jul 12, 2013, at 12:59 PM, yuhang wrote:
> Hello all,
>
> I explored the routeCompute() function in RoutingUnit_d.cc, and printed out
> some key values in this function as follows (with the original code):
>
> command :
> build/ALPHA/gem5.opt configs/example/ruby_network_test.py --topology=Mesh
> --mesh-rows=2 --num-cpus=4 --num-dirs=4 --num-l2caches=4
> --garnet-network=fixed
>
> code:
> for (int link = 0; link < m_routing_table.size(); link++) {
> if (m_weight_table[link] >= min_weight) //min_weight = 10000
> continue;
> output_link = link;
> min_weight = m_weight_table[link];
>
> LOG:
> msg_destination: [NetDest (4) 0 0 0 0 - 1 0 0 0 - 0 0 0 0 - - ]
> m_weight_table,link0 : 1
> m_weight_table,link1 : 1
> m_weight_table,link2 : 1
> m_weight_table,link3 : 1
> m_weight_table,link4 : 2
> output link : 1 // I suppose it should choose link 0 as the output
>
> msg_destination: [NetDest (4) 0 0 0 0 - 1 0 0 0 - 0 0 0 0 - - ]
> m_weight_table,link0 : 1
> m_weight_table,link1 : 1
> m_weight_table,link2 : 1
> m_weight_table,link3 : 1
> m_weight_table,link4 : 2
> output link : 3 // the msg_destination is the same as the first one, but
> this time it chooses link 3
>
> msg_destination: [NetDest (4) 0 0 0 0 - 1 0 0 0 - 0 0 0 0 - - ]
> m_weight_table,link0 : 1
> m_weight_table,link1 : 1
> m_weight_table,link2 : 1
> m_weight_table,link3 : 2
> m_weight_table,link4 : 1
> output link : 3
> output link : 4 // I suppose this should also go to link 0
>
> msg_destination: [NetDest (4) 0 0 0 0 - 1 0 0 0 - 0 0 0 0 - - ]
> m_weight_table,link0 : 1
> m_weight_table,link1 : 1
> m_weight_table,link2 : 1
> m_weight_table,link3 : 2
> m_weight_table,link4 : 1
> output link : 3 // it chooses link 3 with weight 2. Does that mean it goes
> to Y first instead of X.
>
> Questions:
> What does the msg_destination mean?
> I got some answers here :
> http://www.mail-archive.com/[email protected]/msg05473.html
> But how does it determine the destination in the routing table?
>
> How does the log make sense? I'm very confused.
>
> Actually, I'm trying to implement adaptive routing in garnet. I have read
> PerfectSwitch.cc in simple network. It gets the output port status from void
> PerfectSwitch::addOutPort(const vector<MessageBuffer*>& out, const NetDest&
> routing_table_entry) dynamically. But in garnet network, I haven't find any
> places to get the dynamical information about how logged each link is, all
> the links are set up before the simulation start. Does anyone have some
> specific ideas to implement adaptive routing in garnet network? I have stuck
> here for some days. Any ideas are appreciated.
>
> Thanks,
> Yuhang
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users