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

mrkotfw

Mid Boss
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?
 
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.
 
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.
 
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.
 
what about using saturn timer functions :

TIM_FRT_INIT(TIM_CKS_32);
TIM_FRT_SET_16(0);
TIM_FRT_CNT_TO_MCR(TIM_FRT_GET_16());
 
Back
Top