Commit graph

63 commits

Author SHA1 Message Date
Mark Pizzolato
92b1efe50f DISK: Clarify minor changes to sim_disk API in the documentation 2022-02-10 07:10:08 -08:00
Mark Pizzolato
54eda7a050 SCP: Extend BITFIELDS to allow alternate descriptions for same fields 2022-02-04 07:56:15 -08:00
Mark Pizzolato
a1785ac1d0 SCP: Add optional VM routine that is invoked on specific REGister updates
The new REG_DEPOSIT register flag bit indicates that updates to a
REGister with this flag specified will invoke the sim_vm_reg_update
routine after the data has been updated.
2021-03-02 05:35:04 -08:00
Mark Pizzolato
80abfe0412 doc: Update "Writing a Simulator" to describe details about sim_interval 2020-11-01 10:40:26 -08:00
Mark Pizzolato
ae825c9afb All: Declare sim_stop_messages as an array SCPE_BASE long
This avoids a potential invalid pointer dereference when formatting
the return value from sim_instr() if it is < SCPE_BASE but greater
than the previously defined static array size.sizeof

Update simh.doc to reflect this generic change.
2020-09-02 15:56:07 -07:00
Mark Pizzolato
f519513f50 SCP, HP2100, HP3000, I650: Move one time initialization activities to cpu_reset
The paradigm of using a "weak" linker reference to find what was
previously the vm_init_routine() doesn't work reliably on all compile
environments supported by the simulators.  This has been reported
in #794 and it came up again in #862.  This change assures that
it will not come up again AND it reliably solves the problem with
Visual Studio compilers (and linker) that randomly chooses whether
to have the desired effect or not.

Of the 82 simulators which are currently part of simh, only these
three used the sim_vm_init() interface, so removing it had relatively
minor impact.
2020-05-26 06:25:01 -07:00
Mark Pizzolato
73df9b1c4e PDP10, PDP11, Massbus VAXen, DISK: Rework PDP10 use of sim_disk
- Make all PDP11, VAX RP and RQ devices autosizing behave similarly
- Generalize the attach help to be specific to the device/system being
   attached
- Remove the sim_disk_pdp10_* calls which weren't correct or needed
   since sim_disk_attach_ex provides sector size which is used correctly
2020-04-03 17:32:14 -07:00
Mark Pizzolato
1c589030ae TIMER: Provide a means for VM to indicate its expected calibration rate
As reported and discussed in #817

This allows RUNLIMIT to provide useful results on fast or slow host systems.
2020-03-23 07:48:45 -07:00
Mark Pizzolato
938aa58f3a SCP: Provide ways for VM to specify sim_interval adjustment and step units
This affects the output of some SCP commands (including help).  The
results are cosmetic, but allows the simulator to provide correct descriptive
information.
2020-03-07 10:13:18 -08:00
Mark Pizzolato
b76fd3ed44 SCP: Preparing for dynamic testing of simulator REGister definitions at startup 2020-03-06 15:28:52 -08:00
Mark Pizzolato
8a858c181d SCP: Clean up WEAK definition and rework deprecated references to sim_vm_init
As discussed in #794
2020-01-29 12:30:25 -08:00
Mark Pizzolato
5213e1125d SCP: Add support to identify a simulator specific release version
Included from Dave Bryan's V3.11 extensions
2019-12-28 12:34:06 -08:00
Mark Pizzolato
73a41c4bc7 SCP: Auto detect WRU being entered for simulators without a console device 2019-12-11 12:25:18 -08:00
Mark Pizzolato
da3f851d70 TIMER: Add minimal tick based calibration APIs. 2019-06-08 13:55:06 -07:00
Mark Pizzolato
f75f28aa21 TIMER: Add mechanism to pre-calibrate the instruction execution rate 2019-05-28 23:56:58 -07:00
Mark Pizzolato
48db10994d TIMER: Calibrated clock fixes
- Properly handle clock transitions when control flows back and forth
  between instruction execution and simh commands.
- Changed Internal Timer from 10 Hz to the MAX(100Hz, HostOSClockHz)
- Changed default idle calibration percent to 50%
- Make sure that error cases (backwards and gap too big) properly advance
  the real time while avoiding calibration.
