On Thu, 23 Jul 2020, Basil Hussain wrote:

One would only expect it to simulate the nominal number of cycles for all instructions.

It needs some work to make it more realistic.

This is confusing. What is the difference between 'vclks' and 'clks', and why are there two separate values?

"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.

If this sim_vclk value (which I assume one accesses with an "info variables sim_vclk" command) is a more accurate representation of how many cycles instructions are consuming, then why do ucSim timers (whose stated purpose are "measure execution time and profiling") measure a different clocks/cycles figure that can be inaccurate and not necessarily representative of the nominal behaviour of the real chip?

I have developed "timers" at the begining, and mcs51 existed that time only. Timers work well with that.

Since then, other simulators was introduced (stm8, hc08, z80, etc) most of them was writen by other programmers, not me. Unfortunately correct count of clocks was not included in those simulators. I'm sorry about that.

BTW, is there any way to get "info variables sim_vclk" to display its values in decimal? And perhaps without the second caption line of text?

Simply issue "sim_vclk" as a command:

0> sim_vclk
16
0>

You can ask different format in "expr" command:

0> expr /x sim_vclk
10
0> expr /b sim_vclk
00000000000000000000000000010000
0> expr /d sim_vclk
16
0> expr /u sim_vclk
16
0>

Daniel


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

Reply via email to