tum-ei-eda / etiss

Extendable Translating Instruction Set Simulator
https://tum-ei-eda.github.io/etiss/
Other
29 stars 36 forks source link

Improve get_metrics.py #73

Closed PhilippvK closed 3 years ago

PhilippvK commented 3 years ago

I have implemented what was beeing discussed in #68 in addition with further smaller improvements to the get_metrics.py script.

I had to add the argparse package as a requirement to be able to use optional command line parameters. This should hopefully not break too many existing setups...

For parsing the INI containing the memory layout, I have used the following as a reference. Can I expect that there are always 2 memory segments, the first being for ROM and the other one for RAM? If not, then I am not sure how to find out which one is which...

$ cat memsegs.ini
# [IntConfigurations]
# simple_mem_system.memseg_origin_00=0x0
# simple_mem_system.memseg_length_00=0x100000
# simple_mem_system.memseg_origin_01=0x100000
# simple_mem_system.memseg_length_01=0x5000000 

BTW: heapStart is unfortunately still relying on the symbol table.

PhilippvK commented 3 years ago

@rafzi It would be great if you could test this together with the corresponding MR in the ml_on_mcu repository before merging.

Also feel free to suggest any other approaches @wysiwyng.

wysiwyng commented 3 years ago

A quick thought on the memory segments: Currently there should only be 2 of them for most (if not all) applications, but this might not be the case for some special project. You could use the ELF entry point and check in which segment this falls and assume this is ROM. With our linker scripts at least the stack begin is also defined as a symbol in the ELF file, whatever this segment falls into is most likely RAM.

Also like @rafzi said, the access permissions give hints on the type of memory, these are also best read directly from the ELF file. simple_mem_system already supports specifying access attributes for memory segments, see #61. If they are not specified in the .ini files simple_mem_system reads them from the ELF file.

PhilippvK commented 3 years ago

@rafzi I will resolve your comments later, thank you for the review.

@wysiwyng You have mentioned some good points! Would you mind if I implement the determination of the memory segments in a later PR? I would really like to implement it but currently I can not invest too much time in contributing to ETISS as I have to finish by master thesis first.