- Fix selection of the calibrated clock.
- Fix logic that sets the idle percentage that controls calibration.
2019-05-28 22:47:06 -07:00
Mark Pizzolato
6b3bff56b3 DISK: Add support to properly autosize fixed sized disk from a set of choices
As discussed in #704
2019-05-21 15:38:39 -07:00
Mark Pizzolato
dfd011a9b3 TMXR: Update doc to add missing API description 2019-04-10 15:09:47 -07:00
Mark Pizzolato
2f8fca49c6 SCP: Move sim_ library debug masks to all be high bits
This is to allow DEVICE defined debug masks to start using the low bits
in the 32 bit debug mask and avoid collisions with library defined values.
2019-01-23 15:17:19 -08:00
Mark Pizzolato
0ba63fe7fa SCP: Automatically Save and Restore unit pos variable
Update writing simulator doc to describe proper use of unit pos variable.
2018-12-12 09:34:49 -08:00
Mark Pizzolato
3f2d76eee5 doc: Clarify use of sim_rtcn_init_unit vs sim_rtcn_init. 2018-09-27 06:21:39 -07:00
Mark Pizzolato
f42db0c6ea TMXR: Add tmxr_txdone_ln() to provide precise completion speed timing
Multi line TMXR devices can simplify state maintenance and better leverage
output scheduling when they use this API
2018-07-12 10:12:49 -07:00
Mark Pizzolato
53792d6261 TMXR: Describe TMXR API a little better 2018-06-19 22:05:12 -07:00
Mark Pizzolato
c8beee2d0f doc: Clarify details in "Writing a Simulator for the SIMH System" 2018-04-15 12:53:29 -07:00
Mark Pizzolato
f5ca960b82 TMXR: Disable ATTACH speed for devices which program port speed 2018-03-13 02:14:06 -07:00
Mark Pizzolato
9b1f44f787 SCP: Remove optional write_callback in the REGister structure
The REG structure exists to serve SCP's various activities.  It is
does not exist to provide capabilities to a VM.
2017-12-09 02:54:10 -08:00
Mark Pizzolato
61679ed8f0 SCP: Add optional write_callback to REGister structure called only on DEPOSIT
Add necessary macros to populate this field and cleanup all the
existing macros to be simpler.
2017-11-19 08:18:02 -08:00
Mark Pizzolato
2f64d2b6dc doc: Add suggestion to simh.doc regarding one time device init in reset routine 2017-06-23 12:36:28 -07:00
Mark Pizzolato
cb47ea3852 doc: Add description of optional PC value API used in debug output 2017-06-13 22:36:15 -07:00
Mark Pizzolato
a50403cd0a doc: Added description of optional Stop Message Formatting API (Dave Bryan) 2017-06-13 22:13:56 -07:00
Mark Pizzolato
fae6a18835 TAPE: Update tape gap support (Dave Bryan)
With this update, the erase gap operation has been split out of
"sim_tape_wrgap" into a separate, internal "tape_erase_fwd" routine that
is called from "sim_tape_wrgap" as well as from the new "sim_tape_errecf"
routine.  There's a corresponding internal "tape_erase_rev" that's called
from the new "sim_tape_errecr" routine.

I've shimmed "sim_tape_rdlntf" and "sim_tape_rdlntr" to move the tape
context and debug stuff out of the routines that I'm maintaining.  This
will allow me to replace those functions in their entirety with the
corresponding functions in my development sources for future updates.
It also allows me to keep Bob's version in sync.  As my routines are static
and only called once from the shims, compilers should optimize away
the function calls and instead inline the code, so there'd be no extra call
overhead.

I'd also like to keep "tape_erase_fwd" and "tape_erase_rev" untouched for
the same reason.  If you wish to add debug calls to "sim_tape_errecf" and
"sim_tape_errecr", that's fine.
2017-06-02 00:54:13 -07:00
Mark Pizzolato
d0bd4fbdff TMXR: Enforce output rate limiting when output is produced by instructions
Calls to tmxr_putc_ln() executed directly within instruction simulation code
(as opposed to during event servicing) will delay reasonable times
2017-05-11 08:42:31 -07:00
Mark Pizzolato
5c53d8eba0 DOC: Cleaned up API descriptions 2017-01-19 19:54:34 -08:00
Mark Pizzolato
c9276407e6 TIMER: Timing corrections and enhancements
- Add support to query remaining usecs on pending events.
- Generalized the sim_interval adjustment in sim_idle to allow more than
   a single decrement.
- More overhead reduction when idling.
- Carry usec values as double through out to fully support long wall clock
   delays.
2016-12-30 10:26:59 -08:00
Mark Pizzolato
7dd1f0b89e SCP: Complete support for automatic detection of WRU (^E) for all simulators
commit ef6528bf32 added support for automatic WRU detection for simulators
that don't have a console port, but it was never documented and the addition of
that support potentially interfered with SAVE/RESTORE behavior.

