chipsalliance / rocket-chip

Rocket Chip Generator
Other
3.27k stars 1.13k forks source link

How to evaluate the performance of rocket-chip? #2202

Closed hyf6661669 closed 5 years ago

hyf6661669 commented 5 years ago

I'm using verilator to run dhrystone(https://github.com/riscv/riscv-tests/tree/master/benchmarks/dhrystone) and get the following result:

Microseconds for one run through Dhrystone: 481
Dhrystones per Second:                      2074
mcycle = 241070
minstret = 199268

My question is:

  1. How to convert the number to DMIPS/MHz? Since I don't know the frequency of verilator simulation.
  2. How to compare the performance with ARM cpus, such as cortex A5/A7/M4/M7?
  3. It is said dhrystone benchmark is out-dated and the result is influenced by the C compiler. Coremark is said to be more effective for performance evaluation. Could you tell me how to run coremark in rocket-chip?
aswaterman commented 5 years ago

The magic constant of 569 cycles per iteration corresponds to 1 DMIPS/MHz, so 481 corresponds to 1.18 DMIPS/MHz.

Rocket is known to be able to get a Dhrystone score over 1.7 DMIPS/MHz, but this depends heavily on the compiler and C library setup. For example, without an optimized strcmp implementation, performance will suffer quite a bit.

On Wed, Nov 20, 2019 at 5:16 PM HYF notifications@github.com wrote:

I'm using verilator to run dhrystone( https://github.com/riscv/riscv-tests/tree/master/benchmarks/dhrystone) and get the following result:

Microseconds for one run through Dhrystone: 481 Dhrystones per Second: 2074 mcycle = 241070 minstret = 199268

My question is:

  1. How to convert the number to DMIPS/MHz? Since I don't know the frequency of verilator simulation.
  2. How to compare the performance with ARM cpus, such as cortex A5/A7/M4/M7?
  3. It is said dhrystone benchmark is out-dated and the result is influenced by the C compiler. Coremark is said ti be more effective for performance evaluation. Could you tell me how to run coremark in rocket-chip?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chipsalliance/rocket-chip/issues/2202?email_source=notifications&email_token=AAH3XQR7AJO5R5X2YEVH6YDQUXOODA5CNFSM4JP3QRI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H26ZQKQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3XQXSKOM3BV27LKFMHIDQUXOODANCNFSM4JP3QRIQ .

hyf6661669 commented 5 years ago

If I use the same C compiler/library implementation/compile options, to compile the dhrystone benchmark and run the binary file on different risc-v cores, is it resonable to compare the performance of these cores by comparing their dhrystone results?

aswaterman commented 5 years ago

That's a reasonable thing to do if you believe that Dhrystone is a good proxy for the software you really want to run. Occasionally, it is, but more often it is not. If you care about a particular application domain, you should consider writing a microbenchmark that accurately reflects your workload.

On Wed, Nov 20, 2019 at 6:23 PM HYF notifications@github.com wrote:

The magic constant of 569 cycles per iteration corresponds to 1 DMIPS/MHz, so 481 corresponds to 1.18 DMIPS/MHz. Rocket is known to be able to get a Dhrystone score over 1.7 DMIPS/MHz, but this depends heavily on the compiler and C library setup. For example, without an optimized strcmp implementation, performance will suffer quite a bit. … <#m-3778082169550205296> On Wed, Nov 20, 2019 at 5:16 PM HYF @.***> wrote: I'm using verilator to run dhrystone( https://github.com/riscv/riscv-tests/tree/master/benchmarks/dhrystone) and get the following result: Microseconds for one run through Dhrystone: 481 Dhrystones per Second: 2074 mcycle = 241070 minstret = 199268 My question is: 1. How to convert the number to DMIPS/MHz? Since I don't know the frequency of verilator simulation. 2. How to compare the performance with ARM cpus, such as cortex A5/A7/M4/M7? 3. It is said dhrystone benchmark is out-dated and the result is influenced by the C compiler. Coremark is said ti be more effective for performance evaluation. Could you tell me how to run coremark in rocket-chip? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#2202 https://github.com/chipsalliance/rocket-chip/issues/2202?email_source=notifications&email_token=AAH3XQR7AJO5R5X2YEVH6YDQUXOODA5CNFSM4JP3QRI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H26ZQKQ>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3XQXSKOM3BV27LKFMHIDQUXOODANCNFSM4JP3QRIQ .

If I use the same C compiler/library implementation/compile options, to compile the dhrystone benchmark and run the binary file on different risc-v cores, is it resonable to compare the performance of these cores by comparing their dhrystone results?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chipsalliance/rocket-chip/issues/2202?email_source=notifications&email_token=AAH3XQWVP5VMNPFAXV7CKG3QUXWKVA5CNFSM4JP3QRI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEYOL7Y#issuecomment-556852735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3XQX54LEPS5JSAU3SUBDQUXWKVANCNFSM4JP3QRIQ .