1
0
mirror of https://github.com/simh/simh.git synced 2026-01-11 23:52:58 +00:00

HP2100: Release 30

This commit is contained in:
J. David Bryan 2021-01-19 19:28:56 -08:00 committed by Mark Pizzolato
parent 685ca317a3
commit 0e119d70bb
12 changed files with 12579 additions and 10491 deletions

View File

@ -1,7 +1,7 @@
/* hp2100_cpu.c: HP 21xx/1000 Central Processing Unit simulator
Copyright (c) 1993-2016, Robert M. Supnik
Copyright (c) 2017-2019, J. David Bryan
Copyright (c) 2017-2020, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -28,6 +28,10 @@
I/O subsystem
Power Fail Recovery System
26-Aug-20 JDB Fixed tracing for I/O error simulation stops
Corrected line ends for trace to stdout
"set_model" now clears the X and Y registers for 21xx CPUs
04-Jul-20 JDB Postlude trace now calls "sim_error_text" unconditionally
08-Dec-19 JDB Added "hp_reset_poll" call to "cpu_reset"
03-Jul-19 JDB Substituted BP_EXEC for explicit 'E' switch in sim_brk_test
08-Apr-19 JDB Suppress stop messages for step and breakpoints in DO files
@ -2140,6 +2144,9 @@ while (status == SCPE_OK) { /* execute until simulat
fprint_val (sim_deb, sim_eval [0], cpu_dev.dradix, /* then print the numeric */
cpu_dev.dwidth, PV_RZRO); /* value again */
if (sim_deb == stdout) /* if debug output is to the (raw) console */
fputc ('\r', sim_deb); /* then insert a carriage return */
fputc ('\n', sim_deb); /* end the trace with a newline */
}
@ -2190,12 +2197,20 @@ pcq_r->qptr = pcq_p; /* update the PC queue p
sim_brk_dflt = meu_breakpoint_type (FALSE); /* base the default breakpoint type on the current MEM state */
if (TRACING (cpu_dev, cpu_dev.dctrl) /* if instruction tracing is enabled */
&& status <= SCPE_LAST) /* and the status is valid */
&& status <= SCPE_LAST) { /* and the status is valid */
hp_trace (&cpu_dev, cpu_dev.dctrl, /* then output the simulation stop reason */
DMS_FORMAT "simulation stop: %s\n",
DMS_FORMAT "simulation stop: %s",
meu_indicator, meu_page, MR, TR,
status >= SCPE_BASE ? sim_error_text (status)
: sim_stop_messages [status]);
sim_error_text (status));
if (cpu_ioerr_uptr) /* if this is an I/O error stop */
sim_vm_fprint_stopped (sim_deb, status); /* then add additional information */
if (sim_deb == stdout) /* if debug output is to the (raw) console */
fputc ('\r', sim_deb); /* then insert a carriage return */
fputc ('\n', sim_deb); /* tie off the line */
}
if (sim_switches & SIM_SW_HIDE /* if executing in a non-echoing command file */
&& (status == SCPE_STEP || status == STOP_BRKPNT)) /* and a step or breakpoint stop occurs */
@ -3795,6 +3810,10 @@ return SCPE_OK;
For logical tests that depend on this, it is faster (by one x86 machine
instruction) to test the "cpu_configuration" variable for the presence of
one of the three 1000 model flags.
3. The index registers (X and Y) are cleared when the model is set to a 21xx
CPU, which does not have index registers. This is required for the
"mem_trace_registers" routine to omit the registers from the trace.
*/
static t_stat set_model (UNIT *uptr, int32 new_model, char *cptr, void *desc)
@ -3836,6 +3855,8 @@ if (result == SCPE_OK) { /* if the change succeed
else { /* otherwise this is a 2100 or 211x */
is_1000 = FALSE; /* so set the model index */
mem_end = mem_size - IBL_SIZE; /* and reserve memory for the loader */
XR = YR = 0; /* clear the (non-existent) index registers */
}
}

