1 2/* 3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 47 unchanged lines hidden (view full) --- 56#endif 57 58#ifdef MACHINETYPE_L3Cache 59#define MACHINETYPE_L3CACHE_ENUM MachineType_L3Cache 60#else 61#define MACHINETYPE_L3CACHE_ENUM MachineType_NUM 62#endif 63 |
64// used to determine the home directory 65// returns a value between 0 and total_directories_within_the_system 66inline 67NodeID map_Address_to_DirectoryNode(const Address& addr) 68{ 69 return DirectoryMemory::mapAddressToDirectoryVersion(addr); 70} 71 --- 4 unchanged lines hidden (view full) --- 76{ 77 MachineID mach = {MachineType_Directory, map_Address_to_DirectoryNode(addr)}; 78 return mach; 79} 80 81inline 82MachineID map_Address_to_DMA(const Address & addr) 83{ |
84 MachineID dma = {MachineType_DMA, 0}; |
85 return dma; 86} 87 |
88inline 89NetDest broadcast(MachineType type) 90{ 91 NetDest dest; 92 for (int i=0; i<MachineType_base_count(type); i++) { 93 MachineID mach = {type, i}; 94 dest.add(mach); 95 } 96 return dest; 97} 98 |
99inline 100MachineID mapAddressToRange(const Address & addr, MachineType type, int low_bit, int num_bits) 101{ 102 MachineID mach = {type, 0}; 103 if (num_bits == 0) 104 return mach; 105 mach.num = addr.bitSelect(low_bit, low_bit+num_bits-1); 106 return mach; --- 41 unchanged lines hidden --- |