BaseCPU.py (9849:603e2ed487f3) | BaseCPU.py (10037:5cac77888310) |
---|---|
1# Copyright (c) 2012 ARM Limited | 1# Copyright (c) 2012-2013 ARM Limited |
2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license 9# terms below provided that you ensure that this notice is replicated --- 61 unchanged lines hidden (view full) --- 71 from X86ISA import X86ISA 72 isa_class = X86ISA 73elif buildEnv['TARGET_ISA'] == 'mips': 74 from MipsTLB import MipsTLB 75 from MipsInterrupts import MipsInterrupts 76 from MipsISA import MipsISA 77 isa_class = MipsISA 78elif buildEnv['TARGET_ISA'] == 'arm': | 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license 9# terms below provided that you ensure that this notice is replicated --- 61 unchanged lines hidden (view full) --- 71 from X86ISA import X86ISA 72 isa_class = X86ISA 73elif buildEnv['TARGET_ISA'] == 'mips': 74 from MipsTLB import MipsTLB 75 from MipsInterrupts import MipsInterrupts 76 from MipsISA import MipsISA 77 isa_class = MipsISA 78elif buildEnv['TARGET_ISA'] == 'arm': |
79 from ArmTLB import ArmTLB | 79 from ArmTLB import ArmTLB, ArmStage2IMMU, ArmStage2DMMU |
80 from ArmInterrupts import ArmInterrupts 81 from ArmISA import ArmISA 82 isa_class = ArmISA 83elif buildEnv['TARGET_ISA'] == 'power': 84 from PowerTLB import PowerTLB 85 from PowerInterrupts import PowerInterrupts 86 from PowerISA import PowerISA 87 isa_class = PowerISA --- 78 unchanged lines hidden (view full) --- 166 dtb = Param.MipsTLB(MipsTLB(), "Data TLB") 167 itb = Param.MipsTLB(MipsTLB(), "Instruction TLB") 168 interrupts = Param.MipsInterrupts( 169 NULL, "Interrupt Controller") 170 isa = VectorParam.MipsISA([ isa_class() ], "ISA instance") 171 elif buildEnv['TARGET_ISA'] == 'arm': 172 dtb = Param.ArmTLB(ArmTLB(), "Data TLB") 173 itb = Param.ArmTLB(ArmTLB(), "Instruction TLB") | 80 from ArmInterrupts import ArmInterrupts 81 from ArmISA import ArmISA 82 isa_class = ArmISA 83elif buildEnv['TARGET_ISA'] == 'power': 84 from PowerTLB import PowerTLB 85 from PowerInterrupts import PowerInterrupts 86 from PowerISA import PowerISA 87 isa_class = PowerISA --- 78 unchanged lines hidden (view full) --- 166 dtb = Param.MipsTLB(MipsTLB(), "Data TLB") 167 itb = Param.MipsTLB(MipsTLB(), "Instruction TLB") 168 interrupts = Param.MipsInterrupts( 169 NULL, "Interrupt Controller") 170 isa = VectorParam.MipsISA([ isa_class() ], "ISA instance") 171 elif buildEnv['TARGET_ISA'] == 'arm': 172 dtb = Param.ArmTLB(ArmTLB(), "Data TLB") 173 itb = Param.ArmTLB(ArmTLB(), "Instruction TLB") |
174 istage2_mmu = Param.ArmStage2MMU(ArmStage2IMMU(), "Stage 2 trans") 175 dstage2_mmu = Param.ArmStage2MMU(ArmStage2DMMU(), "Stage 2 trans") |
|
174 interrupts = Param.ArmInterrupts( 175 NULL, "Interrupt Controller") 176 isa = VectorParam.ArmISA([ isa_class() ], "ISA instance") 177 elif buildEnv['TARGET_ISA'] == 'power': 178 UnifiedTLB = Param.Bool(True, "Is this a Unified TLB?") 179 dtb = Param.PowerTLB(PowerTLB(), "Data TLB") 180 itb = Param.PowerTLB(PowerTLB(), "Instruction TLB") 181 interrupts = Param.PowerInterrupts( --- 24 unchanged lines hidden (view full) --- 206 tracer = Param.InstTracer(default_tracer, "Instruction tracer") 207 208 icache_port = MasterPort("Instruction Port") 209 dcache_port = MasterPort("Data Port") 210 _cached_ports = ['icache_port', 'dcache_port'] 211 212 if buildEnv['TARGET_ISA'] in ['x86', 'arm']: 213 _cached_ports += ["itb.walker.port", "dtb.walker.port"] | 176 interrupts = Param.ArmInterrupts( 177 NULL, "Interrupt Controller") 178 isa = VectorParam.ArmISA([ isa_class() ], "ISA instance") 179 elif buildEnv['TARGET_ISA'] == 'power': 180 UnifiedTLB = Param.Bool(True, "Is this a Unified TLB?") 181 dtb = Param.PowerTLB(PowerTLB(), "Data TLB") 182 itb = Param.PowerTLB(PowerTLB(), "Instruction TLB") 183 interrupts = Param.PowerInterrupts( --- 24 unchanged lines hidden (view full) --- 208 tracer = Param.InstTracer(default_tracer, "Instruction tracer") 209 210 icache_port = MasterPort("Instruction Port") 211 dcache_port = MasterPort("Data Port") 212 _cached_ports = ['icache_port', 'dcache_port'] 213 214 if buildEnv['TARGET_ISA'] in ['x86', 'arm']: 215 _cached_ports += ["itb.walker.port", "dtb.walker.port"] |
216 if buildEnv['TARGET_ISA'] in ['arm']: 217 _cached_ports += ["istage2_mmu.stage2_tlb.walker.port", 218 "dstage2_mmu.stage2_tlb.walker.port"] |
|
214 215 _uncached_slave_ports = [] 216 _uncached_master_ports = [] 217 if buildEnv['TARGET_ISA'] == 'x86': 218 _uncached_slave_ports += ["interrupts.pio", "interrupts.int_slave"] 219 _uncached_master_ports += ["interrupts.int_master"] 220 221 def createInterruptController(self): --- 40 unchanged lines hidden (view full) --- 262 self.dcache = dc 263 self.icache_port = ic.cpu_side 264 self.dcache_port = dc.cpu_side 265 self._cached_ports = ['icache.mem_side', 'dcache.mem_side'] 266 if buildEnv['TARGET_ISA'] in ['x86', 'arm']: 267 if iwc and dwc: 268 self.itb_walker_cache = iwc 269 self.dtb_walker_cache = dwc | 219 220 _uncached_slave_ports = [] 221 _uncached_master_ports = [] 222 if buildEnv['TARGET_ISA'] == 'x86': 223 _uncached_slave_ports += ["interrupts.pio", "interrupts.int_slave"] 224 _uncached_master_ports += ["interrupts.int_master"] 225 226 def createInterruptController(self): --- 40 unchanged lines hidden (view full) --- 267 self.dcache = dc 268 self.icache_port = ic.cpu_side 269 self.dcache_port = dc.cpu_side 270 self._cached_ports = ['icache.mem_side', 'dcache.mem_side'] 271 if buildEnv['TARGET_ISA'] in ['x86', 'arm']: 272 if iwc and dwc: 273 self.itb_walker_cache = iwc 274 self.dtb_walker_cache = dwc |
270 self.itb.walker.port = iwc.cpu_side 271 self.dtb.walker.port = dwc.cpu_side | 275 if buildEnv['TARGET_ISA'] in ['arm']: 276 self.itb_walker_cache_bus = CoherentBus() 277 self.dtb_walker_cache_bus = CoherentBus() 278 self.itb_walker_cache_bus.master = iwc.cpu_side 279 self.dtb_walker_cache_bus.master = dwc.cpu_side 280 self.itb.walker.port = self.itb_walker_cache_bus.slave 281 self.dtb.walker.port = self.dtb_walker_cache_bus.slave 282 self.istage2_mmu.stage2_tlb.walker.port = self.itb_walker_cache_bus.slave 283 self.dstage2_mmu.stage2_tlb.walker.port = self.dtb_walker_cache_bus.slave 284 else: 285 self.itb.walker.port = iwc.cpu_side 286 self.dtb.walker.port = dwc.cpu_side |
272 self._cached_ports += ["itb_walker_cache.mem_side", \ 273 "dtb_walker_cache.mem_side"] 274 else: 275 self._cached_ports += ["itb.walker.port", "dtb.walker.port"] 276 | 287 self._cached_ports += ["itb_walker_cache.mem_side", \ 288 "dtb_walker_cache.mem_side"] 289 else: 290 self._cached_ports += ["itb.walker.port", "dtb.walker.port"] 291 |
292 if buildEnv['TARGET_ISA'] in ['arm']: 293 self._cached_ports += ["istage2_mmu.stage2_tlb.walker.port", \ 294 "dstage2_mmu.stage2_tlb.walker.port"] 295 |
|
277 # Checker doesn't need its own tlb caches because it does 278 # functional accesses only 279 if self.checker != NULL: 280 self._cached_ports += ["checker.itb.walker.port", \ 281 "checker.dtb.walker.port"] | 296 # Checker doesn't need its own tlb caches because it does 297 # functional accesses only 298 if self.checker != NULL: 299 self._cached_ports += ["checker.itb.walker.port", \ 300 "checker.dtb.walker.port"] |
301 if buildEnv['TARGET_ISA'] in ['arm']: 302 self._cached_ports += ["checker.istage2_mmu.stage2_tlb.walker.port", \ 303 "checker.dstage2_mmu.stage2_tlb.walker.port"] |
|
282 283 def addTwoLevelCacheHierarchy(self, ic, dc, l2c, iwc = None, dwc = None): 284 self.addPrivateSplitL1Caches(ic, dc, iwc, dwc) 285 # Set a width of 32 bytes (256-bits), which is four times that 286 # of the default bus. The clock of the CPU is inherited by 287 # default. 288 self.toL2Bus = CoherentBus(width = 32) 289 self.connectCachedPorts(self.toL2Bus) 290 self.l2cache = l2c 291 self.toL2Bus.master = self.l2cache.cpu_side 292 self._cached_ports = ['l2cache.mem_side'] 293 294 def createThreads(self): 295 self.isa = [ isa_class() for i in xrange(self.numThreads) ] 296 if self.checker != NULL: 297 self.checker.createThreads() 298 299 def addCheckerCpu(self): 300 pass | 304 305 def addTwoLevelCacheHierarchy(self, ic, dc, l2c, iwc = None, dwc = None): 306 self.addPrivateSplitL1Caches(ic, dc, iwc, dwc) 307 # Set a width of 32 bytes (256-bits), which is four times that 308 # of the default bus. The clock of the CPU is inherited by 309 # default. 310 self.toL2Bus = CoherentBus(width = 32) 311 self.connectCachedPorts(self.toL2Bus) 312 self.l2cache = l2c 313 self.toL2Bus.master = self.l2cache.cpu_side 314 self._cached_ports = ['l2cache.mem_side'] 315 316 def createThreads(self): 317 self.isa = [ isa_class() for i in xrange(self.numThreads) ] 318 if self.checker != NULL: 319 self.checker.createThreads() 320 321 def addCheckerCpu(self): 322 pass |