From ca79faf5089bfac0d6f7991cd5f4c8164e0fa1cf Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 30 Dec 2022 16:07:12 -1000 Subject: [PATCH] FRONTPANEL: Document best performance option for REGister content query Notes: There are two categories of REGisters in simulators: 1) Many simulators contain every interesting simh REGisters in single variables and use those variables directly throughout the simulator as needed by the system being simulated. 2) Some simulators have some of their REGisters in a single variable, but during instruction execution, the actual contents of that REGister is split into possibly multiple pieces which are assembled into the single variable when the simulator stops instruction execution and split apart again when simulation starts executing instructions again. An example of this case is the PSL on the VAX simulator. In the VAX architecture, the PSL register contains the condition code information which is a field in the PSL. For efficiency sake, while sim_instr() is executing instructions, the condition code is stored a separate variable CC. Whenever sim_instr() exits, the pieces that comprise this register are put together into the PSL variable. This allows the PSL register to be examined and/or deposited to directly from SCP as needed. The PDP11 simulator handles its PSW in a similar way breaking it into pieces during sim_instr() execution and reassembling it upon exit. Therefore, if every REGister that an application that uses the sim_frontpanel register APIs is always stored in single variables (case 1 above), then front panel access to registers can be most efficient if, at initialization time, the simulator calls the sim_set_stable_registers_state() API. Having called this API allows the internals of the frontpanel access activities to be significantly more efficient. --- sim_frontpanel.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/sim_frontpanel.h b/sim_frontpanel.h index 844c8343..38e5aecd 100644 --- a/sim_frontpanel.h +++ b/sim_frontpanel.h @@ -150,6 +150,41 @@ and The accumulated value will range from 0 thru the the sample_depth specified when calling sim_panel_set_sampling_parameters(). + + Notes: There are two categories of REGisters in simulators: + 1) Many simulators contain every interesting simh REGisters + in single variables and use those variables directly + throughout the simulator as needed by the system being + simulated. + 2) Some simulators have some of their REGisters in a single + variable, but during instruction execution, the actual + contents of that REGister is split into possibly multiple + pieces which are assembled into the single variable when + the simulator stops instruction execution and split apart + again when simulation starts executing instructions again. + An example of this case is the PSL on the VAX simulator. + In the VAX architecture, the PSL register contains the + condition code information which is a field in the PSL. + For efficiency sake, while sim_instr() is executing + instructions, the condition code is stored a separate + variable CC. Whenever sim_instr() exits, the pieces + that comprise this register are put together into the + PSL variable. This allows the PSL register to be examined + and/or deposited to directly from SCP as needed. The PDP11 + simulator handles its PSW in a similar way breaking it + into pieces during sim_instr() execution and reassembling + it upon exit. + + Therefore, if every REGister that an application that + uses the sim_frontpanel register APIs is always stored + in single variables (case 1 above), then front panel + access to registers can be most efficient if, at + initialization time, the simulator calls the + sim_set_stable_registers_state() API. + Having called this API allows the internals of the + frontpanel access activities to be significantly more + efficient. + */ int