Difference between revisions of "Sampling"

From gem5
Jump to: navigation, search
m (Removed Spam)
Line 33: Line 33:
  
 
Note that M5 may have to simulate for a few cycles prior to switching CPUs due to any outstanding state that may be present in the CPUs being switched out.
 
Note that M5 may have to simulate for a few cycles prior to switching CPUs due to any outstanding state that may be present in the CPUs being switched out.
 
http://alley-baggett.starsporn.info
 
http://alley-baggett.starsporn.info/map.html
 
http://angel-alison.starsporn.info
 
http://angel-alison.starsporn.info/map.html
 
http://amy-reid.starsporn.info
 
http://amy-reid.starsporn.info/map.html
 
http://alexis-amore.starsporn.info
 
http://alexis-amore.starsporn.info/map.html
 
http://amy-lee.starsporn.info
 
http://amy-lee.starsporn.info/map.html
 
http://aliya-wolf.starsporn.info
 
http://aliya-wolf.starsporn.info/map.html
 
http://anetta-key.starsporn.info
 
http://anetta-key.starsporn.info/map.html
 
http://anette-dawn.starsporn.info
 
http://anette-dawn.starsporn.info/map.html
 
http://alektra-blue.starsporn.info
 
http://alektra-blue.starsporn.info/map.html
 
http://amanda-lexx.starsporn.info
 
http://amanda-lexx.starsporn.info/map.html
 
http://aneta-buena.starsporn.info
 
http://aneta-buena.starsporn.info/map.html
 
http://allie-sin.starsporn.info
 
http://allie-sin.starsporn.info/map.html
 
http://amber-campisi.starsporn.info
 
http://amber-campisi.starsporn.info/map.html
 
http://akira-lane.starsporn.info
 
http://akira-lane.starsporn.info/map.html
 
http://adriana-sage.starsporn.info
 
http://adriana-sage.starsporn.info/map.html
 
http://allysin-chaynes.starsporn.info
 
http://allysin-chaynes.starsporn.info/map.html
 
http://angel-dark.starsporn.info
 
http://angel-dark.starsporn.info/map.html
 
http://alexa-rae.starsporn.info
 
http://alexa-rae.starsporn.info/map.html
 
http://alaura-eden.starsporn.info
 
http://alaura-eden.starsporn.info/map.html
 
http://aja-fyne.starsporn.info
 
http://aja-fyne.starsporn.info/map.html
 
http://alyssa-alps.starsporn.info
 
http://alyssa-alps.starsporn.info/map.html
 
http://amy-sue-cooper.starsporn.info
 
http://amy-sue-cooper.starsporn.info/map.html
 
http://amber-bach-lynn.starsporn.info
 
http://amber-bach-lynn.starsporn.info/map.html
 
http://amee-donavan.starsporn.info
 
http://amee-donavan.starsporn.info/map.html
 
http://alisha-klass.starsporn.info
 
http://alisha-klass.starsporn.info/map.html
 
http://alicia-rhodes.starsporn.info
 
http://alicia-rhodes.starsporn.info/map.html
 
http://amber-easton.starsporn.info
 
http://amber-easton.starsporn.info/map.html
 
http://alison-waite.starsporn.info
 
http://alison-waite.starsporn.info/map.html
 
http://amber-lynn.starsporn.info
 
http://amber-lynn.starsporn.info/map.html
 
http://amber-evans.starsporn.info
 
http://amber-evans.starsporn.info/map.html
 
http://angel-eyes.starsporn.info
 
http://angel-eyes.starsporn.info/map.html
 
http://alexis-silver.starsporn.info
 
http://alexis-silver.starsporn.info/map.html
 
http://aiko-tanaka.starsporn.info
 
http://aiko-tanaka.starsporn.info/map.html
 
http://amber-michaels.starsporn.info
 
http://amber-michaels.starsporn.info/map.html
 
http://andi-sue-irwin.starsporn.info
 
http://andi-sue-irwin.starsporn.info/map.html
 
http://alicia-alighatti.starsporn.info
 
http://alicia-alighatti.starsporn.info/map.html
 
http://addison-rose.starsporn.info
 
http://addison-rose.starsporn.info/map.html
 
http://adele-stephens.starsporn.info
 
