-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Frequency Latency Estimation via CPU Clock Modulation (Duty Cycle Modulation) #1
Open
weiwangudel
wants to merge
4
commits into
LittleWhite-tb:master
Choose a base branch
from
weiwangudel:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
ftalat_dcm : Frequency Transition Latency Estimator for Clock Modulation | ||
DCM Point of Contact: Wei Wang <[email protected]>, Allan Porterfield <[email protected]>, John Cavazos <[email protected]>, Sridutt Bhalachandra <[email protected]> | ||
|
||
ftalat allows you to determine the time taken by your CPU to switch from one frequency to another one. | ||
Here, the frequency change is supported by *software clock modulation* (see Intel System Programmers Guide) | ||
|
||
#Prerequisites | ||
1) The machine must be an Intel processor, better chance of working with SandyBridge and Ivybridge. | ||
2) In general, non-extended software controlled clock modulation supports eight frequencies, with an interval of 12.5% and | ||
extended version supports sixteen frequencies, with an interval of 6.25%. Extension to software controlled clock modulation is supported only if CPUID.06H:EAX[Bit 5] = 1. Also the CPU must have ACPI feature to support both extended and non-extended software controlled clock modulation, i.e. CPUID.01H:EDX[Bit 22]=1. | ||
3) If any of the CPUID output is not 1, code modification is required. | ||
|
||
|
||
# Compilation | ||
``` | ||
make dcm | ||
``` | ||
or | ||
``` | ||
make trace | ||
``` | ||
to compile a second version of ftalat writing latency for each run of the kernel. A graph of this data can be displayed using the GNUPlot script `traceViewer.gnuplot` | ||
|
||
# Usage | ||
``` | ||
./ftalat_dcm startFreq targetFreq | ||
where startFreq is the frequency at the beginning of the test and targetFreq the frequency to switch to | ||
The program will output the time taken by your CPU to swtich from startFreq to targetFreq | ||
ftalat_dcm must be run with ***root*** to set clock modulation (write to a msr) | ||
``` | ||
|
||
The script `ftalat_dcm_runner.sh` allows you to run the test for all frequencies couple (in the realm of software clock modulation) for your CPU. The script will write the output in a folder `Results` | ||
From the files written in the `Results` folder, you can generate graphs. To do this, you need to use the python scripts from the `script` folder. | ||
``` | ||
./extract.py data_folder output_folder | ||
data_folder should be 'Results' folder | ||
output_folder is a new folder (which has to be created before) where the proceed files will be stored. | ||
``` | ||
|
||
Then, you have to run | ||
``` | ||
./generateGraph_DCM.py input_folder file | ||
where input_folder is the folder where the files generated by extract.py are located | ||
and file, the name of the file (without extension) for graph output (PDF) and latency table (a GNUPlot script is also generated) | ||
``` | ||
|
||
# Depencies | ||
You must have python (2.7) and GNUPlot installed | ||
|
||
# Licence | ||
The program is licenced under GPLv3. Please read [COPYRIGHT](https://github.com/LittleWhite-tb/ftalat/blob/master/COPYRIGHT) file for more information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
# ftalat - Frequency Transition Latency Estimator | ||
# Copyright (C) 2013 Universite de Versailles | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
# Script to bench all the frequencies couple with ftalat | ||
|
||
OUTPUT_FILE=results | ||
OUTPUT_EXT=.txt | ||
OUTPUT_DIR=Results | ||
FREQUENCIES=`seq 1 1 16` | ||
ITER=31 | ||
|
||
mkdir -p $OUTPUT_DIR | ||
|
||
for startFreq in ${FREQUENCIES} | ||
do | ||
# Avoid turbo as starting seq | ||
for testFreq in ${FREQUENCIES} | ||
do | ||
if [ $startFreq -eq $testFreq ] | ||
then | ||
echo "Skip $startFreq -> $testFreq (same frequency)" | ||
continue | ||
fi | ||
|
||
echo "$startFreq -> $testFreq" | ||
# Test if the result file already exists | ||
if ( ! (test -e "${OUTPUT_DIR}/${OUTPUT_FILE}"_"${startFreq}"-"${testFreq}${OUTPUT_EXT}" ) ) | ||
then | ||
for i in `seq $ITER` | ||
do | ||
./ftalat $startFreq $testFreq >> ${OUTPUT_DIR}/${OUTPUT_FILE}"_"${startFreq}"-"${testFreq}${OUTPUT_EXT} | ||
echo "############################" >> ${OUTPUT_DIR}/${OUTPUT_FILE}"_"${startFreq}"-"${testFreq}${OUTPUT_EXT} | ||
done | ||
fi | ||
setDutyCycle-16.exe | ||
done | ||
done |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see from where this is coming.