Docsity

Trimaran Installation and Usage: A University of Michigan EECS 583 Lecture - Prof. Scott M, Assignments of Electrical and Electronics Engineering

Partial preview of the text

Download Trimaran Installation and Usage: A University of Michigan EECS 583 Lecture - Prof. Scott M and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

EECS 583 – Lecture 5 Trimaran – Everything youwanted to know and more

University of Michigan January 23, 2002

Today and next time Y

Today

Background for HW » Using and modifying trimaran Y

Next time - 1 more lecture on control flow

Region formation – traces, superblocks, hyperblocks » Loop unrolling » Branch optimizations Y

Next topic dataflow analysis

Needed software Y

TCL/TK – v8.0p2 or higher (tclsh, wish)

Y

perl – v5.0p3 or higher

Y

gnumake (should be called make, gmake, gnumake, add links!)

Y

imake (generally part of X11)

Y

gzip/gunzip

Y

gcc

2.8.1 – officially » 2.95 should work, I have it working with 2. Y

Gnu ranlib, ar (binutils 2.9.1)

Y

tcsh – Use this or you will have to translate some stuff

Y

emacs – Real compiler writers don’t use vi or pico

Y

Graph visualizing tools

dot – http://www.research.att.com/sw/tools/graphviz » xvcg – source on course webpage (./configure, make)

Installation – Step 1 Y

Untar trimaran.tgz in an appropriate locn (ie your home dir)

Y

Enviroment variables/path – this is critical

trimaran/envrc – should have everything you need » Modify first line to define path to your trimaran » Add to your .cshrc, source trimaran/envrc y So you don’t forget

Trimaran overview C source Frontend – parsing, profiling function inlining, memory dep analysis. Also, does some backend stuff – region formation, optimization Impact Lcode Backend – analysis, optimization, scheduling register allocation, code generation Elcor Rebel Emulator – emulate VLIW semantics using C code – “compiled simulation” Simu C emulation code

Running trimaran Y

trimaran-gui

Start with this » Compile strcpy with basic blocks to test install » Lots of documentation at http://www.trimaran.org Y

tcc – gcc equivalent, sorta!

Command line way to invoke entire system – Gui calls this » “tcc –help” to get options » “tcc –bench strcpy” to run strcpy with basic blocks Y

trimaran/benchmarks

To run trimaran on a benchmark, need some setup y source, compile flags, link flags y input for profiling the code y output to check it ran properly y To add a new benchmark, follow the organization that is there » 583test1, 583test2, 583test3, 583test4 for HW

Elcor – Directory structure Y

bin, lib – the obvious stuff

Y

src – where you will spend most of your time

type make in src to build elcor Y

mdes

Machine descriptions for the target processor » hmdes2 = high level machine description – for human » lmdes2 = low-level machine description – for compiler » hc = script to convert hmdes2 to lmdes » hpl_pd_elcor_std.hmdes2 – includes other files Y

parms

Compiler switches broken into groups y DRIVER_DEFAULTS , ANALYSIS_DEFAULTS, etc. y Changing switch values X Modify ***_DEFAULTS file X -Fswitch=value on the command-line

Running Elcor manually Y

Use trimaran-gui or tcc, compile a benchmark

tcc –bench 583test Y

583test1_O directory created

impact_intermediate » elcor_intermediate y 583test1.O_tr.tgz – impact output / elcor input (bridge code) X Impact assembly (called Lcode or Mcode) X This is what you will run Elcor manually on X Untar this file ± file1.O_tr, file2.O_tr, … ± 1 file per original C source file y 583test1.O_el.tgz – elcor output X Rebel y host_layout_info.md – data structure organization stuff » simu_intermediate

Running simu manually Y

simu

Converts Rebel to C » Models VLIW architecture properly y predicates, NUAL, etc. » Allows testing the compiler is correct! Y

running simu (aka codegen)

codegen –el test1.O_el –o test1.c –Finput_format=rebel \ –Femulate_unscheduled=yes –Femulate_virtual_regs=yes y test1.c y benchmark_data_init.simu.c » Note need host_layout_info.md in the directory » gcc –I/home/mahlke/trimaran/simu/src/Emulib \ –L/home/mahlke/trimaran/simu/lib *.c –lequals –lm » ./a.out > output, diff output verses expected output

Modifying elcor Y

src/Tools – the place to start

“homegrown” version of STL y list y dlist y slist y tuples (Pair, Triple, Quad) y hast_set y hash_map y hash_table y eString y map y vector y bit_vector y matrix » Use these a lot – read .h file