The console connection state is now automatically saved and restored.
2016-12-17 03:50:10 -08:00
Mark Pizzolato
39d2944ede TIMER: Add support for catchup clock ticks and cleaned up asynchronous clocks
Asynchronous clocks are now built for all simulators which are built with
SIM_ASYNCH_IO defined.  The default behavior has asynchronous clocks
disabled since this is still experimental, but it can be enabled with
SET TIMER ASYNC.

Catchup clock ticks are now available, but since they're experimental,
they aren't enabled by default.  Catchup ticks are only available if the
simulators clock device calls sim_rtcn_tick_ack to acknowledge processing
of clock ticks.  The VAX simulators have been modified to leverage this.
Catchup clock ticks can be enabled with SET TIMER CATCHUP

Additionally, an idle threshold is provided which can be used to
influence when clock calibration may be suppressed.  The default is not
to suppress calibration activities.

The various timer behaviors are visible with the SHOW TIMER command.

The state of the operating timer facilities is visible with: SHOW CLOCK

Timer events which are queued are visible with the SHOW QUEUE command.
2016-11-16 23:50:53 -08:00
Mark Pizzolato
17abb1223a TAPE: Make sure that all tape library APIs only work after sim_tape_attach
- Detects and fixes the problem reported in #345
2016-10-20 13:32:51 -07:00
Mark Pizzolato
222ae77436 SCP: Add sim_brk_message() to facilitate easy reporting of matched breakpoints.
Also extended the optional VM supplied routines to include sim_vm_sprint_addr.
Simulators which provide sim_vm_fprint_addr should also provide
sim_vm_sprint_addr with sim_vm_fprint_addr reworked to leverage
sim_vm_sprint_addr internally.  sim_vm_sprint_addr is currently only used by
sim_brk_message() which is an API which a simulator may choose to use if
it supports multiple breakpoint types,
2016-09-01 14:32:01 -07:00
Mark Pizzolato
052fafc62e SCP: Add UNIT wait and buf to SAVE/RESTORE data as documented. 2016-07-11 19:54:15 -07:00
Mark Pizzolato
5531ccb175 ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.

Most simulators can now also be compiled with a C++ compiler without
warnings.

Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
2016-05-15 15:25:33 -07:00
Mark Pizzolato
fc4171140a SCP: Add BINRDATA, BINRDATAD and BINRDATADF REG initialization macros.
These describe a register which is to be displayed in binary.
2016-03-23 00:43:36 -07:00
Mark Pizzolato
3ff89074f5 SCP: Add generic REGDATA register populating macro.
This allows simulator code to be insulated from any changes which may
be made to the REG structure in the future.  The REGDATA macro will be
update as needed to avoid any changes in simulator specific code.
2016-03-17 10:45:45 -07:00
Mark Pizzolato
329f42a1fc SCP: Rework newly added REG macro definitions to avoid problems with prior declarations
Fix #288
2016-03-16 20:33:41 -07:00
Mark Pizzolato
37733cabee SCP: Add support REGister data in arrays of arbitrary structures. 2016-03-14 15:07:22 -07:00
Mark Pizzolato
f3ca23c739 DOC: Correct parameter description in "Writing a Simulator for the SIMH system". 2016-02-25 05:14:49 -08:00
Mark Pizzolato
d8f2647f93 SCP: general const cleanups and const change to sim_vm_parse_addr. 2016-01-24 08:27:08 -08:00
Mark Pizzolato
6582aeead2 SCP. PDP11: Add ESC and ENQ to the default set of console output characters in 7P mode.
Revert change to add ESC and ENQ to printable characters for all simulators
and make that change only for the PDP11.
2016-01-02 05:07:18 -08:00
Mark Pizzolato
e162eb9418 DOC: Clarifications about behavior and requirements for EXAMINE -a and -c switches. From Dave Bryan 2015-11-19 09:06:19 -08:00
Paul Koning
35c321fe2e DOC: Corrections and cleanups.
Small corrections, including a number from Mark Pizzolato, in
description of unit timing, debug flags, among others.
2015-10-10 14:07:33 -04:00
Paul Koning
77bbfae817 DOC: Corrections and cleanups.
Update description of DEVICE, UNIT, and REG.  Correct a number of
typos and formatting glitches.  Add description of UNIT_IDLE,
REG_UNIT.  Add some missing details in fprint_sym and
sim_vm_is_subroutine_call.  Document command matching rule.
2015-09-25 12:52:07 -04:00