View File

@ -1,7 +1,7 @@
/* hp2100_defs.h: HP 2100 simulator architectural declarations
Copyright (c) 1993-2016, Robert M. Supnik
Copyright (c) 2017-2019, J. David Bryan
Copyright (c) 2017-2020, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -24,6 +24,7 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the authors.
17-Aug-20 JDB Corrected "cputc" definition
08-Dec-19 JDB Added "hp_reset_poll" routine declaration
28-Mar-19 JDB Added extensions
18-Mar-19 JDB Added include for SCP extensions
@ -308,7 +309,7 @@
#define cputc(ch) \
do { \
putc (ch); \
putchar (ch); \
if (sim_log) \
fputc (ch, sim_log); \
} \

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* hp2100_lpt.c: HP 2100 12845B Line Printer Interface simulator
Copyright (c) 1993-2016, Robert M. Supnik
Copyright (c) 2017-2019, J. David Bryan
Copyright (c) 2017-2020, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -26,6 +26,7 @@
LPT HP 12845B Line Printer Interface
16-Mar-20 JDB Corrected introductory comments.
09-Dec-19 JDB Removed redundant SIM_SW_REST check in "lp_attach"
01-Oct-19 JDB DETACH -F now flushes the print buffer if not empty
26-Jun-18 JDB Revised I/O model
@ -221,6 +222,7 @@
The format commands recognized by the printers are:
0 0 0 0 0 0 0 -- slew 0 lines (suppress spacing) after printing *
0 0 0 0 0 0 1 -- slew 1 line after printing
...
0 0 0 1 1 1 1 -- slew 15 lines after printing
@ -228,7 +230,7 @@
...
0 1 1 1 1 1 1 -- slew 63 lines after printing **
* slew 1 line on the 2607A, which cannot suppress printing.
* slew 1 line on the 2607A, which cannot suppress spacing after printing
** available only on the 2610A and 2614A
and:

View File

@ -1,7 +1,7 @@
/* hp2100_mem.c: HP 21xx/1000 Main Memory/Memory Expansion Module/Memory Protect simulator
Copyright (c) 1993-2016, Robert M. Supnik
Copyright (c) 2017-2019, J. David Bryan
Copyright (c) 2017-2020, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -29,6 +29,7 @@
MEM 12731A Memory Expansion Module
MP 12581A/12892B Memory Protect
26-Aug-20 JDB Consolidated "mem_trace_registers" E/O/I output
27-Mar-19 JDB "dm_violation" now correctly freezes the violation register
02-Aug-18 JDB Added MEM device
30-Jul-18 JDB Renamed "iop_sp" to "SPR" (stack pointer register)
@ -321,25 +322,29 @@ static const uint32 tbg = 0001674u; /* (RTE) TBG address */
/* Main memory tracing constants */
static const char * const register_values [] = { /* register values, indexed by EOI concatenation */
"e o i", /* E = 0, O = 0, interrupt_system = off */
"e o I", /* E = 0, O = 0, interrupt_system = on */
"e O i", /* E = 0, O = 1, interrupt_system = off */
"e O I", /* E = 0, O = 1, interrupt_system = on */
"E o i", /* E = 1, O = 0, interrupt_system = off */
"E o I", /* E = 1, O = 0, interrupt_system = on */
"E O i", /* E = 1, O = 1, interrupt_system = off */
"E O I" /* E = 1, O = 1, interrupt_system = on */
};
static const char mp_value [] = { /* memory protection value, indexed by mp_control */
'-', /* MP is off */
'P' /* MP is on */
};
static const char * const register_formats [] = { /* CPU register formats, indexed by is_1000 */
REGA_FORMAT " A %06o, B %06o, ", /* is_1000 = FALSE format */
REGA_FORMAT " A %06o, B %06o, X %06o, Y %06o, " /* is_1000 = TRUE format */
static const char e_value [] = { /* extend register value */
'e', /* E is 0 */
'E' /* E is 1 */
};
static const char o_value [] = { /* overflow register value */
'o', /* O is 0 */
'O' /* O is 1 */
};
static const char i_value [] = { /* interrupt system value */
'i', /* interrupt system is off */
'I' /* interrupt system is on */
};
static const char * const register_formats [] = { /* CPU register formats, indexed by is_1000 */
REGA_FORMAT " A %06o, B %06o, %.0u%.0u%c %c %c\n", /* is_1000 = FALSE format */
REGA_FORMAT " A %06o, B %06o, X %06o, Y %06o, %c %c %c\n" /* is_1000 = TRUE format */
};
static const char * const mp_mem_formats [] = { /* MP/MEM register formats, indexed by is_1000 */
@ -1252,6 +1257,9 @@ else /* otherwise */
1. The "is_1000" flag is used to include or omit, based on the CPU model,
the X and Y registers from the working register trace and the MEVR and
MESR from the memory protection trace.
2. The "%.0u" print specifications in the trace call absorb the zero X and Y
register values without printing them when the CPU is not a 1000.
*/
void mem_trace_registers (FLIP_FLOP interrupt_system)
@ -1260,10 +1268,9 @@ hp_trace (&cpu_dev, TRACE_REG, /* output the working registers */
register_formats [is_1000], /* using a format appropriate for the CPU model */
mp_value [mp_control],
meu_status & MEST_FENCE_MASK,
SR, AR, BR, XR, YR);
fputs (register_values [E << 2 | O << 1 | interrupt_system], sim_deb); /* output E, O, and interrupt system */
fputc ('\n', sim_deb);
SR, AR, BR, XR, YR,
e_value [E], o_value [O],
i_value [interrupt_system]);
if (mp_mem_changed) { /* if the MP/MEM registers have been altered */
hp_trace (&cpu_dev, TRACE_REG, /* then output the register values */

View File

@ -26,6 +26,7 @@
MUX,MUXL,MUXC 12920A Asynchronous Multiplexer Interface
21-Oct-20 JDB ATTACH/DETACH MUXL <port> command is now rejected
03-Jan-20 JDB Revised modem control operation, added "muxc_reset"
23-Oct-19 JDB Fixed "muxl_ibuf" value for send interrupts
Fixed "lower_input_format" starting bit number
@ -1985,7 +1986,7 @@ static t_stat muxl_attach (UNIT *uptr, char *cptr)
{
t_stat status;
status = tmxr_attach_unit (&mux_desc, &mux_poll, uptr, cptr); /* try to attach to the serial port */
status = tmxr_attach_unit (&mux_desc, NULL, uptr, cptr); /* try to attach to the serial port */
if (status == SCPE_OK) { /* if the attach succeeded */
muxu_unit [0].wait = POLL_FIRST; /* then set up the poll */
@ -2003,7 +2004,7 @@ static t_stat muxl_detach (UNIT *uptr)
t_stat status;
int32 line;
status = tmxr_detach_unit (&mux_desc, &mux_poll, uptr); /* try to detach the serial port */
status = tmxr_detach_unit (&mux_desc, NULL, uptr); /* try to detach the serial port */
if (status == SCPE_OK) { /* if the detach succeeded */
line = uptr - muxl_unit; /* then determine the line number */

View File

@ -1,7 +1,7 @@
/* hp2100_sys.c: HP 2100 system common interface
Copyright (c) 1993-2016, Robert M. Supnik
Copyright (c) 2017-2019, J. David Bryan
Copyright (c) 2017-2020, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -24,6 +24,8 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the authors.
26-Aug-20 JDB Modified "hp_trace" to output CR LFs to stdout
25-Aug-20 JDB Now sets SCP hooks in "one_time_init" routine
08-Dec-19 JDB Added "hp_reset_poll" and "poll_name" routines
04-Mar-19 JDB Added "sim_vm_release" character string declaration
04-Oct-18 JDB Reordered the device list alphabetically
@ -117,9 +119,9 @@
/* Global release string */
/* Release string */
char *sim_vm_release = "29"; /* HP 2100 simulator release number */
static char *hp_release = "30"; /* HP 2100 simulator release number */
/* Command-line switch parsing from scp.c */
@ -3395,6 +3397,11 @@ return;
name among the devices enabled for tracing to ensure that all trace lines
will align for easier reading.
Because the prefix is output only once, embedded newlines should not be
present in the format string. If multiple output lines are desired, then
this routine should be called multiple times, so that each line receives an
identifying trace prefix.
Implementation notes:
@ -3403,6 +3410,23 @@ return;
the latter, we must allocate "sufficiently large" arrays for the flag
name and format, rather than arrays of the exact size required by the
call parameters.
2. If the trace output is being written to stdout, a terminating LF must
be translated to CR LF. This is because the console is in "raw" mode
while the CPU is executing instructions. Output to a file does not need
this processing, as text mode handles the host line-end convention.
3. Handling embedded newlines properly would require multiple calls to
"vfprintf", each preceded by the prefix, and each having a format string
consisting of the next segment that ends with an embedded newline.
However, multiple calls are not allowed. The C standard says:
"As the functions vfprintf [etc.] invoke the va_arg macro, the value of
arg after the return is indeterminate."
So there is no way to have the second (e.g.) call start with those
(variable) parameters not consumed by the prior call. Consequently, the
terminating LF check need only be done at the end of the format string.
*/
#define FLAG_SIZE 32 /* sufficiently large to accommodate all flag names */
@ -3434,15 +3458,25 @@ if (sim_deb != NULL && dptr != NULL) { /* if the output stream
(int) device_size, sim_dname (dptr), /* while padding the device and flag names */
(int) flag_size, flag_name); /* as needed for proper alignment */
va_start (argptr, flag); /* set up the argument list */
va_start (argptr, flag); /* set up the argument list */
format = va_arg (argptr, char *); /* get the format string parameter */
strcat (header_fmt, format); /* append the supplied format */
format = va_arg (argptr, char *); /* get the format string parameter */
strcat (header_fmt, format); /* append the supplied format */
vfprintf (sim_deb, header_fmt, argptr); /* format and print to the debug stream */
if (sim_deb == stdout) { /* if debug output is to the (raw) console */
fptr = header_fmt + strlen (header_fmt) - 1; /* then find the end of the string */
va_end (argptr); /* clean up the argument list */
break; /* and exit with the job complete */
if (*fptr == '\n') { /* if the format ends with a LF */
*fptr++ = '\r'; /* then replace it */
*fptr++ = '\n'; /* with a CR LF sequence */
*fptr = '\0'; /* and terminate with a NUL */
}
}
vfprintf (sim_deb, header_fmt, argptr); /* format and print to the debug stream */
va_end (argptr); /* clean up the argument list */
break; /* and exit with the job complete */
}
else /* otherwise */
@ -3453,14 +3487,22 @@ return;
}
/* Make a pair of devices consistent */
/* Make a pair of devices consistent.
Most of the disc and tape devices use two interface cards, designated the
command channel and the data channel. These are simulated with two DEVICE
structures. When a SET <dev> ENABLE or DISABLE command is directed to one of
the cards, the other chard wants to be set to the same state. Calling this
routine with the target card as the first parameter and the other card as the
second parameter will do it.
*/
void hp_enbdis_pair (DEVICE *ccptr, DEVICE *dcptr)
{
if (ccptr->flags & DEV_DIS)
dcptr->flags |= DEV_DIS;
else
dcptr->flags &= ~DEV_DIS;
if (ccptr->flags & DEV_DIS) /* if the target device is disabled */
dcptr->flags |= DEV_DIS; /* then disable the other device */
else /* otherwise */
dcptr->flags &= ~DEV_DIS; /* enable the other device */
return;
}
@ -3547,12 +3589,13 @@ run_handler = find_cmd ("RUN")->action; /* and the RUN/GO comm
break_handler = find_cmd ("BREAK")->action; /* and the BREAK/NOBREAK command handler */
load_handler = find_cmd ("LOAD")->action; /* and the LOAD command handler */
sim_vm_release = hp_release; /* set up the release string */
sim_vm_cmd = aux_cmds; /* set up the auxiliary command table */
sim_vm_fprint_stopped = fprint_stopped; /* set up the simulation-stop printer */
sim_vm_fprint_addr = fprint_addr; /* set up the address printer */
sim_vm_parse_addr = parse_addr; /* set up the address parser */
sim_vm_post = cpu_post_cmd; /* set up the command post-processor */
sim_vm_unit_name = poll_name; /* set up the custom unit name handler */
sim_vm_fprint_stopped = fprint_stopped; /* set up the simulation-stop printer */
sim_vm_fprint_addr = fprint_addr; /* set up the address printer */
sim_vm_parse_addr = parse_addr; /* set up the address parser */
sim_vm_post = cpu_post_cmd; /* set up the command post-processor */
sim_vm_unit_name = poll_name; /* set up the custom unit name handler */
sim_brk_types = BP_SUPPORTED; /* register the supported breakpoint types */
sim_brk_dflt = BP_ENONE; /* the default breakpoint type is "execution" */

View File

@ -1,7 +1,7 @@
/* hp2100_tty.c: HP 12531C Buffered Teleprinter Interface simulator
Copyright (c) 1993-2016, Robert M. Supnik
Copyright (c) 2017-2019, J. David Bryan
Copyright (c) 2017-2020, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -26,6 +26,7 @@
TTY 12531C Buffered Teleprinter Interface
25-Aug-20 JDB Reset routine now sets up VM unit pointer hooks
03-May-19 JDB Output stall now doubles rescheduling wait
26-Apr-19 JDB Added "vm_console_[in/out]put_unit" declarations
22-Sep-18 JDB RESET -P now resets to original FASTTIME timing
@ -276,9 +277,6 @@ static UNIT tty_unit [] = {
#define print_unit tty_unit [printer] /* teleprinter printer unit */
#define punch_unit tty_unit [punch] /* teleprinter punch unit */
UNIT *vm_console_input_unit = &key_unit; /* console input unit pointer */
UNIT *vm_console_output_unit = &print_unit; /* console output unit pointer */
/* Device information block */
@ -576,7 +574,7 @@ return outbound; /* return the outbound s
/* TTY local SCP support routines */
/* Set the keyboad input and print output filters.
/* Set the keyboard input and print output filters.
This validation routine is called to configure the character input filter for
the keyboard unit and the output filter for the print unit. The "value"
@ -664,7 +662,7 @@ return SCPE_OK; /* mode changes always s
rejected; the unit must be detached first. Otherwise, the device is disabled
by setting the DEV_DIS flag.
In either case, the device is reset, which will restart or cancel the keyboad
In either case, the device is reset, which will restart or cancel the keyboard
poll, as appropriate.
*/
@ -728,6 +726,9 @@ if (sim_switches & SWMASK ('P')) { /* if this is a power-on
tty.shift_in_data = MARK; /* and preset the input shift register */
fast_data_time = TTY_FAST_TIME; /* restore the initial fast data time */
vm_console_input_unit = &key_unit; /* set up the console input */
vm_console_output_unit = &print_unit; /* and console output unit pointers */
}
if (tty_dev.flags & DEV_DIS) /* if the device is disabled */
@ -843,7 +844,7 @@ if (tty.mode & CN_INPUT) { /* if the card is set fo
io_assert (&tty_dev, ioa_ENF); /* and the flag */
if (tty.mode & (CN_PRINT | CN_PUNCH)) /* if the printer or punch is enabled */
status = output ((int32) input); /* then scho the received character */
status = output ((int32) input); /* then echo the received character */
else /* otherwise */
status = SCPE_OK; /* silently indicate success */
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
SIMH/HP 2100 RELEASE NOTES
================================
J. David Bryan <jdbryan@acm.org>
Last update: 2020-02-14
Last update: 2020-11-07
This file documents the release history of the simulator for the Hewlett-Packard
@ -173,7 +173,7 @@ Manuals describing the operation of HP software are available from Bitsavers at:
...and from the HP Computer Museum at:
http://www.hpmuseum.net/collection_document.php
http://www.hpmuseum.net/collection_document.php#CS
----------------
@ -221,6 +221,306 @@ Revision 5010:
======================
Release 30, 2020-11-07
======================
This release of the HP 2100 simulator adds the following features:
- A new concurrent-mode FLUSH command has been added to flush terminal logs and
attached device files that otherwise would be flushed only when the simulator
is stopped. This allows external examination of these files while the
simulator continues to run.
- Terminal multiplexer line logs are now flushed each time the simulator stops.
Prior to this, closing and then reopening a line log was the only way to post
buffered writes to disc.
- The -N (new file) option has been added to the SET BACI LOG, SET MPX LOG, and
SET MUXL LOG commands to create new, blank log files. Without the option,
the commands will append to existing log files.
- The HP 12972C 8-channel terminal multiplexer (MPX) and 12920A 16-channel
terminal multiplexer (MUX) now allow channels to be omitted from the
connection order. For example, a SET MPX LINEORDER=0-3 command permits
connections to channels 0 through 3. Additional Telnet connection attempts
will be rejected with an "All connections busy" message, and attempting to
attach a serial port to a line not in the connection order will be rejected
with a "Unit not attachable" message.
- A new INTERLOCK option has been added to the IPL device. This provides a
more precise way of synchronizing the two simulator processes running the HP
2000 Time-Shared BASIC operating system. Entering a SET IPL INTERLOCK=<n>
command restricts each process to executing <n> machine instructions before
performing a rendezvous with the other process. In this way, both processes
remain in approximate lock-step, which substantially improves system startup
reliability, even when one process is preempted during initialization by the
host operating system. An associated SHOW IPL INTERLOCK command displays the
current interlock value.
- The IPL device now works on FreeBSD and Cygwin host platforms, as well as the
Windows and Linux platforms that were previously supported.
- A new -E switch has been added to the ATTACH IPL command. This enables
falling back to timed waits if the host platform does not support the
synchronization routines necessary for the SET IPL WAIT and SET IPL SIGNAL
commands.
- The CMD trace option for the IPL device now decodes and reports all TSB
commands that pass between the System Processor and the I/O Processor.
- The PSERV and STATE trace options have been added to the IPLO device.
Enabling the PSERV option traces the periodic calls to the new process
synchronizer. Enabling the STATE option traces calls to the host platform
event routines, as well as internal synchronizer states during rendezvous.
--------------------
Implementation Notes
--------------------
- The terminal multiplexer LINEORDER option now omits unspecified lines from
the connection order. Prior versions appended unspecified lines to the end
of the specified order. To obtain the prior behavior, append the keyword ALL
as the last parameter to the connection order list.
- New releases of the HP 2000F and 2000 Access software kits use the SET IPL
INTERLOCK command instead of the prior SET IPL WAIT/SIGNAL commands to
synchronize the two simulator instances and provide more reliable system
startup under a wider variety of host system conditions.
- The 2000 Access software kit now includes a command file to run the
program that converts files between Access and 2000 C/F systems.
- The "Running HP 2000 Time-Shared BASIC on SIMH" monograph has been
extensively revised to cover the application of the new SET IPL INTERLOCK
command to the TSB startup command files.
- The previous method of sleeping for a few milliseconds during 2000 Access
startup to avoid IOP initialization errors is no longer required when the
new IPL interlock is used. The capability has been retained, however, and
will be used if the host platform does not support synchronization events.
- The size of the shared memory area that simulates the processor
interconnection cables of the IPL device has been changed. On Linux and
macOS systems, this area is implemented by a file named "HP 2100-MEM-<code>",
where <code> is he code number supplied to the ATTACH IPL command. The file
is located in the "/dev/shm" directory. If the file is present, it must be
removed before running the simulator, or a "File open error" will result when
an ATTACH IPL is attempted. The new release of the simulator removes the
file automatically when a DETACH IPL is performed, so manual removal must be
done only once.
----------
Bugs Fixed
----------
1. PROBLEM: Breakpoint actions after an included true IF are discarded.
VERSION: Release 29.
OBSERVATION: If a breakpoint has actions that include an IF command
followed by additional actions, and the IF command evaluates to TRUE, then
the IF actions executed, but the remaining breakpoint actions are
discarded. For example:
sim> set environment X=0
sim> break 10 ; if "%X%" == "0" echo X is 0 ; echo Done
sim> go
One would expect to see:
Breakpoint, P: 00010 (NOP)
sim> if "0" == "0" echo X is 0
sim> echo X is 0
X is 0
sim> echo Done
Done
sim>
Instead, only the first ECHO is performed. The second one is discarded.
However, execution is correct if the IF condition is false:
sim> set environment X=1
sim> break 10 ; if "%X%" == "0" echo X is 0 ; echo Done
sim> go
Breakpoint, P: 00010 (NOP)
sim> if "1" == "0" echo X is 0
sim> echo Done
Done
sim>
CAUSE: IF actions are executed by setting the breakpoint action pointer to
the action list and returning to the command loop. While the IF command is
executing, the pointer is pointing at the "echo Done" part of the
breakpoint action list. However, if the IF condition is true, the pointer
is changed to point at the "echo X is 0" command, and the remaining
breakpoint actions are lost.
RESOLUTION: Modify "if_cmd" (sim_extension.c) to append the remaining
breakpoint actions to the actions specified by the IF command, so that the
former are not lost.
STATUS: Fixed in Release 30.
2. PROBLEM: Linking with recent compilers results in duplicate symbol errors.
VERSION: Releases 29.
OBSERVATION: If the simulator is compiled with a recent compiler version,
the link step fails with duplicate symbol errors. The symbols reported are
"sim_vm_release", "vm_sim_vm_init", "vm_console_input_unit", and
"vm_console_output_unit".
CAUSE: The VM hook extension mechanism is implemented with "tentative
definitions" of the hook variables. The C standard says:
"If a translation unit contains one or more tentative definitions for an
identifier, and the translation unit contains no external definition for
that identifier, then the behavior is exactly as if the translation unit
contains a file scope declaration of that identifier, with the composite
type as of the end of the translation unit, with an initializer equal to
0."
This behavior is such that if no module contains a definition with an
initializer, the hook will have a zero value. However, if a module
contains a definition with an initializer, the hook is assigned that value.
This allows hooks to be set without changing the hook's tentative
definition simply by including a VM module that declares it with an
initializer.
This mechanism relies on the linker to resolve the multiple definitions of
a given hook to a single reference. For this to occur, the compiler must
mark tentative definitions as "common" allocations, e.g., with the
"-fcommon" option to gcc. Traditionally, gcc (and clang, etc.) defaults to
common allocations for tentative definitions. However, the gcc manual
claims that, "This behavior is not required by ISO C, and on some targets
may carry a speed or code size penalty on variable references."
Newer versions (starting with gcc 10) default to data allocations instead
("-fno-common"), and multiple tentative definitions now result in duplicate
symbol errors rather than merged accesses.
RESOLUTION: Modify sim_extension.h to declare "vm_sim_vm_init" only if the
USE_VM_INIT symbol is defined. Modify "ex_initialize" (sim_extension.c) to
remove the tentative definition and to make the external "vm_sim_vm_init"
call conditional on USE_VM_INIT. Modify "one_time_init" (hp2100_sys.c) to
set the "sim_vm_release" hook directly. Modify "tty_reset" (hp2100_tty.c)
to set the console unit hooks directly. This removes all tentative
definitions from the simulators.
STATUS: Fixed in Releases 30.
3. PROBLEM: Trace output to stdout on Unix results in stair-step output.
VERSION: Release 29.
OBSERVATION: Directing the trace output to "stdout" on a Unix system
results in lines stair-stepping across the screen. For example:
sim> set console debug=stdout
sim> set cpu debug=instr
sim> step 2
...produces this output:
>>CPU instr: - 0000 00000 000000 NOP
>>CPU instr: - 0000 00001 000000 NOP
CAUSE: Trace statements are output with LF ('\n') line ends and depend on
host-system translation to the proper line-end convention when the lines
are written to the trace log. However, while the simulator is executing
instructions, the console is placed in "raw" mode so that output
translation, which would interfere with the output from the target
operating system, is not done. As there are no carriage returns in the
trace output stream when writing to stdout, the console cursor simply drops
in place to the next line, so that each line begins at the same column
where the previous line ended.
RESOLUTION: Modify "hp_trace" (hp2100_sys.c) to convert a terminating LF
to a CR LF sequence if output is to stdout. Also modify "sim_instr"
(hp2100_cpu.c) to add CR characters to the stdout stream where line
termination is done explicitly.
STATUS: Fixed in Release 30.
4. PROBLEM: The trace line for an I/O error simulation stop is incomplete.
VERSION: Release 29.
OBSERVATION: With simulation stops on I/O errors enabled, a CPU trace
correctly records the stop, but the stop description is incomplete. For
example:
sim> set ipl enabled
sim> attach -s ipl 1
sim> set cpu stop=ioerr
sim> set cpu debug=instr
sim> set console debug=stdout
sim> go
...produces trace output that ends with:
>>CPU instr: - 0000 00061 000000 simulation stop: Cable not connected to
...while the simulation console reports the full message, "Cable not
connected to the IPLI device."
CAUSE: The trace statement printer for the stop calls "sim_error_text" to
obtain the description of the stop status, but that routine does not handle
VM-specific additions. Upon returning to SCP, the "run_cmd" routine prints
the "sim_error_text" but then calls a VM-specified "sim_vm_fprint_stopped"
routine to handle additions to VM stops.
RESOLUTION: Modify "sim_instr" (hp2100_cpu.c) to call the VM-specific
simulation stop handler via the "sim_vm_fprint_stopped" hook if an I/O
error stop occurred.
STATUS: Fixed in Release 30.
5. PROBLEM: ATTACH/DETACH MUXL <network-port> succeeds but should not.
VERSION: Release 29.
OBSERVATION: The HP 12920A multiplexer simulator defines two devices: the
MUX device that contains the polling unit, and the MUXL device that
contains the terminal line units. The poll unit is attached with the:
ATTACH MUX <network-port>
...command. Line units are attached to serial ports with the:
ATTACH MUXL <serial-port>
...command. These behave as expected. However, the:
ATTACH MUXL <network-port>
...command succeeds but attaches the port to the MUX device. This is
incorrect and should be prohibited.
CAUSE: The "muxl_attach" routine passes a poll unit pointer to the
"tmxr_attach_unit" routine. The latter routine attaches the poll unit
instead of the passed line unit when a device is referenced. However, the
poll unit belongs to a different device, and so the mux line routine
attaches the port to the mux poll device.
RESOLUTION: Modify "muxl_attach" and "muxl_detach" (hp2100_mux.c) to pass
NULL for the poll unit in the "tmxr_attach_unit" calls. Modify the
"ex_tmxr_attach_unit" and "ex_tmxr_detach_unit" routines (sim_extension.c)
to reject the call if a device was referenced and a NULL poll unit pointer
was passed.
STATUS: Fixed in Release 30.
======================
Release 29, 2020-02-15
======================

File diff suppressed because it is too large Load Diff

Binary file not shown.