Friday, November 13, 2015

Write an application to and demonstrate the change in BeagleBoard/ ARM Cortex A5 /Microprocessor /CPU frequency or square wave of programmable frequency.

Program

#!/usr/bin/python
import time
import os
st1=time.time()

os.system("cpufreq-set -f 300MHz")
os.system("cpufreq-info")
for x in range (1-1000):
        x+=x;
endt1=time.time()-st1
print "Execution time with frequency 300MHz = "
print endt1


st2=time.time()
os.system("cpufreq-set -f 600MHz")
os.system("cpufreq-info")
for x in range (1-1000):
        x+=x;

endt2=time.time()-st2
print "Executionn time with frequency 600MHz = "
print endt2

OUTPUT

root@beaglebone:~# python try_b1.py
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: generic_cpu0
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 300 us.
  hardware limits: 300 MHz - 1000 MHz
  available frequency steps: 300 MHz, 600 MHz, 800 MHz, 1000 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 300 MHz and 1000 MHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency is 300 MHz (asserted by call to hardware).
  cpufreq stats: 300 MHz:15.19%, 600 MHz:83.74%, 800 MHz:0.00%, 1000 MHz:1.06%  (29)
Execution time with frequency 300MHz = 
0.0733489990234
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: generic_cpu0
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 300 us.
  hardware limits: 300 MHz - 1000 MHz
  available frequency steps: 300 MHz, 600 MHz, 800 MHz, 1000 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 300 MHz and 1000 MHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency is 600 MHz (asserted by call to hardware).
  cpufreq stats: 300 MHz:15.20%, 600 MHz:83.74%, 800 MHz:0.00%, 1000 MHz:1.06%  (30)
Executionn time with frequency 600MHz = 
0.0592570304871
root@beaglebone:~

No comments:

Post a Comment

Perform a suitable assignment using Xen Hypervisor or equivalent open source to configure it. Give necessary GUI.

 To install kvm on Fedora:  yum install kvm  yum install virt-manager libvirt libvirt-python python-virtinst  su -c "yum install @v...