util,python: Add escape chars to lowp_dram_sweep_ploy.py
Change-Id: I783ddfe0c4c04223527a93af9f367f00544cd300 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47019 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -85,7 +85,7 @@ def main():
|
|||||||
outfile = open(texfile_s, 'w')
|
outfile = open(texfile_s, 'w')
|
||||||
|
|
||||||
startDocText(outfile)
|
startDocText(outfile)
|
||||||
outfile.write("\\begin{figure} \n\centering\n")
|
outfile.write("\\begin{figure} \n\\centering\n")
|
||||||
## Time plots for all delay values
|
## Time plots for all delay values
|
||||||
for delay in delays:
|
for delay in delays:
|
||||||
# Time
|
# Time
|
||||||
@@ -95,13 +95,13 @@ def main():
|
|||||||
outfile.write("\end{figure}\n")
|
outfile.write("\end{figure}\n")
|
||||||
|
|
||||||
# Energy plots for all delay values
|
# Energy plots for all delay values
|
||||||
outfile.write("\\begin{figure} \n\centering\n")
|
outfile.write("\\begin{figure} \n\\centering\n")
|
||||||
for delay in delays:
|
for delay in delays:
|
||||||
# Energy
|
# Energy
|
||||||
filename = plotter.stateEnergyPlotName(str(delay) + '-')
|
filename = plotter.stateEnergyPlotName(str(delay) + '-')
|
||||||
outfile.write(wrapForGraphic(filename, textwidth))
|
outfile.write(wrapForGraphic(filename, textwidth))
|
||||||
outfile.write(getCaption(delay))
|
outfile.write(getCaption(delay))
|
||||||
outfile.write("\end{figure}\n")
|
outfile.write("\\end{figure}\n")
|
||||||
|
|
||||||
endDocText(outfile)
|
endDocText(outfile)
|
||||||
outfile.close()
|
outfile.close()
|
||||||
@@ -115,31 +115,31 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
def getCaption(delay):
|
def getCaption(delay):
|
||||||
return ('\caption{' +
|
return ('\\caption{' +
|
||||||
'itt delay = ' + str(delay) +
|
'itt delay = ' + str(delay) +
|
||||||
'}\n')
|
'}\n')
|
||||||
|
|
||||||
def wrapForGraphic(filename, width='1.0'):
|
def wrapForGraphic(filename, width='1.0'):
|
||||||
# \t is tab and needs to be escaped, therefore \\textwidth
|
# \t is tab and needs to be escaped, therefore \\textwidth
|
||||||
return '\includegraphics[width=' + width + \
|
return '\\includegraphics[width=' + width + \
|
||||||
'\\textwidth]{' + filename + '}\n'
|
'\\textwidth]{' + filename + '}\n'
|
||||||
|
|
||||||
def startDocText(outfile):
|
def startDocText(outfile):
|
||||||
|
|
||||||
start_stuff = '''
|
start_stuff = """
|
||||||
\documentclass[a4paper,landscape,twocolumn]{article}
|
\\documentclass[a4paper,landscape,twocolumn]{article}
|
||||||
|
|
||||||
\usepackage{graphicx}
|
\\usepackage{graphicx}
|
||||||
\usepackage[margin=0.5cm]{geometry}
|
\\usepackage[margin=0.5cm]{geometry}
|
||||||
\\begin{document}
|
\\begin{document}
|
||||||
'''
|
"""
|
||||||
outfile.write(start_stuff)
|
outfile.write(start_stuff)
|
||||||
|
|
||||||
def endDocText(outfile):
|
def endDocText(outfile):
|
||||||
|
|
||||||
end_stuff = '''
|
end_stuff = '''
|
||||||
|
|
||||||
\end{document}
|
\\end{document}
|
||||||
|
|
||||||
'''
|
'''
|
||||||
outfile.write(end_stuff)
|
outfile.write(end_stuff)
|
||||||
|
|||||||
Reference in New Issue
Block a user