It needs some work to make it more realistic.

Yes. I was looking at the source code just now (stm8.src/stm8.cc and stm8.src/inst.cc) and it seems clock cycles are incremented by use of a tick() function call. All instructions appear to be assumed as taking 1 cycle by default, with additions on a case-by-case basis. But I could only find four other instances of calls to tick(): for code that handles JRxx, MUL and LDW instructions. This is certainly not covering all the multi-cycle instructions STM8 has.

"clks" would be count of clock periods, and "vclks" is not real clock, so "v" means "virtual" here, and it counts operations. I have introduced it because I realized that correct clock counting is hard to implement (esp. in stm8) and this "number of operataions" info could be usefull (for something), and was more easy to implement.

So if I understand correctly, vclks will be a more accurate representation of 'work done', but not comparable to clock cycles nominally taken by execution of instructions. So is useful for comparison purposes between code running on the simulator, but not much else.

Simply issue "sim_vclk" as a command:

Ah, that is very useful, thank you. I did not realise such variables were available to use directly in console expressions.

Regards,
Basil


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to