Configuration: Fix example script to only create one L2 if --l2cache and -nX are...
authorAli Saidi <saidi@eecs.umich.edu>
Wed, 5 Sep 2007 18:57:50 +0000 (14:57 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Wed, 5 Sep 2007 18:57:50 +0000 (14:57 -0400)
Patch submitted by: Jonas Diemer [diemer (a) ida.ing.tu-bs.de]

--HG--
extra : convert_revision : 1dfc548d2bc33d622d829bbf385f4bf9700711cd

configs/example/se.py

index 639bcd7c6ffdd2e071a7d26cf722e22b3f4583ef..b4b50a0133580d79d3a6503d149e683eec4017bf 100644 (file)
@@ -100,15 +100,17 @@ system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
 
 system.physmem.port = system.membus.port
 
+if options.l2cache:
+    system.l2 = L2Cache(size='2MB')
+    system.tol2bus = Bus()
+    system.l2.cpu_side = system.tol2bus.port
+    system.l2.mem_side = system.membus.port
+
 for i in xrange(np):
     if options.caches:
         system.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'),
                                               L1Cache(size = '64kB'))
     if options.l2cache:
-        system.l2 = L2Cache(size='2MB')
-        system.tol2bus = Bus()
-        system.l2.cpu_side = system.tol2bus.port
-        system.l2.mem_side = system.membus.port
         system.cpu[i].connectMemPorts(system.tol2bus)
     else:
         system.cpu[i].connectMemPorts(system.membus)