- Timestamp:
- Feb 8, 2015, 2:42:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_python/mapping.py
r492 r497 170 170 self.signature = MAPPING_SIGNATURE 171 171 self.name = name 172 self.name = name 172 173 self.paddr_width = paddr_width 173 174 self.coherence = coherence … … 217 218 size ): # pseg length (bytes) 218 219 219 # computes c oordinates from the base address extension220 # computes cluster index and coordinates from the base address 220 221 paddr_lsb_width = self.paddr_width - self.x_width - self.y_width 221 222 cluster_xy = base >> paddr_lsb_width 222 x = cluster_xy >> (self.y_width); 223 y = cluster_xy & ((1 << self.y_width) - 1) 223 x = cluster_xy >> (self.y_width); 224 y = cluster_xy & ((1 << self.y_width) - 1) 225 cluster_id = (x * self.y_size) + y 224 226 225 227 assert (base & VPN_ANTI_MASK) == 0 … … 230 232 231 233 assert ( size == self.ram_size ) 232 233 cluster_id = (x * self.y_size) + y234 234 235 235 # add one pseg in the mapping … … 251 251 arg = 0 ): # optional argument (semantic depends on ptype) 252 252 253 # c heck cluster coordinates (obtained from the base address)253 # computes cluster index and coordinates from the base address 254 254 cluster_xy = base >> (self.paddr_width - self.x_width - self.y_width) 255 x = cluster_xy >> (self.y_width); 256 y = cluster_xy & ((1 << self.y_width) - 1) 255 x = cluster_xy >> (self.y_width); 256 y = cluster_xy & ((1 << self.y_width) - 1) 257 cluster_id = (x * self.y_size) + y 257 258 258 259 assert (x < self.x_size) and (y < self.y_size) … … 263 264 264 265 assert subtype in PERIPHSUBTYPES 265 266 cluster_id = (x * self.y_size) + y267 266 268 267 # add one pseg into mapping … … 1091 1090 if self.use_ramdisk: 1092 1091 for vseg in self.globs: 1093 if ( vseg.name == 'seg_r dk' ):1092 if ( vseg.name == 'seg_ramdisk' ): 1094 1093 seg_rdk_base = vseg.vbase 1095 1094 seg_rdk_size = vseg.vobjs[0].length
Note: See TracChangeset
for help on using the changeset viewer.