Commit graph

39 commits

Author SHA1 Message Date
Seth Morabito
7be9f2f3e8 3B2: LPT Device; MMU and SCSI fixes
This change adds support for printing to an attached text file via the
Centronics port of a simulated PORTS feature card. A new device named
"LPT" has been added. See "help lpt" for documentation.

Additionally, there has been a fix to a bug in the SCSI tape boot
implementation and a very minor bug fix to the Rev 3 MMU.
2023-04-09 12:36:15 -07:00
Olaf Seibert
f1c233afe7 3B2: remove unused local variable.
This and previous fix issue #76.
2022-10-24 17:19:00 -04:00
Seth Morabito
84bf5f4d14 3b2: Update README.md and correct line endings
This change updates the 3B2 README.md file, and fixes
all line endings on 3B2 source files.
2022-09-19 09:37:17 -07:00
Seth Morabito
9b62da6567 3B2-700 Initial Public Release
This commit introduces dozens of changes to make the 3B2-700 simulator
fully functional and ready for wider use. In addition to 3B2-700
availability, this commit includes a tremendous amount of refactoring
of the 3B2-400 and common code to make the project structure easier to
maintain and reason about.

One final important change: ROM files are no longer included in the
source code. 3B2 ROM images must be obtained separately and loaded
into the simulator before boot.

Changes:

- The 3b2 target has been aliased to 3b2-400
- The formerly named 3b2-600 project has become 3b2-700
- SCSI QIC tape support has been added to sim_scsi.c
- Header files have been reworked to reduce complexity of includes
- Common code has been consolidated
- Timer code has been unified
2022-09-15 14:15:28 -07:00
Seth Morabito
9d849283a4 3B2: Interrupt Refactor and DEMON ROM
- This change introduces a full refactor of the interrupt subsystem
  for the system board (SBD) and the I/O bus (CIO). Interrupt decode
  should now be significantly faster, and not require an expensive
  calculation on every step.

- The TIMER device has been split into Rev 2 and Rev 3
  implementations.

- The optional 3B2/400 Debug Monitor ROMs can now be booted by passing
  the "DEMON" argument to the 3B2/400 simulator BOOT command. Any
  of the following will cause the Debug Monitor ROM to be booted
  instead of the standard 3B2/400 ROM:

     sim> BOOT DEMON
     sim> BOOT CPU DEMON
     sim> BOOT DEMON CPU
2021-08-24 06:35:49 -07:00
Seth Morabito
c02491f733 3B2: Header refactoring and cleanup
This change signficantly improves header hygiene in the 3B2 project by
moving global symbols out of 3b2_defs.h and into the appropriate
individual module header files.

Each compilation unit now includes:

  - its appropriate matching .h file
  - any other .h files necessary for linting and compilation

Each header file in turn includes 3b2_defs.h, which contains truly
global symbols, and which pulls in sim_defs.h and exports global
devices.
2021-08-11 19:43:51 -07:00
Seth Morabito
c0beba5498 3B2: Rev 3 Development Base
This change introduces initial support for the AT&T 3B2 Rev 3 platform, based
around the WE32200 CPU with up to 64MB of RAM and SCSI disk and tape support.

This simulator is experimental and not yet supported. It will not be built by
default, but can be built with:

     make 3b2-600

Or by using the 3B2-600 Windows Visual Studio project.
2021-08-09 11:08:35 -07:00
Seth Morabito
3943f9b24f 3B2: Add DGMON SBD diagnostic tests
This commit adds support for automatically running DGMON SBD diagnostic tests
on build.

Additionally, a small bug is fixed in simulator boot caused by failure to
parse boot switches.
2021-07-31 12:22:27 -07:00
Seth Morabito
92ff16ca7b 3B2: Rename files in prep for Rev 3 support
This change lays the groundwork for adding support for Rev 3 3B2 models,
which includes the Model 500, Model 600, and Model 1000.

Rather than use the fixed strings "400" and "1000" in file names, the
strings "rev2" and "rev3" will be used, which allows greater flexibility
to implement various system configurations more easily.

Additionally, this change adds a copy of the Debug Monitor (DEMON) ROM
image for the Rev 2 board, to be used soon in a later checkin.
2021-05-12 10:56:39 -07:00
Seth Morabito
1a3e5af755 3b2: Refactoring in preparation for Rev 3
Refactor in preparation for the addition of a Rev 3 simulator for the
3B2/1000 system.

This change also includes a full cleanup of the rat's-nest of includes
and externs that plagued the 3B2 simulator and made it difficult to
understand and maintain. Headers are now required in the following
order:

  compilation unit -> "3b2_defs.h" -> {... dependencies ...}