http://adele-stephens.starsporn.info/map.html
 
http://andrea-veresova.starsporn.info
 
http://andrea-veresova.starsporn.info/map.html
 
http://angelica-sin.starsporn.info
 
http://angelica-sin.starsporn.info/map.html
 
http://aimee-sweet.starsporn.info
 
http://aimee-sweet.starsporn.info/map.html
 
http://alexandria-karlsen.starsporn.info
 
http://alexandria-karlsen.starsporn.info/map.html
 
http://angel-cassidy.starsporn.info
 
http://angel-cassidy.starsporn.info/map.html
 
http://alana-evans.starsporn.info
 
http://alana-evans.starsporn.info/map.html
 
http://alesha-oreskovich.starsporn.info
 
http://alesha-oreskovich.starsporn.info/map.html
 
http://adrianna-faust.starsporn.info
 
http://adrianna-faust.starsporn.info/map.html
 
http://adriana-malkova.starsporn.info
 
http://adriana-malkova.starsporn.info/map.html
 
http://alyssa-lovelace.starsporn.info
 
http://alyssa-lovelace.starsporn.info/map.html
 
http://amber-michaels.starsporn.info
 
http://amber-michaels.starsporn.info/map.html
 
http://andrea-hercogova.starsporn.info
 
http://andrea-hercogova.starsporn.info/map.html
 
http://alexus-winston.starsporn.info
 
http://alexus-winston.starsporn.info/map.html
 
http://alexis-malone.starsporn.info
 
http://alexis-malone.starsporn.info/map.html
 
http://aaralyn-barra.starsporn.info
 
http://aaralyn-barra.starsporn.info/map.html
 
http://amber-rain.starsporn.info
 
http://amber-rain.starsporn.info/map.html
 
http://angelina-crow.starsporn.info
 
http://angelina-crow.starsporn.info/map.html
 
http://allura-bond.starsporn.info
 
http://allura-bond.starsporn.info/map.html
 
http://alexa-weix.starsporn.info
 
http://alexa-weix.starsporn.info/map.html
 
http://angela-little.starsporn.info
 
http://angela-little.starsporn.info/map.html
 
http://amber-smith.starsporn.info
 
http://amber-smith.starsporn.info/map.html
 
http://angela-taylor.starsporn.info
 
http://angela-taylor.starsporn.info/map.html
 
http://amanda-paige.starsporn.info
 
http://amanda-paige.starsporn.info/map.html
 
http://abigail-toyne.starsporn.info
 
http://abigail-toyne.starsporn.info/map.html
 
http://ander-paige.starsporn.info
 
http://ander-paige.starsporn.info/map.html
 
http://ananda-saint-james.starsporn.info
 
http://ananda-saint-james.starsporn.info/map.html
 
http://anais-alexander.starsporn.info
 
http://anais-alexander.starsporn.info/map.html
 
http://amber-peach.starsporn.info
 
http://amber-peach.starsporn.info/map.html
 
http://alexus-king.starsporn.info
 
http://alexus-king.starsporn.info/map.html
 
http://anastasia-christ.starsporn.info
 
http://anastasia-christ.starsporn.info/map.html
 
http://andrea-mrnkova.starsporn.info
 
http://andrea-mrnkova.starsporn.info/map.html
 
http://alexandra-silk.starsporn.info
 
http://alexandra-silk.starsporn.info/map.html
 
http://angela-summers.starsporn.info
 
http://angela-summers.starsporn.info/map.html
 
http://angelica-costello.starsporn.info
 
http://angelica-costello.starsporn.info/map.html
 
http://amber-rain.starsporn.info
 
http://amber-rain.starsporn.info/map.html
 
http://andie-valentino.starsporn.info
 
http://andie-valentino.starsporn.info/map.html
 
http://anastasia-mayo.starsporn.info
 
http://anastasia-mayo.starsporn.info/map.html
 
http://amanda-duncan.starsporn.info
 
http://amanda-duncan.starsporn.info/map.html
 
http://amber-sexxam.starsporn.info
 
http://amber-sexxam.starsporn.info/map.html
 
http://angela-taulane.starsporn.info
 
http://angela-taulane.starsporn.info/map.html
 
http://alexis-taylor.starsporn.info
 
http://alexis-taylor.starsporn.info/map.html
 
