En/na Paul Brook ha escrit: > On Monday 16 April 2007 15:41, Marius Monton wrote: > >>> Any benchmark/performance measurements you make inside qemu are >>> meaningless. qemu performance bears no relation whatsoever to the >>> performance characteristics of real hardware. >>> >> That's true, and I don't care about it. I'd like to get a method to >> stop/start time inside qemu in order to simulate execution of large >> pieces of hw out of qemu (look at qemu-systemc project). >> If qemu is freeze meanwhile a systemc simulation is in progress >> (simulating a HW device of system), time should be freeze also. >> In this way, execution time of a program inside qemu should appear >> shorter when using accelerator HW than only SW application. I know these >> times are not reals, but it should be enough to estimate correctness and >> execution time on real platforms. >> > > You're deluding yourself. I simply don't believe you can get any meaningful > performance measurements out of qemu. You certainly can't use it to evaluate > the correctness of time sensitive algorithms. > > qemu execution times can easily be orders of magnitude different from real > hardware. i.e. if you have two operations that take the same amount of time > to execute on real hardware, one of those operations may take many times > longer than the other inside qemu. > It's possible, but I think that roughly speaking, more code implies more time:
code (a) : for (int i = 0; i< 1000000; i++) c[i] = a[i] * b[i]; code (b) : for (int i = 0; i< 1000; i++) for(int j = 0; j < b[i]; j++) c[i] += a[i]; code (c) : for (int i = 0; i< 1000; i++) c[i] = HW_MUL(a[i], b[i]); I'm sure that code (b) will execute much longer that code (a) inside qemu (sure that different that in real platform), and I'd like to compute executing time for code (c) in some way. So, how can I trap time information/calculation inside qemu? > > If nothing else you're entirely at the mercy of the host OS process scheduler > and signal delivery. The emulated CPU may stall for an arbitrary time at any > point. > > Sure, but this can be avoided using multiple simulations and calculating arithmetic mean for execution time. > Paul > > -- Màrius Montón i Macián [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> http://cephis.uab.es <http://www.mariusmonton.name> Hardware Engineer CEPHIS Centre de Prototips i Solucions Hardware-Software Dep. Microelectrònica i Sistemes Electrònics ETSE - Universitat Autònoma de Barcelona (UAB) Phone: +34 935 813 534 Fax: +34 935 813 033 QC-2090D. ETSE. Campus UAB. 080193 Bellaterra
begin:vcard fn;quoted-printable:M=C3=A0rius Mont=C3=B3n n;quoted-printable;quoted-printable:Mont=C3=B3n;M=C3=A0rius org:CEPHIS-UAB adr:Campus de la Autonoma;;QC-2090D. ETSE;Bellaterra;Barcelona;08193;Spain email;internet:[EMAIL PROTECTED] title:System Engineer tel;work:+34935813534 url:http://cephis.uab.cat version:2.1 end:vcard