Finally, HELP has been added to the CPU device.
2020-03-26 15:12:08 -07:00
Seth Morabito
731d99cf65 3b2: CMP{W|H|B} instruction fix
The WE32100 supports expanded datatypes for its opcodes, allowing an
opcode to override the default size (byte/halfword/word) expected by the
instruction. For example:

        CMPH &0x10000,{uword}-8(%fp)

Without the {uword} marker, this instruction would only compare the
lower 2 bytes of -8(%fp) against the lower two bytes of the constant
value 0x10000, since the CMPH instruction compares halfwords. However,
with the {uword} marker, the CMPH instruction promotes the opcode from a
halfword to an unsigned word, sign extending if appropriate.

The CMP{W|H|B} instruction implementation in the 3B2 simulator was
ignoring any expanded type markers on its opcodes when checking whether
to set the "N" (negative) bit in the PSW, leading to a failure in
compiling GCC. This fix causes the instruction to honor the expanded
datatype in this case.
2019-09-01 11:45:45 -07:00
Seth Morabito
e4e7071b6a 3b2: Improve NI performance
This change implements asynchronous (non-polling) mode for NI Ethernet
packet receive.
2019-08-25 20:39:48 -07:00
Seth Morabito
9736cc3116 3b2: STRCPY fix, CTC and NI cleanup
- The previous fix for STRCPY introduced a new bug. STRCPY must always
  copy the final NULL terminator of the string, but must NOT increment
  the source or destination pointers for the NULL terminator.

- The CTC simulation did not correctly support streaming mode, which
  can in some cases request reads that are not on 512-byte block
  boundaries.

- To begin to support System V Release 4 UNIX, the NI card (called EMD
  under SVR4) needed to support several more CRC codes for pump code.
2019-08-15 08:07:49 -07:00
Seth Morabito
ab27a53014 3b2: Fix STRCPY instruction
STRCPY must increment both source and destination pointers (R0 and R1).
2019-08-11 22:49:17 -07:00
Seth Morabito
61bdbd5d93 3b2: Provide precalibration program
This change adds a small infinite loop program that will be used by
the simulator to establish a reasonable guess at the host's
performance in order to precalibrate the system timer.
2019-07-01 13:21:56 -07:00
Seth Morabito
dd715e609e 3b2: unsigned addition overflow
- Integer addition of unsigned types could fail to set the
  overflow flag, leading to errors in the SVR3 floating point
  emulation library that rely on the overflow flag to detect
  carry out of high bit on unsigned addition. This change
  will correctly set the V flag if the high bit should be
  carried out on an add.
2019-06-29 19:40:57 -07:00
Seth Morabito
571c8f96a5 3b2: WE32106 Math Acceleration Unit (MAU)
This change adds support for the WE32106 Math Acceleration Unit (MAU).
The WE32106 is an IEEE-754 1985 compatible floating point math
acceleration unit that was an optional component on the 3B2/310 and
3B2/400.

The MAU is implemented using software floating point routines.  As
always, there may be bugs, but the MAU currently passes extensive
floating point tests with exactly the same results as a real 3B2/400
equipped with a physical MAU, so I hope these are few.
2019-06-29 08:45:27 -07:00
Seth Morabito
7455d28126 3b2: Soft-power shutdown via TIMER command
This change enables the simulator to be shut down cleanly via a
soft-power shutdown command. This is implemented in the real 3B2/400
through the sanity timer, which, if it reaches zero, sets a bus timeout
flag in the CSR and issues an interrupt at IPL 15. The operating
system (System V UNIX) treats this as a shutdown request and enters
runlevel 0.

To use this change in a SIMH startup script, for example to implement a
3B2 simulator as a service, one could add these commands:

    # [... simulator setup ...]
    BOOT
    SET TIMER SHUTDOWN
    CONTINUE
    EXIT

On catching a SIGTERM, SIGINT, or SIGHUP, the simulator would return to
SCP control, set the soft power shutdown flag, and then continue
simulator execution. After the system is cleanly shut down, the
simulator would then exit back to the operating system.
2019-04-13 11:36:02 -07:00
Seth Morabito
b0a4fb443c 3b2: NI 10Base5 Ethernet Device
- Implements an Ethernet device ("NI", for "Network Interface")
    for the 3B2 simulator.
2019-03-09 14:32:21 -08:00
Seth Morabito
71ee25be1a 3B2: Remove unused code, move static declarations
This change cleans up warnings issued when compiled with
-Wall.

