Move inspect into if statement for runtime

This commit is contained in:
Matt Guthaus 2019-01-30 08:42:25 -08:00
parent 1bdf4dbe4f
commit 82a09be026
4 changed files with 9 additions and 7 deletions

View File

@ -11,9 +11,9 @@ import sys
def check(check, str):
(frame, filename, line_number, function_name, lines,
index) = inspect.getouterframes(inspect.currentframe())[1]
if not check:
(frame, filename, line_number, function_name, lines,
index) = inspect.getouterframes(inspect.currentframe())[1]
sys.stderr.write("ERROR: file {0}: line {1}: {2}\n".format(
os.path.basename(filename), line_number, str))
log("ERROR: file {0}: line {1}: {2}\n".format(

View File

@ -1,4 +1,4 @@
word_size = 8
word_size = 32
num_words = 128
tech_name = "scn4m_subm"

View File

@ -1,3 +1,3 @@
#!/bin/bash
python3 -m cProfile -o profile.dat ./openram.py example_config_scn4m_subm.py -v
python3 -m cProfile -o profile.dat ./openram.py example_configs/medium_config_scn4m_subm.py -v | tee -i medium.log
echo "Run view_profile.py to view results"

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python3
import pstats
p = pstats.Stats(profile.dat)
p = pstats.Stats("profile.dat")
p.strip_dirs()
p.sort_stats(cumulative)
p.print_stats(50)
p.sort_stats("cumulative")
#p.print_stats(50)
p.print_stats()