http://amy-miller.starsporn.info
 
http://amy-miller.starsporn.info/map.html
 
http://amber-brooks.starsporn.info
 
http://amber-brooks.starsporn.info/map.html
 
http://alexandra-nice.starsporn.info
 
http://alexandra-nice.starsporn.info/map.html
 
http://angel-long.starsporn.info
 
http://angel-long.starsporn.info/map.html
 
http://angela-stone.starsporn.info
 
http://angela-stone.starsporn.info/map.html
 
http://alyssa-west.starsporn.info
 
http://alyssa-west.starsporn.info/map.html
 
http://alesha-bizart.starsporn.info
 
http://alesha-bizart.starsporn.info/map.html
 
http://alex-arden.starsporn.info
 
http://alex-arden.starsporn.info/map.html
 
http://aimee-tyler.starsporn.info
 
http://aimee-tyler.starsporn.info/map.html
 
http://alexa-adare.starsporn.info
 
http://alexa-adare.starsporn.info/map.html
 
http://anastasia-pierce.starsporn.info
 
http://anastasia-pierce.starsporn.info/map.html
 
http://alessia-romei.starsporn.info
 
http://alessia-romei.starsporn.info/map.html
 
http://aj-bailey.starsporn.info
 
http://aj-bailey.starsporn.info/map.html
 
http://abbey-brooks.starsporn.info
 
http://abbey-brooks.starsporn.info/map.html
 
http://amanda-white.starsporn.info
 
http://amanda-white.starsporn.info/map.html
 
http://adrianna-nicole.starsporn.info
 
http://adrianna-nicole.starsporn.info/map.html
 
http://alex-devine.starsporn.info
 
http://alex-devine.starsporn.info/map.html
 
http://angelina-croft.starsporn.info
 
http://angelina-croft.starsporn.info/map.html
 
http://alicia-angel.starsporn.info
 
http://alicia-angel.starsporn.info/map.html
 
http://allie-ray.starsporn.info
 
http://allie-ray.starsporn.info/map.html
 
http://amy-mccarthy.starsporn.info
 
http://amy-mccarthy.starsporn.info/map.html
 
http://andrea-torres.starsporn.info
 
http://andrea-torres.starsporn.info/map.html
 
http://angela-crystal.starsporn.info
 
http://angela-crystal.starsporn.info/map.html
 
http://aiden-layne.starsporn.info
 
http://aiden-layne.starsporn.info/map.html
 
http://allison-pierce-.starsporn.info
 
http://allison-pierce-.starsporn.info/map.html
 
http://alexandria-quinn.starsporn.info
 
http://alexandria-quinn.starsporn.info/map.html
 
http://analise-hayes.starsporn.info
 
http://analise-hayes.starsporn.info/map.html
 
http://aaliyah-jolie.starsporn.info
 
http://aaliyah-jolie.starsporn.info/map.html
 
http://alana-ambrose.starsporn.info
 
http://alana-ambrose.starsporn.info/map.html
 
http://amber-marie.starsporn.info
 
http://amber-marie.starsporn.info/map.html
 
http://alex-dane.starsporn.info
 
http://alex-dane.starsporn.info/map.html
 
http://amber-simpson.starsporn.info
 
http://amber-simpson.starsporn.info/map.html
 
http://alex-del-monaco.starsporn.info
 
http://alex-del-monaco.starsporn.info/map.html
 
http://andrea-mirage.starsporn.info
 
http://andrea-mirage.starsporn.info/map.html
 
http://alex-foxe.starsporn.info
 
http://alex-foxe.starsporn.info/map.html
 
http://adriana-russo.starsporn.info
 
http://adriana-russo.starsporn.info/map.html
 
http://alexa-lynn.starsporn.info
 
http://alexa-lynn.starsporn.info/map.html
 
http://andy-brown.starsporn.info
 
http://andy-brown.starsporn.info/map.html
 
http://alexxxis-tyler.starsporn.info
 
http://alexxxis-tyler.starsporn.info/map.html
 
http://alexa-may.starsporn.info
 
http://alexa-may.starsporn.info/map.html
 
http://amy-easton.starsporn.info
 
http://amy-easton.starsporn.info/map.html
 
http://amanda-rain.starsporn.info
 