- Removed unused functions and variables.
- Moved static declarations out of headers and into source files
- Added braces around initialization where suggested.
2018-08-19 12:37:31 -07:00
Seth Morabito
5ae2e4c49d 3b2: Fix for overwriting kernel memory 2018-08-19 12:37:18 -07:00
Seth Morabito
39758261ff 3b2: Allow boot without cpu param 2018-05-21 15:04:02 -07:00
Seth Morabito
ba9d8626e9 3b2: CIO PORTS and CTC devices
This change adds Common-IO implementations of the PORTS 4-port serial
line card and the CTC tape controller card.
2018-05-21 14:29:58 -07:00
Seth Morabito
a7d0d4a6e7 3b2: CIO feature card framework
Adds a skeleton framework for CIO ("Common I/O") feature cards. The
first feature card to be implemented will be the "PORTS" serial MUX.

Part of this support involved reworking IRQ handling in the CPU. It
now respects both IRQ Vector and IPL.

This change also removes all 'assert(0)' calls from the simulator and
replaces them with generic "Simulator Error" halts. These should only
happen if there's a genuine logic error lurking somewhere.
2018-04-11 18:19:31 -07:00
Seth Morabito
177be95e5d 3b2: Refactor DUART and DMA
This change is a major refactor of how DMA and the DUART interact.

DMA implementation can now be overridden by individual devices that
require DMA. Disk and Floppy both continue to use a generic DMA
implementation, but the DUART code replaces the generic DMA with its
own implementation that correctly rate-limits TX. Among other things,
this allows the simulator to work correctly with real serial
terminals. This functionality has been tested on an AT&T 5620 "Blit"
terminal, which can run the 'layers' windowing software from the
simulator.
2018-04-11 14:24:48 -07:00
Seth Morabito
40877838ad 3b2: Silence warning in Windows build 2018-04-05 17:24:47 -07:00
Seth Morabito
a9f9b3abd1 3b2: Refactor MMU and fix two bugs
- Add "SHOW STACK" support to CPU
- An off-by-one error in checking SDT length was fixed.
- not-present co-processor R/W should not set Bus timeout bit
2018-04-05 17:12:45 -07:00
Seth Morabito
557dcc91e9 3b2: Fix stack bounds checking bug 2018-03-31 18:46:44 -07:00
Seth Morabito
054e8e56c1 3b2: Fix compiler warnings 2018-03-20 17:42:37 -07:00
Seth Morabito
8f87b6e3da 3b2: Fix fprint_sym_m 2018-03-15 16:51:10 -07:00
Seth Morabito
f6e806df5a 3b2: Prevent attempts to ex/dep IO 2018-03-03 10:40:07 -08:00
Seth Morabito
651faa78ae 3b2: Allow handling of TRACE and BREAKPOINT traps
The 3B2 emulator did not have support for traps, rendering debugging
under the simulator fairly useless. This change adds support for
trap handling. The 'sdb' UNIX debugger under SVR3 should now work
correctly.
2017-12-27 15:13:58 -08:00
Seth Morabito
5a19a6b12c 3b2: Support for multiple integrated disks
This commit improves the integrated disk (ID) controller's behavior,
enabling full support for up to two 72MB (emulated WREN II)
integrated winchester disks.
2017-12-13 14:15:56 -08:00
Seth Morabito
06e7851d83 3b2: Fix overflow of mask bits in INSFW/EXTFW
- An overflow bug was causing INSFW and EXTFW to fail
  on Windows hosts compiled with Microsoft Visual Studio.
  This commit fixes the issue and causes 3B2 diagnostics
  to pass under win32.
2017-12-10 12:01:08 -08:00
Seth Morabito
0a00d8066a 3b2: Coverity issue cleanup 2017-11-30 16:30:53 +00:00
Seth Morabito
df54c87bf7 3b2: Coverity issue cleanup 2017-11-25 01:38:05 -08:00
Seth Morabito
690c30b6f4 3b2: Gracefully handle clock reset
Clock reset was not being handled gracefully at all, leading some
diagnostic tests not to pass, or not to pass consistently.

This change will "kick" the system clock whenever the timer divider is
reset, so the new divider is picked up immediately.
2017-11-25 01:38:05 -08:00
Seth Morabito
f6e63892b4 3b2: Preserve opcode values in history 2017-11-25 01:38:05 -08:00
Seth Morabito
804ea8e322 3b2: Initial release of an AT&T 3B2 model 400 emulator.
For information on usage, please see the file 3B2/README.md
2017-11-20 18:21:49 -08:00