1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

Fixed throttling in several ways:

- Sleep for the observed clock tick size while throttling
                        - Recompute the throttling wait once every 10 seconds
                          to account for varying instruction mixes during
                          different phases of a simulator execution or to
                          accommodate the presence of other load on the host
                          system.
                        - Each of the pre-existing throttling modes (Kcps,
                          Mcps, and %) all compute the appropriate throttling
                          interval dynamically.  These dynamic computations
                          assume that 100% of the host CPU is dedicated to
                          the current simulator during this computation.
                          This assumption may not always be true and under
                          certain conditions may never provide a way to
                          correctly determine the appropriate throttling
                          wait.  An additional throttling mode has been added
                          which allows the simulator operator to explicitly
                          state the desired throttling wait parameters.
                          These are specified by:
                                 SET THROT insts/delay
                          where 'insts' is the number of instructions to
                          execute before sleeping for 'delay' milliseconds.
This commit is contained in:
Mark Pizzolato
2011-10-25 03:52:24 -07:00
parent 9f1f586714
commit c38eacd0c8
3 changed files with 77 additions and 19 deletions

View File

@@ -55,9 +55,10 @@ int clock_gettime(int clock_id, struct timespec *tp);
#define SIM_THROT_WMIN 100 /* min wait */
#define SIM_THROT_MSMIN 10 /* min for measurement */
#define SIM_THROT_NONE 0 /* throttle parameters */
#define SIM_THROT_MCYC 1
#define SIM_THROT_KCYC 2
#define SIM_THROT_PCT 3
#define SIM_THROT_MCYC 1 /* MegaCycles Per Sec */
#define SIM_THROT_KCYC 2 /* KiloCycles Per Sec */
#define SIM_THROT_PCT 3 /* Max Percent of host CPU */
#define SIM_THROT_SPC 4 /* Specific periodic Delay */
t_bool sim_timer_init (void);
void sim_timespec_diff (struct timespec *diff, struct timespec *min, struct timespec *sub);