RubySlicc_ComponentMapping.hh (8608:02d7ac5fb855) RubySlicc_ComponentMapping.hh (10005:8c2b0dc16ccd)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 44 unchanged lines hidden (view full) ---

53 {MachineType_Directory, map_Address_to_DirectoryNode(addr)};
54 return mach;
55}
56
57inline NetDest
58broadcast(MachineType type)
59{
60 NetDest dest;
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 44 unchanged lines hidden (view full) ---

53 {MachineType_Directory, map_Address_to_DirectoryNode(addr)};
54 return mach;
55}
56
57inline NetDest
58broadcast(MachineType type)
59{
60 NetDest dest;
61 for (int i = 0; i < MachineType_base_count(type); i++) {
61 for (NodeID i = 0; i < MachineType_base_count(type); i++) {
62 MachineID mach = {type, i};
63 dest.add(mach);
64 }
65 return dest;
66}
67
68inline MachineID
69mapAddressToRange(const Address & addr, MachineType type, int low_bit,
62 MachineID mach = {type, i};
63 dest.add(mach);
64 }
65 return dest;
66}
67
68inline MachineID
69mapAddressToRange(const Address & addr, MachineType type, int low_bit,
70 int num_bits)
70 int num_bits, int cluster_id = 0)
71{
72 MachineID mach = {type, 0};
73 if (num_bits == 0)
71{
72 MachineID mach = {type, 0};
73 if (num_bits == 0)
74 return mach;
75 mach.num = addr.bitSelect(low_bit, low_bit + num_bits - 1);
74 mach.num = cluster_id;
75 else
76 mach.num = addr.bitSelect(low_bit, low_bit + num_bits - 1)
77 + (1 << num_bits) * cluster_id;
76 return mach;
77}
78
79inline NodeID
80machineIDToNodeID(MachineID machID)
81{
82 return machID.num;
83}

--- 14 unchanged lines hidden ---
78 return mach;
79}
80
81inline NodeID
82machineIDToNodeID(MachineID machID)
83{
84 return machID.num;
85}

--- 14 unchanged lines hidden ---