ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Classes | Functions | Variables
get_metrics Namespace Reference

Classes

class  MemRange
 

Functions

def parseElf (inFile)
 
def printSz (sz, unknown_msg="")
 

Variables

int DEFAULT_RAM_START = 0x80000
 
int DEFAULT_RAM_SIZE = 0x80000
 
int DEFAULT_STACK_SIZE = 0x4000
 
 parser = argparse.ArgumentParser()
 
 metavar
 
 type
 
 str
 
 nargs
 
 help
 
 default
 
 args = parser.parse_args()
 
 elfFile = args.elf[0]
 
 traceFile = args.trace
 
 memIni = args.ini
 
 csvFile = args.out
 
int ramStart = DEFAULT_RAM_START
 
int ramSize = DEFAULT_RAM_SIZE
 
int stackSize = DEFAULT_STACK_SIZE
 
 config = configparser.ConfigParser()
 
 cfg = config["IntConfigurations"]
 
 staticSizes
 
 heapStart
 
 d = MemRange("Data", ramStart, heapStart)
 
 h = MemRange("Heap", heapStart, ramStart + ramSize - stackSize)
 
 s = MemRange("Stack", ramStart + ramSize - stackSize, ramStart + ramSize)
 
list mems = [d, h, s]
 
bool trace_available = False
 
 reader = csv.reader(f, skipinitialspace=True, delimiter=";")
 
 pc = int(r[1], 16)
 
 mode = r[2]
 
 adr = int(r[3], 16)
 
 sz = int(r[4], 16)
 
 romSize = sum([staticSizes[k] for k in staticSizes if k.startswith("rom_")])
 
dictionary results
 
 writer = csv.DictWriter(f, fieldnames=results.keys())
 

Function Documentation

◆ parseElf()

def get_metrics.parseElf (   inFile)

Definition at line 74 of file get_metrics.py.

References str.

◆ printSz()

def get_metrics.printSz (   sz,
  unknown_msg = "" 
)

Definition at line 121 of file get_metrics.py.

Variable Documentation

◆ adr

get_metrics.adr = int(r[3], 16)

Definition at line 197 of file get_metrics.py.

Referenced by etiss.GetModuleByAddress().

◆ args

get_metrics.args = parser.parse_args()

◆ cfg

get_metrics.cfg = config["IntConfigurations"]

Definition at line 169 of file get_metrics.py.

Referenced by ETISSINCLUDED_createPlugin(), and GCCJIT_createJIT().

◆ config

get_metrics.config = configparser.ConfigParser()

Definition at line 163 of file get_metrics.py.

Referenced by etiss::ConfigAnnouncer.ConfigAnnouncer().

◆ csvFile

get_metrics.csvFile = args.out

Definition at line 146 of file get_metrics.py.

◆ d

get_metrics.d = MemRange("Data", ramStart, heapStart)

◆ default

get_metrics.default

Definition at line 133 of file get_metrics.py.

◆ DEFAULT_RAM_SIZE

int get_metrics.DEFAULT_RAM_SIZE = 0x80000

Definition at line 27 of file get_metrics.py.

◆ DEFAULT_RAM_START

int get_metrics.DEFAULT_RAM_START = 0x80000

Definition at line 26 of file get_metrics.py.

◆ DEFAULT_STACK_SIZE

int get_metrics.DEFAULT_STACK_SIZE = 0x4000

Definition at line 28 of file get_metrics.py.

◆ elfFile

get_metrics.elfFile = args.elf[0]

Definition at line 143 of file get_metrics.py.

◆ h

get_metrics.h = MemRange("Heap", heapStart, ramStart + ramSize - stackSize)

◆ heapStart

get_metrics.heapStart

Definition at line 177 of file get_metrics.py.

◆ help

get_metrics.help

Definition at line 129 of file get_metrics.py.

◆ memIni

get_metrics.memIni = args.ini

Definition at line 145 of file get_metrics.py.

◆ mems

list get_metrics.mems = [d, h, s]

Definition at line 186 of file get_metrics.py.

◆ metavar

get_metrics.metavar

Definition at line 129 of file get_metrics.py.

◆ mode

get_metrics.mode = r[2]

◆ nargs

get_metrics.nargs

Definition at line 129 of file get_metrics.py.

◆ parser

get_metrics.parser = argparse.ArgumentParser()

Definition at line 128 of file get_metrics.py.

Referenced by etiss_initialize(), xml_parser.parse(), and xpath_parser.parse().

◆ pc

get_metrics.pc = int(r[1], 16)

Definition at line 195 of file get_metrics.py.

Referenced by access_error(), and trace().

◆ ramSize

get_metrics.ramSize = DEFAULT_RAM_SIZE

Definition at line 149 of file get_metrics.py.

◆ ramStart

get_metrics.ramStart = DEFAULT_RAM_START

Definition at line 148 of file get_metrics.py.

◆ reader

get_metrics.reader = csv.reader(f, skipinitialspace=True, delimiter=";")

Definition at line 192 of file get_metrics.py.

Referenced by etiss::SimpleMemSystem.load_elf().

◆ results

dictionary get_metrics.results
Initial value:
1 = {
2  "rom": romSize,
3  "rom_rodata": staticSizes["rom_rodata"],
4  "rom_code": staticSizes["rom_code"],
5  "rom_misc": staticSizes["rom_misc"],
6  "ram": (ramSize + s.usage() + h.usage()) if trace_available else ramSize,
7  "ram_data": staticSizes["ram_data"],
8  "ram_zdata": staticSizes["ram_zdata"],
9  "ram_stack": s.usage() if trace_available else None,
10  "ram_heap": h.usage() if trace_available else None,
11  }

Definition at line 209 of file get_metrics.py.

Referenced by etiss::instr::BitArray.permutate(), and etiss::instr::InstructionSet.resolve().

◆ romSize

get_metrics.romSize = sum([staticSizes[k] for k in staticSizes if k.startswith("rom_")])

Definition at line 206 of file get_metrics.py.

◆ s

get_metrics.s = MemRange("Stack", ramStart + ramSize - stackSize, ramStart + ramSize)

Definition at line 185 of file get_metrics.py.

◆ stackSize

int get_metrics.stackSize = DEFAULT_STACK_SIZE

Definition at line 150 of file get_metrics.py.

◆ staticSizes

get_metrics.staticSizes

Definition at line 177 of file get_metrics.py.

◆ str

get_metrics.str

◆ sz

get_metrics.sz = int(r[4], 16)

Definition at line 198 of file get_metrics.py.

Referenced by etiss_loadIniConfigs().

◆ trace_available

bool get_metrics.trace_available = False

Definition at line 188 of file get_metrics.py.

◆ traceFile

get_metrics.traceFile = args.trace

Definition at line 144 of file get_metrics.py.

◆ type

get_metrics.type

◆ writer

get_metrics.writer = csv.DictWriter(f, fieldnames=results.keys())