http://amanda-rain.starsporn.info/map.html
 
http://alisha-lopez-.starsporn.info
 
http://alisha-lopez-.starsporn.info/map.html
 
http://angela-winter.starsporn.info
 
http://angela-winter.starsporn.info/map.html
 
http://agnes-blond.starsporn.info
 
http://agnes-blond.starsporn.info/map.html
 
http://alexis-duval.starsporn.info
 
http://alexis-duval.starsporn.info/map.html
 
http://alexia-milano.starsporn.info
 
http://alexia-milano.starsporn.info/map.html
 
http://amy-warner.starsporn.info
 
http://amy-warner.starsporn.info/map.html
 
http://ali-kat.starsporn.info
 
http://ali-kat.starsporn.info/map.html
 
http://agnese-stock.starsporn.info
 
http://agnese-stock.starsporn.info/map.html
 
http://adel-sharp.starsporn.info
 
http://adel-sharp.starsporn.info/map.html
 
http://adrienne-klass.starsporn.info
 
http://adrienne-klass.starsporn.info/map.html
 
http://angelina-adelle.starsporn.info
 
http://angelina-adelle.starsporn.info/map.html
 
http://aisha-sun.starsporn.info
 
http://aisha-sun.starsporn.info/map.html
 
http://alexis-redd.starsporn.info
 
http://alexis-redd.starsporn.info/map.html
 
http://angel-madrid.starsporn.info
 
http://angel-madrid.starsporn.info/map.html
 
http://alexxxis-tyler.starsporn.info
 
http://alexxxis-tyler.starsporn.info/map.html
 
http://amy-shine.starsporn.info
 
http://amy-shine.starsporn.info/map.html
 
http://amber-wild.starsporn.info
 
http://amber-wild.starsporn.info/map.html
 
http://angelina-hart.starsporn.info
 
http://angelina-hart.starsporn.info/map.html
 
http://ada-costa.starsporn.info
 
http://ada-costa.starsporn.info/map.html
 
 
http://andrea-lowell-pics-63476s.megadoors.org/
 
 
http://watergirl34.h.fc2.com/
 
 
http://club-penguin-cheats-63476s.plushka.org/
 
http://cheat-club-penguin-63476s.bulochka.org/
 

Revision as of 11:04, 19 February 2007

Sampling (switching between functional and detailed models) can be implemented via your Python script. In your script you can direct the simulator to switch between two sets of CPUs. To do this, in your script setup a list of tuples of (oldCPU, newCPU). If there are multiple CPUs you wish to switch simultaneously, they can all be added to that list. For example:

run_cpu1 = SimpleCPU()
switch_cpu1 = DetailedCPU(defer_registration=True)
run_cpu2 = SimpleCPU()
switch_cpu2 = FooCPU(defer_registration=True)
switch_cpu_list = [(run_cpu1,switch_cpu1),(run_cpu2,switch_cpu2)]

Note that the CPU that does not immediately run should have the parameter "defer_registration=True". This keeps those CPUs from adding themselves to the list of CPUs to run; they will instead get added when you switch them in.

In order for M5 to instantiate all of your CPUs, you must make the CPUs that will be switched in a child of something that is in the configuration hierarchy. Unfortunately at the moment some configuration limitations force the switch CPU to be placed outside of the System object. The Root object is the next most convenient place to place the CPU, as shown below:

root1 = Root()
root1.system = System(cpu = run_cpu1)
root1.switch_cpu = switch_cpu1
root2 = Root()
root2.system = System(cpu = run_cpu2)
root2.switch_cpu = switch_cpu2

This will add the swtich CPUs as children of each root object. Note that switch_cpu is not an actual parameter for Root, but is just an assignment to indicate that it has a child, switch_cpu.

After the systems and the CPU list is setup, your script can direct M5 to switch the CPUs at the appropriate cycle. This is achieved by calling switchCpus(cpus_list). For example, assuming the code above, and a system that is setup running run_cpu1 and run_cpu2 initially:

m5.simulate(500)  # simulate for 500 cycles
m5.switchCpus(switch_cpu_list)
m5.simulate(500)  # simulate another 500 cycles after switching

Note that M5 may have to simulate for a few cycles prior to switching CPUs due to any outstanding state that may be present in the CPUs being switched out.