diff -r 1fab1f8509cb -r 60739171853b configs/common/Options.py --- a/configs/common/Options.py Wed Mar 16 14:03:30 2016 +0000 +++ b/configs/common/Options.py Wed Mar 16 14:05:16 2016 +0000 @@ -293,6 +293,8 @@ parser.add_option("--enable-context-switch-stats-dump", \ action="store_true", help="Enable stats dump at context "\ "switches and dump tasks file (required for Streamline)") + parser.add_option("--pmu", action="store_true", + help="Enable PMU instruction support") # Benchmark options parser.add_option("--dual", action="store_true", diff -r 1fab1f8509cb -r 60739171853b configs/example/fs.py --- a/configs/example/fs.py Wed Mar 16 14:03:30 2016 +0000 +++ b/configs/example/fs.py Wed Mar 16 14:05:16 2016 +0000 @@ -144,6 +144,18 @@ if is_kvm_cpu(TestCPUClass) or is_kvm_cpu(FutureClass): test_sys.vm = KvmVM() + if options.pmu: + if buildEnv['TARGET_ISA'] == 'arm': + for (i, cpu) in enumerate(test_sys.cpu): + #print "Enabling events for ArmPMU on cpu.isa[{}]".format(i) + cpu.isa[0].pmu.addArchEvents( + cpu=cpu, dtb=cpu.dtb, itb=cpu.itb, + icache=getattr(cpu, "il1_cache", None), + dcache=getattr(cpu, "dl1_cache", None), + l2cache=getattr(cpu, "l2_cache", None)) + else: + fatal("PMU not supported on %s target.", buildEnv['TARGET_ISA']) + if options.ruby: # Check for timing mode because ruby does not support atomic accesses if not (options.cpu_type == "detailed" or options.cpu_type == "timing"): diff -r 1fab1f8509cb -r 60739171853b src/arch/arm/ArmISA.py --- a/src/arch/arm/ArmISA.py Wed Mar 16 14:03:30 2016 +0000 +++ b/src/arch/arm/ArmISA.py Wed Mar 16 14:05:16 2016 +0000 @@ -52,7 +52,7 @@ system = Param.System(Parent.any, "System this ISA object belongs to") - pmu = Param.ArmPMU(NULL, "Performance Monitoring Unit") + pmu = Param.ArmPMU(ArmPMU(), "Performance Monitoring Unit") decoderFlavour = Param.DecoderFlavour('Generic', "Decoder flavour specification") midr = Param.UInt32(0x410fc0f0, "MIDR value")