• Rise from your gwave!

Is there any way of measuring performance for SH-2?

Discussion in 'Saturn Dev' started by mrkotfw, Jan 29, 2017.

  1. mrkotfw

    mrkotfw New Member

    It doesn't have to run on the Saturn, meaning that it could just be a small program loaded into memory.

    Is there a way to count cycles, amount of pipeline stalls? Any metrics at all?

    I can't seem to find any simulators for any SH-{2,4} variant.

    How about on hardware?
  2. antime

    antime Extra Hard Mid Boss

    Renesas' own simulator can produce a pipeline trace, but I can't remember if there's a free version available. GDB should contain a simulator, but it's not cycle-accurate. Using the J-core might work, but requires knowledge of VHDL and its simulation tools.

    The traditional way of using a timer to measure elapsed time will work, but it's a pretty coarse measurement.
  3. mrkotfw

    mrkotfw New Member

    Thanks, those are definitely good options.

    I felt a little iffy about GDB's, especially since it's not cycle accurate.

    Oh, yes. I should've mentioned that I did find Renesas' simulator. I immediately started looking for a possible Linux version and forgot about Renesas' own tool.

    I guess that's the most straight forward way... to time it. I remember I was using the SCU timers and multiplying it by the duration of a scanline to get a rough estimate. That was pretty bad.
  4. antime

    antime Extra Hard Mid Boss

    The SH7604 8-bit watchdog timer can count at f/2, so as long as you limit the measurements to smaller chunks you can get pretty accurate timings (around 1K instructions if you take the overflow flag into account). The next most granular clock is the 16-bit FRT counting at f/8.
  5. vbt

    vbt Staff Member

    what about using saturn timer functions :

  6. mrkotfw

    mrkotfw New Member

    Those macros/functions are roughly what antime mentioned.

Share This Page