Summer Project – Day 3 to 5

Leave a comment

6th to 8th of January

Day 3 – 6th of January

Freed up my Windows 7 partition, by copying files over to the other one, and installing Win7 into a VHD (virtual hard drive image), and then I installed Ubuntu 9.10 AMD64 from DVD. Then proceeded to install the required packages on the machine to build qemu-async-llvm. I wrote this entry about a week or two after doing it so I am not sure what i did do. but most my time was installing Ubuntu then installing the packages again and copying over the source and trying to compile.

Day 4 – 7th of January

Entries for this day were not fully kept.

Upon searching for something in LLVM on Google, I found a paste-bin posting, which matched the output from the Makefile for this project, it was missing udis86 libraries, I then tracked the submitter of the post since he had attached his user name to it, and found him on IRC (Instant Relay Chat), started talking to him about it and he mentioned he was trying to get it to work with LLVM 2.6 which is what I had been using, he (Joel) was able to get me in contact with Andrew, and we all got talking about it. Andrew sent me the binary for the sjeng benchmark, using LLVM 2.6 this crashes however using LLVM 2.5 it does not. To save time mucking around fixing the project to work with the new version, we decided it was best to just use the old LLVM 2.5 since its still accurate and there should not be any major performance increases from using the newer version. Andrew also sent his source code notes which detail the executing path as well as where some things are located in QEMU and the most useful piece which is his diary that he kept and detailed his progress in. The diary is easier to understand then the thesis and adds extra information about the problems he ran into and how he overcome them. We also had a brief discussion on what I was currently working on and what my direction was at this point.

Day 5 – 8th of January

No entries for this day were not kept. This ends Week 1 of the project.

Advertisements

Summer Project – Day 2

Leave a comment

5th of January
Still unable to get it to run, I met with Brad (my supervisor) before the meeting with ASTC was scheduled and inform him about the problem I had. The problem being the lab machines were 32-bit so was the Linux on my laptop and that qemu-arm required super user access. He problem found a 64-bit quad core, that postgraduate student was using, in their research and requested that I have access, and also as such, access to to the honours labs. Brad and myself, went and meet with developers at ASTC at there meeting room. They discussed their ideas onto what my project could entail. It was decided that continuing on with Andrew’s work, would be most beneficial, since there is still plenty of ideas to expand on and research. and using it as a base to expand on is the logical idea, and would have been a waste of the implementation had it not been used. There where four main ideas and points of interest that they were most interest in looking into.

  • Instruction Set Expansion
  • Statistics/Comparisons
  • Off-line Translation
  • Translation Block Chaining

Instruction Set Expansion

The simplest and basic idea for something to look into, is the result for implementing a couple of more instructions to see if additional any significant performance can be squeezed out by doing the next five to ten percent of instructions.

Statistics

Run a series of tests to compare the efficiently and speed of different software. This would also be beneficial for finding the areas where some programs do additional things to get better performance.

Off-line Translation

This idea is apparently where StimulARM is strongest, the idea, is you take the translated blocks and cache/store them while the program is off-line, so when you rerun the program it can load it back in and run again. The ideal use case for this is for development, if the related blocks are indexed by a kind of checksum based on the original arm instructions, then if you change a line in a program and recompile, the code generated should be the same for all but that little part you changed, this the next time you run it would be faster. I am not sure if there was also the suggestion of optimizing off-line, I believe it was hinted at but not really discussed. Where the idea is you run the optimization passes while the program or library is not running.

Translation Block Chaining

This is the big idea and most appealing, being able to collect up blocks up blocks together so you can build a larger block out of smaller ones, then send the whole thing to the optimizer. The reason for this is the more code the optimizer can look the more informed it is to make better improvements to code.

Summer Project – Day 1

Leave a comment

Week 1

Arrived in at University by 9 am, checked email and to see if Brad was in yet, which he did not come in until just after 10. At this stage the only knowledge about the project I had was the description from the page, and7 what was mentioned in the email correspondence, as well as the thesis paper, Andrew had published, about it. I had read parts of the paper, a couple of weeks prior, but did not have access to the source for the project, so parts of it did not make a whole lot of sense, due to my limited understanding of prior knowledge and lack of in depth reading, on the subject matter. I met with Brad, who went over what would be happening, and forwarded on the appropriate information about access the source for the project.

Source Acquisition

Spend quite some time getting the source, since it was hosted using git, and the lab machines do not have git tools installed, since subversion is used for AutoMark system. However I had previously compiled git for the lab machines, however could not use since the project was hosted over http, which git requires libcurl which I did not compile in, and attempted to recompile but learned the reason it did not just do it to begin with was the lab machines lack the libcurl development headers and libraries. Instead, I checked out the source onto my laptop, had a slight problem getting git to work with the proxy but eventually had the tree. Ran into a minor problem, I checked out the tree on Windows and git was configured to auto replace line ending with CRLF, which when I copied the tree to the lab machines, made the shell scripts break, since they do not like the CRs, so checked it out again this time in a virtualized Linux and copied across. Next came the compiling.

Compiling

The project required LLVM and udis86. After finally seeing the configure, actually starting with out an error due to the CR, thought this was it, but was stopped short, qemu required zlib development packages and a few others, such as SDL, I will try to document all the other dependencies at a later time, and elsewhere. I was using LLVM 2.6 so I had to change the declarations of a function that Andrew found was missing from the 2.5 API but actually existed. Next was the linking I changed over so it used the 2.6 libraries.

Summer Project Prologue

Leave a comment

During the Summer of 2010, I was successfully in getting a research scholarship to work on a research and development project known as qemu-async-llvm. The project looks at extending QEMU ability to translate from one architecture to another. (target to the host), by translating the input code to LLVM, in an effort to improve the runtime. Terms:

  • target – the target architecture that we wish to run code for
  • host – the machine that emulator code is running on (AMD64/x86_64)
  • x86_64 – the company agnostic name for AMD64.

Quick overview, LLVM is a compiler framework, QEMU is an architecture simulator. For this project the source architecture was ARM and the target was x86_64. The project is based on the work done by honours student the the University of Adelaide the year before, who put in place most the ground work and integration. My goal was to look at ways on extending on it to improve the runtime of some benchmarks. I will say this in advance the following may be confusing and may not always be exactly step by step as I was more interested in just coding rather then take a break every 5 minute to write down what I was doing.

 

This project is a 6 week long adventure, and I will do my best to document every day of it. I will try my best to write it in a way such that it can be understood by others.

Edit: I have not re-read all entries in its entirety so there is no guarantee on any of it being coherent.

Newer Entries