1
0
mirror of https://github.com/wfjm/w11.git synced 2026-03-10 12:58:23 +00:00

- interim release w11a_V0.58 (untagged)

- C++ and Tcl based backend server now fully functional, supports with 
    DL11, RK11, LP11 and PC11 all devices available in w11a designs
- the old perl based backend server (pi_rri) is obsolete and removed
- operating system kits reorganized
This commit is contained in:
Walter F.J. Mueller
2013-05-12 19:15:30 +00:00
parent b06cbef00a
commit 200ba69364
143 changed files with 4757 additions and 8300 deletions

View File

@@ -1,4 +1,4 @@
# $Id: Makefile 489 2013-02-17 10:58:02Z mueller $
# $Id: Makefile 513 2013-05-01 14:02:06Z mueller $
#
# 'Meta Makefile' for whole retro project
# allows to make all synthesis targets
@@ -6,6 +6,7 @@
#
# Revision History:
# Date Rev Version Comment
# 2013-05-01 513 1.0.6 add clean_sim_tmp and clean_syn_tmp targets
# 2012-12-29 466 1.0.5 add tst_rlink_cuff
# 2011-12-26 445 1.0.4 add tst_fx2loop
# 2011-12-23 444 1.0.3 enforce -j 1 in sub-makes
@@ -15,6 +16,8 @@
#
SYN_all += rtl/sys_gen/tst_fx2loop/nexys2/ic
SYN_all += rtl/sys_gen/tst_fx2loop/nexys2/ic3
SYN_all += rtl/sys_gen/tst_fx2loop/nexys3/ic
SYN_all += rtl/sys_gen/tst_fx2loop/nexys3/ic3
SYN_all += rtl/sys_gen/tst_rlink/nexys2
SYN_all += rtl/sys_gen/tst_rlink/nexys3
SYN_all += rtl/sys_gen/tst_rlink/s3board
@@ -38,6 +41,7 @@ SIM_all += rtl/sys_gen/tst_rlink/nexys2/tb
SIM_all += rtl/sys_gen/tst_rlink/nexys3/tb
SIM_all += rtl/sys_gen/tst_rlink/s3board/tb
SIM_all += rtl/sys_gen/tst_rlink_cuff/nexys2/ic/tb
SIM_all += rtl/sys_gen/tst_rlink_cuff/nexys3/ic/tb
SIM_all += rtl/sys_gen/tst_serloop/nexys2/tb
SIM_all += rtl/sys_gen/tst_serloop/nexys3/tb
SIM_all += rtl/sys_gen/tst_serloop/s3board/tb
@@ -48,7 +52,8 @@ SIM_all += rtl/vlib/rlink/tb
SIM_all += rtl/vlib/serport/tb
SIM_all += rtl/w11a/tb
#
.PHONY : all clean clean_sim clean_sym all_sim all_syn
.PHONY : all all_sim all_syn
.PHONY : clean clean_sim clean_sim_tmp clean_sym clean_sym_tmp
.PHONY : $(SYN_all) $(SIM_all)
#
all :
@@ -59,6 +64,8 @@ all :
@echo " make clean"
@echo " make clean_sim"
@echo " make clean_syn"
@echo " make clean_sim_tmp"
@echo " make clean_syn_tmp"
@echo " for tool/documentation generation use:"
@echo " make -j 4 all_lib"
@echo " make clean_lib"
@@ -73,6 +80,11 @@ clean_sim :
clean_syn :
for dir in $(SYN_all); do $(MAKE) -C $$dir clean; done
#
clean_sim_tmp :
for dir in $(SIM_all); do $(MAKE) -C $$dir ghdl_tmp_clean; done
clean_syn_tmp :
for dir in $(SYN_all); do $(MAKE) -C $$dir ise_tmp_clean; done
#
all_sim : $(SIM_all)
#
all_syn : $(SYN_all)

View File

@@ -1,4 +1,4 @@
# $Id: INSTALL.txt 511 2013-04-27 13:51:46Z mueller $
# $Id: INSTALL.txt 512 2013-04-28 07:44:02Z mueller $
Guide to install and build w11a systems, test benches and support software
@@ -374,6 +374,11 @@ Guide to install and build w11a systems, test benches and support software
cd $RETROBASE/rtl/sys_gen/tst_rlink_cuff/nexys2/ic
make sys_tst_rlink_cuff_ic_n2.bit
b. for Digilent Nexys3 board
cd $RETROBASE/rtl/sys_gen/tst_rlink_cuff/nexys3/ic
make sys_tst_rlink_cuff_ic_n3.bit
3. w11a systems
a. for Digilent S3BOARD

View File

@@ -1,4 +1,4 @@
# $Id: README.txt 511 2013-04-27 13:51:46Z mueller $
# $Id: README.txt 518 2013-05-12 16:45:02Z mueller $
Release notes for w11a
@@ -35,7 +35,7 @@ Release notes for w11a
rtl/ibus - ibus devices (UNIBUS peripherals)
rtl/sys_gen - top level designs
rtl/sys_gen/tst_fx2loop - top level designs for Cypress FX2 tester
nexys2 - systems for Nexsy2
nexys2,nexys3 - systems for Nexsy2,Nexsy3
rtl/sys_gen/tst_rlink - top level designs for an rlink tester
nexys2,nexys3,s3board - systems for Nexsy2,Nexsy3,S3BOARD
rtl/sys_gen/tst_rlink_cuff - top level designs for rlink over FX2 tester
@@ -67,6 +67,8 @@ Release notes for w11a
tools/fx2/bin - pre-build firmware images in .ihx format
tools/fx2/src - C and asm sources
tools/fx2/sys - udev rules for USB on fpga eval boards
tools/oskit - setup files for Operation System kits
tools/oskit/... - several PDP-11 system kits available
tools/src - C++ sources for rlink backend software
tools/src/librlink - basic rlink interface
tools/src/librlinktpp - C++ to tcl binding for rlink interface
@@ -80,6 +82,39 @@ Release notes for w11a
3. Change Log ----------------------------------------------------------------
- trunk (2013-05-12: svn rev 21(oc) 518(wfjm); untagged w11a_V0.58) +++++++++
- Summary
- C++ and Tcl based backend server now fully functional, supports with
DL11, RK11, LP11 and PC11 all devices available in w11a designs
- the old perl based backend server (pi_rri) is obsolete and removed
- operating system kits reorganized
- New features
- new directory trees for
- tools/oskit - operating system kits
- new modules
- tools/src/librw11
- Rw11*LP11 - classes for LP11 printer handling
- Rw11*PC11 - classes for PC11 paper tape handling
- Rw11*Stream* - classes for Virtual stream handling
- tools/src/librwxxtpp
- RtclRw11*LP11 - tcl iface for LP11 printer handling
- RtclRw11*PC11 - tcl iface for PC11 paper tape handling
- RtclRw11*Stream* - tcl iface for Virtual Stream handling
- Changes
- renames
- the w11 backend quick starter now named ti_w11 and under tools/bin
(was rtl/sys_gen/w11a/tb/torri)
- all operating system image related material now under
tools/oskit (was under rtl/sys_gen/w11a/tb)
- Bug fixes
- rtl/ibus/ibdr_lp11 - err flag logic fixed, was cleared in ibus racc read
- rtl/ibus/ibdr_pc11 - rbuf logic fixed. Was broken since ibus V2 update
in V0.51! Went untested because pc11 rarely used.
- trunk (2013-04-27: svn rev 20(oc) 511(wfjm); untagged w11a_V0.57) +++++++++
- Summary

View File

@@ -1,4 +1,4 @@
# $Id: w11a_known_issues.txt 317 2010-07-22 19:36:56Z mueller $
# $Id: w11a_known_issues.txt 516 2013-05-05 21:24:52Z mueller $
Summary of known issues for w11a CPU and systems
@@ -34,7 +34,7 @@ Summary of known issues for w11a CPU and systems
device would see it. The w11a doesn't implement this remapping, an access
in the range 17000000:17757777 causes a NXM fault.
All four points relate to very 11/70 specific behaviour, not operating system
All four points relate to very 11/70 specific behaviour, no operating system
depends on them, therefore they are considered acceptable implementation
differences

View File

@@ -1,14 +1,16 @@
# $Id: w11a_os_guide.txt 511 2013-04-27 13:51:46Z mueller $
# $Id: w11a_os_guide.txt 518 2013-05-12 16:45:02Z mueller $
Guide to run operating system images on w11a systems
Table of content:
1. I/O emulation setup
2. FPGA Board setup
3. Unix V5 system
4. 2.11BSD system
1. I/O emulation setup
2. FPGA Board setup
3. Rlink and Backend Server setup
4. simh simulator setup
5. oskits
a. Unix systems
b. DEC operating systems
1. I/O emulation setup ----------------------------------------------------
@@ -16,6 +18,11 @@ Guide to run operating system images on w11a systems
are currently emulated via a backend process. The communication between
FPGA board and backend server can be via
- Direct USB connection using a Cypress FX2 USB controller
- is supported on the nexys2 and nexys3 FPGA boards
- much faster than serial port connections (see below)
- also allows to configure the FPGA over the same USB connection
- Serial port
- via direct (/dev/ttySx) or via a USB-RS232 adapter. A direct connection
is limited to 115k Baud on most PCs, while a connection via a USB-RS232
@@ -24,208 +31,164 @@ Guide to run operating system images on w11a systems
- via integrated USB-RS232 adapter, like on nexys3 board. This is much
faster, allows bitrates up to 2 M Baud.
Notes: - A USB-RS232 cable with a Prolific Technology PL2303 chip simply
Notes: - A USB-RS232 cable with a FTDI FT232R chip, like the cable offered
by FTDI as US232R-100 works fine.
- A USB-RS232 cable with a Prolific Technology PL2303 chip simply
never gave reliable connections for higher Baud rates.
- A USB-RS232 cable with a FTDI FT232R chip, like the cable offered
by FTDI as US232R-100 worked fine.
- On older linux kernels (prior 2.6.32) it is essential to set the
latency timer for the FTDI USB-RS232 cable to 1 ms (from the
power up default of 16 ms), e.g. with
sudo $RETROBASE/tools/bin/set_ftdi_lat USB0 1
For linux kernel 2.6.32 or newer the default is 1 ms already.
- The rest assumes that a USB-RS232 cable with FTDI chip is used
- A 460k Baud connection gives in practice a disk throughput of
about 20 kB/s. This allows to test the system but is a bit slow
to real usage. In an OS with good disk caching like 2.11BSD the
impact of such a 'slow disk' is actually smaller than the bare
numbers suggest.
- Direct USB connection using a Cypress FX2 USB controller
- is supported on the nexys2 and nexys3 FPGA boards
- clearly much faster than serial port connections
- also allows to configure the FPGA over the same USB connection
- On older linux kernels (prior 2.6.32) it is essential to set the
latency timer for the FTDI USB-RS232 cable to 1 ms (from the
power up default of 16 ms), e.g. with
sudo $RETROBASE/tools/bin/set_ftdi_lat USB0 1
For linux kernel 2.6.32 or newer the default is 1 ms already.
2. FPGA Board setup -------------------------------------------------------
- Using serial port
- for s3board and nexys2
- connect the USB-RS232 cable to the RS232 port of the s3board or nexys2
- for kernel < 2.6.32: set the latency timer of the USB-RS232, e.g. with
sudo $RETROBASE/tools/bin/set_ftdi_lat USB0 1
- ensure that all 8 switches are in the indicated positions (SWI=...)
- load the w11a design into the FPGA, e.g. via impact
- for nexys3
- connect USB cable to the 'usb uart' port (next to the 5 buttons)
- ensure that all 8 switches are in the indicated positions (SWI=...)
- load the w11a design into the FPGA, e.g. via impact
- Using Cypress FX2 USB controller
- Using Cypress FX2 USB controller for configuration and rlink communication
- for nexys2
- connect USB cable to mini-USB connector (between RS232 and PS/2 port)
! Must be connected to a USB port able to deliver 500 mA !
- for nexys3
- connect USB cable to micro-USB connector labeled 'USB PROG'
3. Unix V5 system ---------------------------------------------------------
- Using serial port for rlink communication
- for s3board and nexys2
- connect the USB-RS232 cable to the RS232 port
- for nexys3
- connect USB cable to the micro-USB connector 'UART'
(next to the 5 buttons)
- connect a JTAG programmer (e.g. Xilinx USB Cable II) to JTAG pins
- A disk set is available from
http://www.retro11.de/data/oc_w11/unix_v5_rkset.tgz
Download, unpack and copy the disk images (*.dsk) to
$RETROBASE/rtl/sys_gen/w11a/tb
- Configure the FPGA
- if Cypress FX2 port is connected load design with
make <sys>.jconfig
- otherwise use impact with
make <sys>.iconfig
- Using old (pi_rri) backend server (serial port only)
3. Rlink and Backend Server setup -----------------------------------------
cd $RETROBASE/rtl/sys_gen/w11a/tb
telnet_starter -d DL0 &
All examples below use the same basic setup
[for s3,n2:]
SWI = 00000010
dorri -u0,460,1,2 @uv5_boot.pcmd
[for n3:]
SWI = 00000010
dorri -u0,2000,1,2 @uv5_boot.pcmd
- setup vt100 emulator windows
- Using new (ti_rri) backend server (serial and fx2 supported)
cd $RETROBASE/rtl/sys_gen/w11a/tb
telnet_starter -d DL0 &
[for s3,n2 over serial:]
SWI = 00000010
torri -tu0,460k,break,xon @uv5_boot.tcl
[for n3 over serial:]
SWI = 00000010
torri -tu0,2M,break,xon @uv5_boot.tcl
[for n2,n3 over fx2:]
SWI = 00000100
torri -u @uv5_boot.tcl
- the boot dialog in the console xterm window will look like
(required input is in {..}, with {<CR>} denoting a carriage return:
@{unix}
login: {root}
Now you are at the shell prompt and can excercise the system, e.g.
# {ls -al}
total 62
drwxr-xr-x 9 bin 160 Jan 29 16:14 .
drwxr-xr-x 9 bin 160 Jan 29 16:14 ..
drwxr-xr-x 2 bin 944 Nov 26 18:13 bin
drwxr-xr-x 2 bin 80 Nov 26 18:13 dev
drwxr-xr-x 2 bin 240 Mar 21 12:07 etc
drwxr-xr-x 2 bin 224 Nov 26 18:13 lib
drwxr-xr-x 2 bin 32 Nov 26 18:13 mnt
drwxrwxrwx 2 bin 32 Nov 26 18:13 tmp
-rwxrwxrwx 1 bin 25802 Mar 21 12:07 unix
drwxr-xr-x 14 bin 224 Nov 26 18:13 usr
There is no 'halt' or 'shutdown' command, just ^D out of the server
session. The disks aren't cached, so no need to sync either.
4. 2.11BSD system ---------------------------------------------------------
- A disk set is available from
http://www.retro11.de/data/oc_w11/211bsd_rkset.tgz
Download, unpack and copy the disk images (*.dsk) to
$RETROBASE/rtl/sys_gen/w11a/tb
- Using old (pi_rri) backend server (serial port only)
cd $RETROBASE/rtl/sys_gen/w11a/tb
sudo $RETROBASE/tools/bin/set_ftdi_lat USB0 1
cd $RETROBASE/tools/oskit/<oskit-name>
telnet_starter -d DL0 &
telnet_starter -d DL1 &
[for s3,n2:]
SWI = 00000010
dorri -u0,460,1,2 @211bsd_rk_boot.pcmd
[for n3:]
SWI = 00000010
dorri -u0,2000,1,2 @211bsd_rk_boot.pcmd
- Using new (ti_rri) backend server (serial and fx2 supported)
cd $RETROBASE/rtl/sys_gen/w11a/tb
telnet_starter -d DL0 &
[for s3,n2 over serial:]
SWI = 00000010
torri -tu0,460k,break,xon @211bsd_rk_boot.tcl
[for n3 over serial:]
SWI = 00000010
torri -tu0,2M,break,xon @211bsd_rk_boot.tcl
- setup rlink connection using ti_rri backend server via the ti_w11
quick start wrapper script. Ensure that all 8 switches on the board
are in the indicated positions (SWI=...). The concrete boot script
name <boot-script> is given in the following sections
[for n2,n3 over fx2:]
SWI = 00000100
torri -u @211bsd_rk_boot.tcl
ti_w11 -u @<oskit-name>_boot.tcl
- the boot dialog in the console xterm window will look like
(required input is in {..}, with {<CR>} denoting a carriage return:
[for s3,n2 over serial:]
SWI = 00000010
ti_w11 -tu0,460k,break,xon @<oskit-name>_boot.tcl
[for n3 over serial:]
SWI = 00000010
ti_w11 -tu0,2M,break,xon @<oskit-name>_boot.tcl
4. simh simulator setup ---------------------------------------------------
70Boot from rk(0,0,0) at 0177404
: {<CR>}
: rk(0,0,0)unix
Boot: bootdev=03000 bootcsr=0177404
2.11 BSD UNIX #26: Thu Jan 1 19:49:13 PST 2009
root@curly.2bsd.com:/usr/src/sys/RETRONFPRK
phys mem = 3932160
avail mem = 3577856
user mem = 307200
January 4 16:45:33 init: configure system
dz ? csr 160100 vector 310 skipped: No CSR.
lp 0 csr 177514 vector 200 attached
rk ? csr 177400 vector 220 didn't interrupt.
rl ? csr 174400 vector 160 skipped: No CSR.
tm ? csr 172520 vector 224 skipped: No CSR.
xp ? csr 176700 vector 254 skipped: No CSR.
cn 1 csr 176500 vector 300 attached
erase, kill ^U, intr ^C
Sometimes it is good to compare the w11a behaviour with the PDP-11 software
emulator from the simh project (see http://simh.trailing-edge.com/).
In first '#' prompt the system is in single-user mode. Just enter a ^D
to continue the system startup to multi-user mode:
Under $RETROBASE/tools/simh two setup files are provided with configure
simh to reflect the w11a setup as close as possible:
- setup_w11a_min.scmd
Very close the current w11a state when it runs on an S3BOARD
- processor: 11/70, no FPP, 1 Mbyte
- periphery: 2 DL11, LP11, RK11, PC11
- setup_w11a_max.scmd
Planned configuration for the w11a, in addition
- processor: 4 Mbyte memory (as on Nexys2, Nexys3,...)
- periphery: DZ11, RL11/RL02, RK70/RP06, TM11/TU10
#^D
checking quotas: done.
Assuming non-networking system ...
checking for core dump...
preserving editor files
clearing /tmp
standard daemons: update cron accounting.
starting lpd
starting local daemons:Sun Jan 4 16:46:37 PST 2009
January 4 16:46:37 init: kernel security level changed from 0 to 1
January 4 16:46:40 getty: /dev/tty01: Device not configured
...
2.11 BSD UNIX (curly.2bsd.com) (console)
login: {root}
erase, kill ^U, intr ^C
Startup scripts are provided with each oskit. They call the w11a_max
configuration, so will show in the emulator what w11a can do when
finished.
Now the system is in multi-user mode, daemons runnng. You can explore
the system, e.g. with a 'pstat -T' or a 'mount' command. At end is
important to shutdown properly with a 'halt':
All examples below use the same basic setup
# {pstat -T}
7/186 files
39/208 inodes
11/150 processes
6/ 46 texts active, 28 used
2/135 swapmap entries, 366 kB used, 2069 kB free, 2063 kB max
33/150 coremap entries, 2960 kB free, 2867 kB max
1/ 10 ub_map entries, 10 free, 10 max
# {mount}
/dev/rk0h on /
/dev/rk2h on /tmp
/dev/rk3h on /bin
/dev/rk4h on /usr
# {halt}
syncing disks... done
halting
- setup vt100 emulator window for 2nd DL11
Now the server process can be stopped with ^D.
cd $RETROBASE/tools/oskit/<oskit-name>
telnet_starter -d -s DL1 &
{Note: the -s ensures that the port numbers used by simh are taken!}
- start the simulator
pdp11 <oskit-name>_boot.scmd
5. oskits -----------------------------------------------------------------
Ready to be used 'oskits' are provided under
$RETROBASE/tools/oskit/<oskit-name>
The tarballs with the disk images are provided from a web server
and have to be installed separately.
5a. Unix systems -----------------------------------------------------
Legal and license issues:
Ancient UNIX systems for the PDP-11 can now be freely used under the
'Caldera license'. 2.11BSD was released 1992 under the 4 clause BSD
license. Taken together
- Unix V1 to V7
- all BSD Unix versions for PDP-11
can be freely distributed and used for non-commercial purposes.
Two oskits are currently provided:
- unix-v5_rk: Unix V5 System on RK05
- 211bsd_rk: 2.11BSD system on RK05
For further details consult the README_<oskit-name>set.txt file in the
oskit directory.
5b. DEC operating systems --------------------------------------------
Legal and license issues:
Unfortunately there is no general hobbyist license for DEC operating
systems for PDP-11 computers. The 'Mentec license' commonly understood
to cover the some older versions of DEC operating systems, for example
- RT-11 V5.3 or prior
- RSX-11M V4.3 or prior
- RSX-11M PLUS V3.0 or prior
on software simulators, most notably on the 'simh' suite.
HOWEVER: THIS LICENSE DOES NOT COVER THE USAGE OF THESE HISTORIC DEC
OPERATING SYSTEMS ON ANY 'REAL HARDWARE' IMPLEMENTATION OF A
PDP-11. SO USAGE ON THE W11 IS *NOT* COVERED BY THE
'Mentec-license'.
Some oskits are provided with systems sysgen'ed to run on a configuration
like the w11a.
- Feel free to explore them with the simh simulator.
The boot scripts for simh are included ( <kit>.simh )
- In case you happen to have a valid license feel free to try them
out the W11A and let the author know whether is works as it should.
For convenience the boot scripts are also included ( <kit>.tcl ).
Three oskits are currently provided
- rsx11m-31_rk: RSX-11M V3.1 on RK05
- rsx11m-40_rk: RSX-11M V4.0 on RK05
- rt11-40_rk: RT-11 V4.0 on RK05
For further details consult the README_<oskit-name>set.txt file in the
oskit directory.

View File

@@ -1,6 +1,6 @@
-- $Id: ibdr_lp11.vhd 427 2011-11-19 21:04:11Z mueller $
-- $Id: ibdr_lp11.vhd 515 2013-05-04 17:28:59Z mueller $
--
-- Copyright 2009-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
-- Copyright 2009-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
@@ -18,7 +18,7 @@
-- Dependencies: -
-- Test bench: -
-- Target Devices: generic
-- Tool versions: xst 8.2, 9.1, 9.2, 10.1, 12.1, 13.1; ghdl 0.18-0.29
-- Tool versions: xst 8.2, 9.1, 9.2, 10.1, 12.1, 13.3; ghdl 0.18-0.29
--
-- Synthesized (xst):
-- Date Rev ise Target flop lutl lutm slic t peri
@@ -27,6 +27,7 @@
--
-- Revision History:
-- Date Rev Version Comment
-- 2013-05-04 515 1.3 BUGFIX: r.err was cleared in racc read !
-- 2011-11-18 427 1.2.2 now numeric_std clean
-- 2010-10-23 335 1.2.1 rename RRI_LAM->RB_LAM;
-- 2010-10-17 333 1.2 use ibus V2 interface
@@ -119,6 +120,7 @@ begin
variable ibreq : slbit := '0';
variable ibrd : slbit := '0';
variable ibw0 : slbit := '0';
variable ibw1 : slbit := '0';
variable ilam : slbit := '0';
begin
@@ -129,6 +131,7 @@ begin
ibreq := IB_MREQ.re or IB_MREQ.we;
ibrd := IB_MREQ.re;
ibw0 := IB_MREQ.we and IB_MREQ.be0;
ibw1 := IB_MREQ.we and IB_MREQ.be1;
ilam := '0';
-- ibus address decoder
@@ -158,7 +161,9 @@ begin
end if;
end if;
else -- rri
n.err := IB_MREQ.din(csr_ibf_err);
if ibw1 = '1' then
n.err := IB_MREQ.din(csr_ibf_err);
end if;
end if;
when ibaddr_buf => -- BUF -- data buffer ----------------

View File

@@ -1,6 +1,6 @@
-- $Id: ibdr_pc11.vhd 427 2011-11-19 21:04:11Z mueller $
-- $Id: ibdr_pc11.vhd 515 2013-05-04 17:28:59Z mueller $
--
-- Copyright 2009-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
-- Copyright 2009-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
@@ -18,7 +18,7 @@
-- Dependencies: -
-- Test bench: xxdp: zpcae0
-- Target Devices: generic
-- Tool versions: xst 8.2, 9.1, 9.2, 12.1, 13.1; ghdl 0.18-0.29
-- Tool versions: xst 8.2, 9.1, 9.2, 12.1, 13.3; ghdl 0.18-0.29
--
-- Synthesized (xst):
-- Date Rev ise Target flop lutl lutm slic t peri
@@ -27,6 +27,8 @@
--
-- Revision History:
-- Date Rev Version Comment
-- 2013-05-04 515 1.3 BUGFIX: r.rbuf was immediately cleared ! Was broken
-- since ibus V2 update, never tested afterwards...
-- 2011-11-18 427 1.2.2 now numeric_std clean
-- 2010-10-23 335 1.2.1 rename RRI_LAM->RB_LAM;
-- 2010-10-17 333 1.2 use ibus V2 interface
@@ -215,8 +217,8 @@ begin
idout(r.rbuf'range) := r.rbuf;
if IB_MREQ.racc = '0' then -- cpu ---------------------
if true then -- !! PC11 is unusual !!
n.rdone := '0'; -- any read or write will clear done
if ibreq = '1' then -- !! PC11 is unusual !!
n.rdone := '0'; -- *any* read or write will clear done
n.rbuf := (others=>'0'); -- and the reader buffer
n.rintreq := '0'; -- also interrupt is canceled
end if;

View File

@@ -0,0 +1,4 @@
_impactbatch.log
sys_tst_fx2loop_ic_n3.ucf
*.dep_ucf_cpp
*.svf

View File

@@ -0,0 +1,30 @@
# $Id: Makefile 477 2013-01-27 14:07:10Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2012-04-09 461 1.0 Initial version
#
#
VBOM_all = $(wildcard *.vbom)
BIT_all = $(VBOM_all:.vbom=.bit)
#
include $(RETROBASE)/rtl/make/xflow_default_nexys3.mk
FX2_FILE = nexys3_jtag_2fifo_ic.ihx
#
.PHONY : all clean
#
all : $(BIT_all)
#
clean : ise_clean
rm -f $(VBOM_all:.vbom=.ucf)
#
#----
#
include $(RETROBASE)/rtl/make/generic_xflow.mk
include $(RETROBASE)/rtl/make/generic_ghdl.mk
#
ifndef DONTINCDEP
include $(VBOM_all:.vbom=.dep_xst)
include $(VBOM_all:.vbom=.dep_ghdl)
endif
#

View File

@@ -0,0 +1,59 @@
-- $Id: sys_conf.vhd 510 2013-04-26 16:14:57Z mueller $
--
-- Copyright 2012-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 2, or at your option any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for complete details.
--
------------------------------------------------------------------------------
-- Package Name: sys_conf
-- Description: Definitions for sys_tst_fx2loop_ic_n3 (for synthesis)
--
-- Dependencies: -
-- Tool versions: xst 13.3, 14.5; ghdl 0.29
-- Revision History:
-- Date Rev Version Comment
-- 2012-04-24 510 1.1 use 3/2 clock-> 150 MHz sysclk
-- 2012-04-09 461 1.0 Initial version
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.slvtypes.all;
package sys_conf is
constant sys_conf_clkfx_divide : positive := 2;
constant sys_conf_clkfx_multiply : positive := 3;
constant sys_conf_fx2_type : string := "ic2";
-- dummy values defs for generic parameters of as controller
constant sys_conf_fx2_rdpwldelay : positive := 1;
constant sys_conf_fx2_rdpwhdelay : positive := 1;
constant sys_conf_fx2_wrpwldelay : positive := 1;
constant sys_conf_fx2_wrpwhdelay : positive := 1;
constant sys_conf_fx2_flagdelay : positive := 1;
-- pktend timer setting
-- petowidth=10 -> 2^10 30 MHz clocks -> ~33 usec (normal operation)
constant sys_conf_fx2_petowidth : positive := 10;
constant sys_conf_fx2_ccwidth : positive := 5;
constant sys_conf_hio_debounce : boolean := true; -- instantiate debouncers
-- derived constants
constant sys_conf_clksys : integer :=
(100000000/sys_conf_clkfx_divide)*sys_conf_clkfx_multiply;
constant sys_conf_clksys_mhz : integer := sys_conf_clksys/1000000;
end package sys_conf;

View File

@@ -0,0 +1,20 @@
## $Id: sys_tst_fx2loop_ic_n3.ucf_cpp 461 2012-04-09 21:17:54Z mueller $
##
## Revision History:
## Date Rev Version Comment
## 2012-04-09 461 1.0 Initial version
##
NET "I_CLK100" TNM_NET = "I_CLK100";
TIMESPEC "TS_I_CLK100" = PERIOD "I_CLK100" 10.0 ns HIGH 50 %;
OFFSET = IN 10 ns BEFORE "I_CLK100";
OFFSET = OUT 20 ns AFTER "I_CLK100";
## std board
##
#include "bplib/nexys3/nexys3_pins.ucf"
##
## FX2 interface
##
#include "bplib/nexys3/nexys3_pins_fx2.ucf"
#include "bplib/nexys3/nexys3_time_fx2_ic.ucf"

View File

@@ -0,0 +1,8 @@
# conf
sys_conf = sys_conf.vhd
# libs
# components
# design
../sys_tst_fx2loop_n3.vbom
@ucf_cpp: sys_tst_fx2loop_ic_n3.ucf
@top: sys_tst_fx2loop_n3

View File

@@ -0,0 +1,4 @@
_impactbatch.log
sys_tst_fx2loop_ic3_n3.ucf
*.dep_ucf_cpp
*.svf

View File

@@ -0,0 +1,30 @@
# $Id: Makefile 477 2013-01-27 14:07:10Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2012-04-09 461 1.0 Initial version
#
#
VBOM_all = $(wildcard *.vbom)
BIT_all = $(VBOM_all:.vbom=.bit)
#
include $(RETROBASE)/rtl/make/xflow_default_nexys3.mk
FX2_FILE = nexys3_jtag_3fifo_ic.ihx
#
.PHONY : all clean
#
all : $(BIT_all)
#
clean : ise_clean
rm -f $(VBOM_all:.vbom=.ucf)
#
#----
#
include $(RETROBASE)/rtl/make/generic_xflow.mk
include $(RETROBASE)/rtl/make/generic_ghdl.mk
#
ifndef DONTINCDEP
include $(VBOM_all:.vbom=.dep_xst)
include $(VBOM_all:.vbom=.dep_ghdl)
endif
#

View File

@@ -0,0 +1,59 @@
-- $Id: sys_conf.vhd 510 2013-04-26 16:14:57Z mueller $
--
-- Copyright 2012-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 2, or at your option any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for complete details.
--
------------------------------------------------------------------------------
-- Package Name: sys_conf
-- Description: Definitions for sys_tst_fx2loop_ic3_n3 (for synthesis)
--
-- Dependencies: -
-- Tool versions: xst 13.3, 14.5; ghdl 0.29
-- Revision History:
-- Date Rev Version Comment
-- 2012-04-25 510 1.1 use 3/2 clock-> 150 MHz sysclk
-- 2012-04-09 461 1.0 Initial version
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.slvtypes.all;
package sys_conf is
constant sys_conf_clkfx_divide : positive := 2;
constant sys_conf_clkfx_multiply : positive := 3;
constant sys_conf_fx2_type : string := "ic3";
-- dummy values defs for generic parameters of as controller
constant sys_conf_fx2_rdpwldelay : positive := 1;
constant sys_conf_fx2_rdpwhdelay : positive := 1;
constant sys_conf_fx2_wrpwldelay : positive := 1;
constant sys_conf_fx2_wrpwhdelay : positive := 1;
constant sys_conf_fx2_flagdelay : positive := 1;
-- pktend timer setting
-- petowidth=10 -> 2^10 30 MHz clocks -> ~33 usec (normal operation)
constant sys_conf_fx2_petowidth : positive := 10;
constant sys_conf_fx2_ccwidth : positive := 5;
constant sys_conf_hio_debounce : boolean := true; -- instantiate debouncers
-- derived constants
constant sys_conf_clksys : integer :=
(100000000/sys_conf_clkfx_divide)*sys_conf_clkfx_multiply;
constant sys_conf_clksys_mhz : integer := sys_conf_clksys/1000000;
end package sys_conf;

View File

@@ -0,0 +1,20 @@
## $Id: sys_tst_fx2loop_ic3_n3.ucf_cpp 461 2012-04-09 21:17:54Z mueller $
##
## Revision History:
## Date Rev Version Comment
## 2012-04-09 461 1.0 Initial version
##
NET "I_CLK100" TNM_NET = "I_CLK100";
TIMESPEC "TS_I_CLK100" = PERIOD "I_CLK100" 10.0 ns HIGH 50 %;
OFFSET = IN 10 ns BEFORE "I_CLK100";
OFFSET = OUT 20 ns AFTER "I_CLK100";
## std board
##
#include "bplib/nexys3/nexys3_pins.ucf"
##
## FX2 interface
##
#include "bplib/nexys3/nexys3_pins_fx2.ucf"
#include "bplib/nexys3/nexys3_time_fx2_ic.ucf"

View File

@@ -0,0 +1,8 @@
# conf
sys_conf = sys_conf.vhd
# libs
# components
# design
../sys_tst_fx2loop_n3.vbom
@ucf_cpp: sys_tst_fx2loop_ic3_n3.ucf
@top: sys_tst_fx2loop_n3

View File

@@ -0,0 +1,30 @@
# this is the vbom for the 'generic' top level entity
# to be referenced in the vbom's of the specific systems
# ./as/sys_tst_fx2loop_as_n3
# ./ic/sys_tst_fx2loop_ic_n3
# ./ic3/sys_tst_fx2loop_ic3_n3
#
# libs
../../../vlib/slvtypes.vhd
../../../vlib/xlib/xlib.vhd
../../../vlib/genlib/genlib.vhd
../../../bplib/bpgen/bpgenlib.vbom
../tst_fx2looplib.vbom
../../../bplib/fx2lib/fx2lib.vhd
../../../bplib/nxcramlib/nxcramlib.vhd
${sys_conf}
# components
[xst,isim]../../../vlib/xlib/dcm_sfs_unisim_s3e.vbom
[ghdl]../../../vlib/xlib/dcm_sfs_gsim.vbom
../../../vlib/genlib/clkdivce.vbom
../../../bplib/bpgen/sn_humanio.vbom
../tst_fx2loop_hiomap.vbom
../tst_fx2loop.vbom
../../../bplib/fx2lib/fx2_2fifoctl_as.vbom
../../../bplib/fx2lib/fx2_2fifoctl_ic.vbom
../../../bplib/fx2lib/fx2_3fifoctl_ic.vbom
../../../bplib/nxcramlib/nx_cram_dummy.vbom
# design
sys_tst_fx2loop_n3.vhd
## no @ucf_cpp

View File

@@ -0,0 +1,364 @@
-- $Id: sys_tst_fx2loop_n3.vhd 514 2013-05-03 16:11:23Z mueller $
--
-- Copyright 2012-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 2, or at your option any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for complete details.
--
------------------------------------------------------------------------------
-- Module Name: sys_tst_fx2loop_n3 - syn
-- Description: test of Cypress EZ-USB FX2 controller
--
-- Dependencies: vlib/xlib/dcm_sfs
-- vlib/genlib/clkdivce
-- bpgen/sn_humanio
-- tst_fx2loop_hiomap
-- tst_fx2loop
-- bplib/fx2lib/fx2_2fifoctl_as [sys_conf_fx2_type="as2"]
-- bplib/fx2lib/fx2_2fifoctl_ic [sys_conf_fx2_type="ic2"]
-- bplib/fx2lib/fx2_3fifoctl_ic [sys_conf_fx2_type="ic3"]
-- bplib/nxcramlib/nx_cram_dummy
--
-- Test bench: -
--
-- Target Devices: generic
-- Tool versions: xst 13.3, 14.5; ghdl 0.29
--
-- Synthesized (xst):
-- Date Rev ise Target flop lutl lutm slic t peri ctl/MHz
-- 2013-04-25 510 14.5 P58f xc6slx16-2 416 516 68 199 p 5.3 ic3/150
-- 2013-04-24 510 13.3 O76d xc6slx16-2 417 674 68 228 p 5.3 ic3/175
-- 2012-04-09 461 13.3 O76d xc6slx16-2 429 620 48 232 p 7.2 ic3/100
--
-- 2013-04-25 510 14.5 P58f xc6slx16-2 349 427 48 163 p 5.4 ic2/150
-- 2013-04-24 510 13.3 O76d xc6slx16-2 355 569 48 208 p 5.4 ic2/175
-- 2012-04-09 461 13.3 O76d xc6slx16-2 347 499 32 175 p 7.9 ic2/100
--
-- 2013-04-24 510 13.3 O76d xc6slx16-2 299 486 32 175 p FAIL as2/100
-- 2012-04-09 461 13.3 O76d xc6slx16-2 299 460 32 164 p FAIL as2/100
--
-- Revision History:
-- Date Rev Version Comment
-- 2013-04-24 510 1.0.1 CLKDIV.CDUWIDTH now 8, support >127 sysclk
-- 2012-04-09 461 1.0 Initial version (derived from sys_tst_fx2loop_n2)
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.slvtypes.all;
use work.xlib.all;
use work.genlib.all;
use work.bpgenlib.all;
use work.tst_fx2looplib.all;
use work.fx2lib.all;
use work.nxcramlib.all;
use work.sys_conf.all;
-- ----------------------------------------------------------------------------
entity sys_tst_fx2loop_n3 is -- top level
-- implements nexys3_aif + fx2 pins
port (
I_CLK100 : in slbit; -- 100 MHz clock
I_RXD : in slbit; -- receive data (board view)
O_TXD : out slbit; -- transmit data (board view)
I_SWI : in slv8; -- n3 switches
I_BTN : in slv5; -- n3 buttons
O_LED : out slv8; -- n3 leds
O_ANO_N : out slv4; -- 7 segment disp: anodes (act.low)
O_SEG_N : out slv8; -- 7 segment disp: segments (act.low)
O_MEM_CE_N : out slbit; -- cram: chip enable (act.low)
O_MEM_BE_N : out slv2; -- cram: byte enables (act.low)
O_MEM_WE_N : out slbit; -- cram: write enable (act.low)
O_MEM_OE_N : out slbit; -- cram: output enable (act.low)
O_MEM_ADV_N : out slbit; -- cram: address valid (act.low)
O_MEM_CLK : out slbit; -- cram: clock
O_MEM_CRE : out slbit; -- cram: command register enable
I_MEM_WAIT : in slbit; -- cram: mem wait
O_MEM_ADDR : out slv23; -- cram: address lines
IO_MEM_DATA : inout slv16; -- cram: data lines
O_PPCM_CE_N : out slbit; -- ppcm: ...
O_PPCM_RST_N : out slbit; -- ppcm: ...
I_FX2_IFCLK : in slbit; -- fx2: interface clock
O_FX2_FIFO : out slv2; -- fx2: fifo address
I_FX2_FLAG : in slv4; -- fx2: fifo flags
O_FX2_SLRD_N : out slbit; -- fx2: read enable (act.low)
O_FX2_SLWR_N : out slbit; -- fx2: write enable (act.low)
O_FX2_SLOE_N : out slbit; -- fx2: output enable (act.low)
O_FX2_PKTEND_N : out slbit; -- fx2: packet end (act.low)
IO_FX2_DATA : inout slv8 -- fx2: data lines
);
end sys_tst_fx2loop_n3;
architecture syn of sys_tst_fx2loop_n3 is
signal CLK : slbit := '0';
signal RESET : slbit := '0';
signal CE_USEC : slbit := '0';
signal CE_MSEC : slbit := '0';
signal SWI : slv8 := (others=>'0');
signal BTN : slv5 := (others=>'0');
signal LED : slv8 := (others=>'0');
signal DSP_DAT : slv16 := (others=>'0');
signal DSP_DP : slv4 := (others=>'0');
signal LED_MAP : slv8 := (others=>'0');
signal HIO_CNTL : hio_cntl_type := hio_cntl_init;
signal HIO_STAT : hio_stat_type := hio_stat_init;
signal FX2_RXDATA : slv8 := (others=>'0');
signal FX2_RXVAL : slbit := '0';
signal FX2_RXHOLD : slbit := '0';
signal FX2_RXAEMPTY : slbit := '0';
signal FX2_TXDATA : slv8 := (others=>'0');
signal FX2_TXENA : slbit := '0';
signal FX2_TXBUSY : slbit := '0';
signal FX2_TXAFULL : slbit := '0';
signal FX2_TX2DATA : slv8 := (others=>'0');
signal FX2_TX2ENA : slbit := '0';
signal FX2_TX2BUSY : slbit := '1';
signal FX2_TX2AFULL : slbit := '0';
signal FX2_MONI : fx2ctl_moni_type := fx2ctl_moni_init;
begin
assert (sys_conf_clksys mod 1000000) = 0
report "assert sys_conf_clksys on MHz grid"
severity failure;
DCM : dcm_sfs
generic map (
CLKFX_DIVIDE => sys_conf_clkfx_divide,
CLKFX_MULTIPLY => sys_conf_clkfx_multiply,
CLKIN_PERIOD => 10.0)
port map (
CLKIN => I_CLK100,
CLKFX => CLK,
LOCKED => open
);
CLKDIV : clkdivce
generic map (
CDUWIDTH => 8, -- good for up to 255 MHz !
USECDIV => sys_conf_clksys_mhz,
MSECDIV => 1000)
port map (
CLK => CLK,
CE_USEC => CE_USEC,
CE_MSEC => CE_MSEC
);
HIO : sn_humanio
generic map (
BWIDTH => 5,
DEBOUNCE => sys_conf_hio_debounce)
port map (
CLK => CLK,
RESET => '0',
CE_MSEC => CE_MSEC,
SWI => SWI,
BTN => BTN,
LED => LED,
DSP_DAT => DSP_DAT,
DSP_DP => DSP_DP,
I_SWI => I_SWI,
I_BTN => I_BTN,
O_LED => O_LED,
O_ANO_N => O_ANO_N,
O_SEG_N => O_SEG_N
);
RESET <= BTN(0); -- BTN(0) will reset tester !!
HIOMAP : tst_fx2loop_hiomap
port map (
CLK => CLK,
RESET => RESET,
HIO_CNTL => HIO_CNTL,
HIO_STAT => HIO_STAT,
FX2_MONI => FX2_MONI,
SWI => SWI,
BTN => BTN(3 downto 0),
LED => LED_MAP,
DSP_DAT => DSP_DAT,
DSP_DP => DSP_DP
);
proc_led: process (SWI, LED_MAP, FX2_TX2BUSY, FX2_TX2ENA,
FX2_TXBUSY, FX2_TXENA, FX2_RXHOLD, FX2_RXVAL)
begin
if SWI(4) = '1' then
LED(7) <= '0';
LED(6) <= '0';
LED(5) <= FX2_TX2BUSY;
LED(4) <= FX2_TX2ENA;
LED(3) <= FX2_TXBUSY;
LED(2) <= FX2_TXENA;
LED(1) <= FX2_RXHOLD;
LED(0) <= FX2_RXVAL;
else
LED <= LED_MAP;
end if;
end process proc_led;
TST : tst_fx2loop
port map (
CLK => CLK,
RESET => RESET,
CE_MSEC => CE_MSEC,
HIO_CNTL => HIO_CNTL,
HIO_STAT => HIO_STAT,
FX2_MONI => FX2_MONI,
RXDATA => FX2_RXDATA,
RXVAL => FX2_RXVAL,
RXHOLD => FX2_RXHOLD,
TXDATA => FX2_TXDATA,
TXENA => FX2_TXENA,
TXBUSY => FX2_TXBUSY,
TX2DATA => FX2_TX2DATA,
TX2ENA => FX2_TX2ENA,
TX2BUSY => FX2_TX2BUSY
);
FX2_CNTL_AS : if sys_conf_fx2_type = "as2" generate
CNTL : fx2_2fifoctl_as
generic map (
RXFAWIDTH => 5,
TXFAWIDTH => 5,
CCWIDTH => sys_conf_fx2_ccwidth,
RXAEMPTY_THRES => 1,
TXAFULL_THRES => 1,
PETOWIDTH => sys_conf_fx2_petowidth,
RDPWLDELAY => sys_conf_fx2_rdpwldelay,
RDPWHDELAY => sys_conf_fx2_rdpwhdelay,
WRPWLDELAY => sys_conf_fx2_wrpwldelay,
WRPWHDELAY => sys_conf_fx2_wrpwhdelay,
FLAGDELAY => sys_conf_fx2_flagdelay)
port map (
CLK => CLK,
CE_USEC => CE_USEC,
RESET => RESET,
RXDATA => FX2_RXDATA,
RXVAL => FX2_RXVAL,
RXHOLD => FX2_RXHOLD,
RXAEMPTY => FX2_RXAEMPTY,
TXDATA => FX2_TXDATA,
TXENA => FX2_TXENA,
TXBUSY => FX2_TXBUSY,
TXAFULL => FX2_TXAFULL,
MONI => FX2_MONI,
I_FX2_IFCLK => I_FX2_IFCLK,
O_FX2_FIFO => O_FX2_FIFO,
I_FX2_FLAG => I_FX2_FLAG,
O_FX2_SLRD_N => O_FX2_SLRD_N,
O_FX2_SLWR_N => O_FX2_SLWR_N,
O_FX2_SLOE_N => O_FX2_SLOE_N,
O_FX2_PKTEND_N => O_FX2_PKTEND_N,
IO_FX2_DATA => IO_FX2_DATA
);
end generate FX2_CNTL_AS;
FX2_CNTL_IC : if sys_conf_fx2_type = "ic2" generate
CNTL : fx2_2fifoctl_ic
generic map (
RXFAWIDTH => 5,
TXFAWIDTH => 5,
PETOWIDTH => sys_conf_fx2_petowidth,
CCWIDTH => sys_conf_fx2_ccwidth,
RXAEMPTY_THRES => 1,
TXAFULL_THRES => 1)
port map (
CLK => CLK,
RESET => RESET,
RXDATA => FX2_RXDATA,
RXVAL => FX2_RXVAL,
RXHOLD => FX2_RXHOLD,
RXAEMPTY => FX2_RXAEMPTY,
TXDATA => FX2_TXDATA,
TXENA => FX2_TXENA,
TXBUSY => FX2_TXBUSY,
TXAFULL => FX2_TXAFULL,
MONI => FX2_MONI,
I_FX2_IFCLK => I_FX2_IFCLK,
O_FX2_FIFO => O_FX2_FIFO,
I_FX2_FLAG => I_FX2_FLAG,
O_FX2_SLRD_N => O_FX2_SLRD_N,
O_FX2_SLWR_N => O_FX2_SLWR_N,
O_FX2_SLOE_N => O_FX2_SLOE_N,
O_FX2_PKTEND_N => O_FX2_PKTEND_N,
IO_FX2_DATA => IO_FX2_DATA
);
end generate FX2_CNTL_IC;
FX2_CNTL_IC3 : if sys_conf_fx2_type = "ic3" generate
CNTL : fx2_3fifoctl_ic
generic map (
RXFAWIDTH => 5,
TXFAWIDTH => 5,
PETOWIDTH => sys_conf_fx2_petowidth,
CCWIDTH => sys_conf_fx2_ccwidth,
RXAEMPTY_THRES => 1,
TXAFULL_THRES => 1,
TX2AFULL_THRES => 1)
port map (
CLK => CLK,
RESET => RESET,
RXDATA => FX2_RXDATA,
RXVAL => FX2_RXVAL,
RXHOLD => FX2_RXHOLD,
RXAEMPTY => FX2_RXAEMPTY,
TXDATA => FX2_TXDATA,
TXENA => FX2_TXENA,
TXBUSY => FX2_TXBUSY,
TXAFULL => FX2_TXAFULL,
TX2DATA => FX2_TX2DATA,
TX2ENA => FX2_TX2ENA,
TX2BUSY => FX2_TX2BUSY,
TX2AFULL => FX2_TX2AFULL,
MONI => FX2_MONI,
I_FX2_IFCLK => I_FX2_IFCLK,
O_FX2_FIFO => O_FX2_FIFO,
I_FX2_FLAG => I_FX2_FLAG,
O_FX2_SLRD_N => O_FX2_SLRD_N,
O_FX2_SLWR_N => O_FX2_SLWR_N,
O_FX2_SLOE_N => O_FX2_SLOE_N,
O_FX2_PKTEND_N => O_FX2_PKTEND_N,
IO_FX2_DATA => IO_FX2_DATA
);
end generate FX2_CNTL_IC3;
SRAM_PROT : nx_cram_dummy -- connect CRAM to protection dummy
port map (
O_MEM_CE_N => O_MEM_CE_N,
O_MEM_BE_N => O_MEM_BE_N,
O_MEM_WE_N => O_MEM_WE_N,
O_MEM_OE_N => O_MEM_OE_N,
O_MEM_ADV_N => O_MEM_ADV_N,
O_MEM_CLK => O_MEM_CLK,
O_MEM_CRE => O_MEM_CRE,
I_MEM_WAIT => I_MEM_WAIT,
O_MEM_ADDR => O_MEM_ADDR,
IO_MEM_DATA => IO_MEM_DATA
);
O_PPCM_CE_N <= '1'; -- keep parallel PCM memory disabled
O_PPCM_RST_N <= '1'; --
O_TXD <= I_RXD; -- loop-back in serial port...
end syn;

View File

@@ -1,4 +1,4 @@
# configure tb_nexsy2_fusp with sys_tst_rlink_n2 target;
# configure tb_nexsy2_fusp_cuff with sys_tst_rlink_cuff_n2 target;
# use vhdl configure file (tb_tst_rlink_cuff_ic_n2.vhd) to allow
# that all configurations will co-exist in work library
${nexys2_fusp_cuff_aif := ../sys_tst_rlink_cuff_ic_n2.vbom}

View File

@@ -0,0 +1,6 @@
tb_tst_rlink_cuff_ic_n3
tb_tst_rlink_cuff_ic_n3_[sft]sim
rlink_cext_fifo_rx
rlink_cext_fifo_tx
rlink_cext_conf
*.dep_ucf_cpp

View File

@@ -0,0 +1,32 @@
# $Id: Makefile 512 2013-04-28 07:44:02Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2013-04-27 512 1.0 Initial version
#
EXE_all = tb_tst_rlink_cuff_ic_n3
#
include $(RETROBASE)/rtl/make/xflow_default_nexys3.mk
#
.PHONY : all all_ssim all_tsim clean
#
all : $(EXE_all)
all_ssim : $(EXE_all:=_ssim)
all_tsim : $(EXE_all:=_tsim)
#
clean : ise_clean ghdl_clean
rm -f sys_tst_rlink_cuff_ic_n3.ucf
#
#-----
#
include $(RETROBASE)/rtl/make/generic_ghdl.mk
include $(RETROBASE)/rtl/make/generic_xflow.mk
#
VBOM_all = $(wildcard *.vbom)
#
ifndef DONTINCDEP
include $(VBOM_all:.vbom=.dep_xst)
include $(VBOM_all:.vbom=.dep_ghdl)
include $(wildcard *.o.dep_ghdl)
endif
#

View File

@@ -0,0 +1,60 @@
-- $Id: sys_conf_sim.vhd 512 2013-04-28 07:44:02Z mueller $
--
-- Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 2, or at your option any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for complete details.
--
------------------------------------------------------------------------------
-- Package Name: sys_conf
-- Description: Definitions for sys_tst_rlink_cuff_ic_n3 (for simulation)
--
-- Dependencies: -
-- Tool versions: xst 13.3; ghdl 0.29
-- Revision History:
-- Date Rev Version Comment
-- 2013-04-27 512 1.0 Initial version
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.slvtypes.all;
package sys_conf is
constant sys_conf_clkfx_divide : positive := 1;
constant sys_conf_clkfx_multiply : positive := 1;
constant sys_conf_ser2rri_cdinit : integer := 1-1; -- 1 cycle/bit in sim
constant sys_conf_hio_debounce : boolean := false; -- no debouncers
constant sys_conf_fx2_type : string := "ic2";
-- dummy values defs for generic parameters of as controller
constant sys_conf_fx2_rdpwldelay : positive := 1;
constant sys_conf_fx2_rdpwhdelay : positive := 1;
constant sys_conf_fx2_wrpwldelay : positive := 1;
constant sys_conf_fx2_wrpwhdelay : positive := 1;
constant sys_conf_fx2_flagdelay : positive := 1;
-- pktend timer setting
-- petowidth=10 -> 2^10 30 MHz clocks -> ~33 usec (normal operation)
constant sys_conf_fx2_petowidth : positive := 10;
constant sys_conf_fx2_ccwidth : positive := 5;
-- derived constants
constant sys_conf_clksys : integer :=
(100000000/sys_conf_clkfx_divide)*sys_conf_clkfx_multiply;
constant sys_conf_clksys_mhz : integer := sys_conf_clksys/1000000;
end package sys_conf;

View File

@@ -0,0 +1 @@
../sys_tst_rlink_cuff_ic_n3.ucf_cpp

View File

@@ -0,0 +1,7 @@
# configure tb_nexsy3_fusp_cuff with sys_tst_rlink_cuff_n3 target;
# use vhdl configure file (tb_tst_rlink_cuff_ic_n3.vhd) to allow
# that all configurations will co-exist in work library
${nexys3_fusp_cuff_aif := ../sys_tst_rlink_cuff_ic_n3.vbom}
sys_conf = sys_conf_sim.vhd
../../../../../bplib/nexys3/tb/tb_nexys3_fusp_cuff.vbom
tb_tst_rlink_cuff_ic_n3.vhd

View File

@@ -0,0 +1,40 @@
-- $Id: tb_tst_rlink_cuff_ic_n3.vhd 512 2013-04-28 07:44:02Z mueller $
--
-- Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 2, or at your option any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for complete details.
--
------------------------------------------------------------------------------
-- Module Name: tb_tst_rlink_cuff_ic_n3
-- Description: Configuration for tb_tst_rlink_cuff_ic_n3 for
-- tb_nexys3_fusp_cuff
--
-- Dependencies: sys_tst_rlink_cuff_n3 (fx2_type = 'ic2')
--
-- To test: sys_tst_rlink_cuff_n3 (fx2_type = 'ic2')
--
-- Verified:
-- Date Rev Code ghdl ise Target Comment
-- 2013-01-xx xxx - 0.29 13.3 O76d xc6slx16-2 u:???
--
-- Revision History:
-- Date Rev Version Comment
-- 2013-04-27 512 1.0 Initial version
------------------------------------------------------------------------------
configuration tb_tst_rlink_cuff_ic_n3 of tb_nexys3_fusp_cuff is
for sim
for all : nexys3_fusp_cuff_aif
use entity work.sys_tst_rlink_cuff_n3;
end for;
end for;
end tb_tst_rlink_cuff_ic_n3;

View File

@@ -0,0 +1,6 @@
# configure for _*sim case
# Note: this tb uses sys_tst_rlink_n3.vbom in local directory
# (not in .. as usual) to allow a tb specific configure !!!
nexys3_fusp_cuff_aif = sys_tst_rlink_cuff_ic_n3_ssim.vhd
tb_tst_rlink_cuff_ic_n3.vbom
@top:tb_tst_rlink_cuff_ic_n3

View File

@@ -1,4 +1,4 @@
-- $Id: sys_tst_rlink_cuff_n3.vhd 476 2013-01-26 22:23:53Z mueller $
-- $Id: sys_tst_rlink_cuff_n3.vhd 512 2013-04-28 07:44:02Z mueller $
--
-- Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
@@ -32,7 +32,7 @@
--
-- Synthesized (xst):
-- Date Rev ise Target flop lutl lutm slic t peri ctl/MHz
-- 2013-01-04 469 13.3 O76d xc3s1200e-4 ??? ???? ??? ???? p ??.? ic2/ 50
-- 2013-01-04 469 13.3 O76d xc6slx16-2 ??? ???? ??? ???? p ??.? ic2/ 50
--
-- Revision History:
-- Date Rev Version Comment

View File

@@ -1,28 +0,0 @@
; $Id: 211bsd_rk_boot.pcmd 312 2010-07-04 18:25:58Z mueller $
;
; Setup file for 211bsd RK based system (w11a, in sys/tb area...)
;
; Usage:
;
; telnet_starter -d DL0 &
; telnet_starter -d DL1 &
;
; dorri -s3 @211bsd_rk_boot.pcmd (for ghdl sim of tb_w11a_s3)
; dorri -n2 @211bsd_rk_boot.pcmd (for ghdl sim of tb_w11a_n2)
;
; dorri -t @211bsd_rk_boot.pcmd (fpga link via /dev/ttyS0)
; dorri -u0,460 @211bsd_rk_boot.pcmd (fpga link via /dev/ttyUSB0)
;
.mode serv11
;
att TT0 8000
att TT1 8001
;
reset
att rk0 211bsd_rk_root.dsk
att rk1 211bsd_rk_swap.dsk
att rk2 211bsd_rk_tmp.dsk
att rk3 211bsd_rk_bin.dsk
att rk4 211bsd_rk_usr.dsk
boot rk0
server

View File

@@ -1,38 +0,0 @@
# $Id: 211bsd_rk_boot.tcl 511 2013-04-27 13:51:46Z mueller $
#
# Setup file for 211bsd RK based system (w11a, in sys/tb area...)
#
# Usage:
#
# telnet_starter -d DL0 &
# telnet_starter -d DL1 &
# torri -xxx @211bsd_rk_boot.tcl ( -xxx depends on sim or fpga connect)
#
# setup w11 cpu
puts [rlw]
# 2.11 bsd uses parity, so strip it
cpu0tta0 set to7bit 1
cpu0ttb0 set to7bit 1
# setup tcp links for terminals
cpu0tta0 att "tcp:?port=8000"
cpu0ttb0 att "tcp:?port=8001"
# setup log files
cpu0tta0 set log "tt_dl0.log?crlf"
cpu0ttb0 set log "tt_dl1.log?crlf"
# mount disks
cpu0rka0 att 211bsd_rk_root.dsk
cpu0rka1 att 211bsd_rk_swap.dsk
cpu0rka2 att 211bsd_rk_tmp.dsk
cpu0rka3 att 211bsd_rk_bin.dsk
cpu0rka4 att 211bsd_rk_usr.dsk
# and boot
#cpu0rka set trace 1
rw11::cpumon
rw11::cpucons
cpu0 boot rka0

View File

@@ -1,207 +0,0 @@
#!/usr/bin/perl -w
# $Id: dorri 510 2013-04-26 16:14:57Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2011-12-03 435 1.5 add w11a_n3 support; add break/flow control to -u
# 2010-05-29 296 1.4 allow -ux,baud (usb devnum and baudrate)
# 2010-05-28 295 1.3 w11a_s3/w11a_n2 support: -s3 and -n2 instead of -f
# add -tmu option
# 2010-05-03 287 1.2 add -u[123] options for fast usb serport
# 2009-08-01 237 1.1.1 use 115200 instead of 38400 as default baud rate
# 2009-04-26 209 1.1 add -b (batch) option
# 2009-04-11 206 1.0 Initial version
#
use 5.005; # require Perl 5.005 or higher
use strict; # require strict checking
use FileHandle;
sub print_usage;
autoflush STDOUT 1; # autoflush, so noting lost on exec later
my $opt_b;
my $opt_io = '';
my $opt_tmu;
my $pirri;
my $val_cmax="3";
my $val_time="3.";
my $val_term=",115200,1";
my $val_log="rri.log";
my $val_tb_s3="tbw ../s3board/tb/tb_w11a_s3";
my $val_tb_n2="tbw ../nexys2/tb/tb_w11a_n2";
my $val_tb_n3="tbw ../nexys3/tb/tb_w11a_n3";
my $val_tb;
my $val_e;
my @arglist;
my %baudtbl = (
"57" => 57600,
"115" => 115200,
"230" => 230400,
"460" => 460800,
"500" => 500000,
"1000" => 1000000,
"2000" => 2000000,
"3000" => 2000000
);
#
# process dorri options
#
while (scalar(@ARGV)) {
my $curarg = $ARGV[0];
if ($curarg =~ m{^-b$} ) { # -b
$opt_b = 1;
shift @ARGV;
} elsif ($curarg =~ m{^-tmu$} ) { # -tmu
$opt_tmu = 1;
shift @ARGV;
} elsif ($curarg =~ m{^-s3$} ) { # -s3
$opt_io = "f";
$val_tb = $val_tb_s3;
shift @ARGV;
} elsif ($curarg =~ m{^-n2$} ) { # -n2
$opt_io = "f";
$val_tb = $val_tb_n2;
shift @ARGV;
} elsif ($curarg =~ m{^-n3$} ) { # -n3
$opt_io = "f";
$val_tb = $val_tb_n3;
shift @ARGV;
} elsif ($curarg =~ m{^-t$} ) { # -t
$opt_io = "t";
} elsif ($curarg =~ m{^-u(\d),?} ) { # -ux...
my $devnum = $1;
my ($dev,$baud,$break,$flow) = split /,/,$curarg;
$baud = "115" unless defined $baud;
$break = 1 unless defined $break; # default: break
$flow = 1 unless defined $flow; # default: cts
if ($baud !~ m{^\d*$} || $break !~ m{^[01]$} || $flow !~ m{^[012]$}) {
print STDERR "dorri-E: invalid format of -u option\n";
exit 1;
}
my $baudrate;
if (defined $baudtbl{$baud}) {
$baudrate = $baudtbl{$baud};
} else {
print STDERR "dorri-E: invalid baudrate specification $baud\n";
exit 1;
}
$opt_io = "t";
$val_term = sprintf "/dev/ttyUSB%d,%d,%d,%d",
$devnum, $baudrate, $break, $flow;
shift @ARGV;
} elsif ($curarg =~ m{^-e$} ) { # -e <file>
print STDERR "dorri-W: multiple -e options, only last taken\n"
if defined $val_e;
shift @ARGV;
if (scalar(@ARGV) == 0 || $ARGV[0] =~ m{^-}) {
print STDERR "dorri-E: no file name after -e option\n";
exit 1;
} else {
$val_e = shift @ARGV;
if (not -r $val_e) {
print STDERR "dorri-E: file '$val_e' not found\n";
exit 1;
}
}
} else {
last;
}
}
#
# rename old log file
#
if (-r $val_log) {
my $old_log = $val_log;
$old_log =~ s{\.log}{\.old\.log};
rename $val_log, $old_log
or die "failed to rename: $!";
}
#
# check that either -s3/n2/n3 or -t given
# setup pi_rri options for either case
#
if ($opt_io eq "f") {
push @arglist, "--fifo";
push @arglist, "--run";
push @arglist, $val_tb;
} elsif ($opt_io eq "t") {
push @arglist, "--term=$val_term";
} else {
print STDERR "dorri-E: neither -s3/-n2/-n3 nor -t or -u specified\n";
print_usage();
exit 1;
}
#
# setup all other options
#
push @arglist, "--timeout=$val_time";
push @arglist, "--cmax=$val_cmax";
push @arglist, "--log=$val_log";
push @arglist, "--dserv";
push @arglist, "--tserv";
push @arglist, "--int" unless $opt_b;
if (defined $val_e) {
push @arglist, ".mode serv11";
push @arglist, "ldabs $val_e";
push @arglist, "set sim tmu 1" if $opt_tmu;
push @arglist, "start 200";
}
while (scalar(@ARGV)) {
my $curarg = shift @ARGV;
if ($curarg =~ m{^@(.*)$} && ! -r $1) {
print STDERR "dorri-E: file '$1' not found\n";
exit 1;
}
push @arglist,$curarg;
}
if (defined $val_e) {
push @arglist, "server";
}
#
# find pi_rri executable
#
$pirri=`which pi_rri`;
chomp $pirri;
if ($pirri eq "" || ! -e $pirri) {
print STDERR "dorri-E: failed to locate pi_rri\n";
exit 1;
}
#
# print command file
#
if (1) {
print "pi_rri ", join (" ", map {(m{\s}) ? "\"$_\"" : $_} @arglist) , "\n";
}
#
# and do it
#
exec $pirri, @arglist
or die "failed to exec: $!";
exit 1;
# ----------------------------------------------------------------------------
sub print_usage {
print "usage: dorri [-f] [-t] [-u(123) [-e file] <pi_rri opts and cmds>...\n";
}

View File

@@ -1,22 +0,0 @@
; $Id: uv5_boot.pcmd 312 2010-07-04 18:25:58Z mueller $
;
; Setup file for Unix V5 System
;
; Usage:
;
; telnet_starter -d DL0 &
;
; dorri -s3 @uv5_boot.pcmd (for ghdl sim of tb_w11a_s3)
; dorri -n2 @uv5_boot.pcmd (for ghdl sim of tb_w11a_n2)
;
; dorri -t @uv5_boot.pcmd (fpga link via /dev/ttyS0)
; dorri -u0,460 @uv5_boot.pcmd (fpga link via /dev/ttyUSB0)
;
.mode serv11
;
att TT0 8000
;
reset
att rk0 unix_v5_rk.dsk
boot rk0
server

View File

@@ -1,29 +0,0 @@
# $Id: uv5_boot.tcl 511 2013-04-27 13:51:46Z mueller $
#
# Setup file for Unix V5 System
#
# Usage:
#
# telnet_starter -d DL0 &
# torri -xxx @uv5_boot.tcl ( -xxx depends on sim or fpga connect)
# setup w11 cpu
puts [rlw]
# 2.11 bsd uses parity, so strip it
cpu0tta0 set to7bit 1
# setup tcp links for terminals
cpu0tta0 att "tcp:?port=8000"
# setup log files
cpu0tta0 set log "tt_dl0.log?crlf"
# mount disks
cpu0rka0 att unix_v5_rk.dsk
# and boot
#cpu0rka set trace 1
rw11::cpumon
rw11::cpucons
cpu0 boot rka0

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# $Id: telnet_wrapper 314 2010-07-09 17:38:41Z mueller $
# $Id: telnet_wrapper 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2009- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
# Copyright 2009-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
# This program is free software; you may redistribute and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -37,7 +37,7 @@ while(1) {
if ($rc != 0) {
print STDERR "telnet failed with rc=$rc\n";
}
print "enter q or <^D> to quit, otherwise reconnect: ";
print "enter q or <^D> to quit, otherwise hit <ENTER> to reconnect: ";
my $buf;
my $nc = read STDIN, $buf, 1;
if (not defined $nc) {

View File

@@ -1,8 +1,9 @@
#!/usr/bin/perl -w
# $Id: torri 511 2013-04-27 13:51:46Z mueller $
# $Id: ti_w11 516 2013-05-05 21:24:52Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2013-05-05 516 1.1 renamed to ti_w11
# 2013-04-26 510 1.0 Initial version (derived from dorri)
#
@@ -14,22 +15,24 @@ sub print_usage;
autoflush STDOUT 1; # autoflush, so noting lost on exec later
my $sysbase = "$ENV{RETROBASE}/rtl/sys_gen/w11a";
my $opt_b;
my $opt_io = '';
my $opt_f = '';
my $opt_tmu;
my $tirri;
my $val_term;
my $val_tb_s3='tbw ../s3board/tb/tb_w11a_s3';
my $val_tb_n2='tbw ../nexys2/tb/tb_w11a_n2';
my $val_tb_n3='tbw ../nexys3/tb/tb_w11a_n3';
my $val_tb_s3 = "tbw $sysbase/s3board/tb/tb_w11a_s3";
my $val_tb_n2 = "tbw $sysbase/nexys2/tb/tb_w11a_n2";
my $val_tb_n3 = "tbw $sysbase/nexys3/tb/tb_w11a_n3";
my $val_tb;
my $val_e;
my @arglist;
#
# process torri options
# process ti_w11 options
#
while (scalar(@ARGV)) {
my $curarg = $ARGV[0];
@@ -68,7 +71,7 @@ while (scalar(@ARGV)) {
$baud = '115k' unless defined $baud;
if ($baud !~ m{^\d*k?$}) {
print STDERR "torri-E: invalid format of -ts or -tu option\n";
print STDERR "ti_w11-E: invalid format of -ts or -tu option\n";
exit 1;
}
@@ -83,16 +86,16 @@ while (scalar(@ARGV)) {
shift @ARGV;
} elsif ($curarg =~ m{^-e$} ) { # -e <file>
print STDERR "torri-W: multiple -e options, only last taken\n"
print STDERR "ti_w11-W: multiple -e options, only last taken\n"
if defined $val_e;
shift @ARGV;
if (scalar(@ARGV) == 0 || $ARGV[0] =~ m{^-}) {
print STDERR "torri-E: no file name after -e option\n";
print STDERR "ti_w11-E: no file name after -e option\n";
exit 1;
} else {
$val_e = shift @ARGV;
if (not -r $val_e) {
print STDERR "torri-E: file '$val_e' not found\n";
print STDERR "ti_w11-E: file '$val_e' not found\n";
exit 1;
}
}
@@ -114,7 +117,7 @@ if ($opt_io eq 'f') {
} elsif ($opt_io eq 'u') {
push @arglist, '--cuff';
} else {
print STDERR "torri-E: neither -s3/-n2/-n3 nor -t or -u specified\n";
print STDERR "ti_w11-E: neither -s3/-n2/-n3 nor -t or -u specified\n";
print_usage();
exit 1;
}
@@ -171,7 +174,7 @@ if (defined $val_e) {
while (scalar(@ARGV)) {
my $curarg = shift @ARGV;
if ($curarg =~ m{^@(.*)$} && ! -r $1) {
print STDERR "torri-E: file '$1' not found\n";
print STDERR "ti_w11-E: file '$1' not found\n";
exit 1;
}
push @arglist,$curarg;
@@ -184,7 +187,7 @@ while (scalar(@ARGV)) {
$tirri=`which ti_rri`;
chomp $tirri;
if ($tirri eq '' || ! -e $tirri) {
print STDERR "torri-E: failed to locate ti_rri\n";
print STDERR "ti_w11-E: failed to locate ti_rri\n";
exit 1;
}
@@ -205,7 +208,7 @@ exit 1;
# ----------------------------------------------------------------------------
sub print_usage {
print "usage: torri <setup options> <ti_rri opts and cmds>...\n";
print "usage: ti_w11 <setup options> <ti_rri opts and cmds>...\n";
print " setup options for ghdl simulation runs:\n";
print " -s3 start tb_w11a_s3 simulation\n";
print " -n2 start tb_w11a_n2 simulation\n";

View File

@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
# $Id: vbomconv 456 2012-02-05 22:19:44Z mueller $
# $Id: vbomconv 518 2013-05-12 16:45:02Z mueller $
#
# Copyright 2007-2012 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
@@ -251,7 +251,7 @@ if (exists $opts{ghdl_i} || exists $opts{ghdl_i_cmd}) {
# architecture <arch> of <entity> at nn( nn) + nn on nn;
if (-r "work-obj93.cf") {
open (WFILE, "work-obj93.cf") or
open (WFILE, "work-obj93.cf") or
die "can't open for read work-obj93.cf: $!";
while (<WFILE>) {
if (m{^file \. \"(.*?)\"}) {

View File

@@ -1,7 +1,8 @@
# $Id: generic_so.mk 354 2011-01-09 22:38:53Z mueller $
# $Id: generic_so.mk 515 2013-05-04 17:28:59Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2013-05-03 515 1.0.1 use 'mkdir -p' to prevent aborts with -j 4
# 2011-01-09 354 1.0 Initial version (from wrepo/make/generic_so.mk)
#---
#
@@ -28,7 +29,7 @@ libs : $(SOPATH)/$(AFILE) $(SOPATH)/$(SOFILEVV)
# Build the sharable library
#
$(SOPATH)/$(SOFILEVV) : $(OBJ_all)
if [ ! -d $(SOPATH) ]; then mkdir $(SOPATH); fi
if [ ! -d $(SOPATH) ]; then mkdir -p $(SOPATH); fi
$(CXX) -shared -Wl,-soname,$(SOFILEV) -o $(SOPATH)/$(SOFILEVV) \
$(OBJ_all) $(LDLIBS)
(cd $(SOPATH); rm -f $(SOFILE) $(SOFILEV))
@@ -38,6 +39,6 @@ $(SOPATH)/$(SOFILEVV) : $(OBJ_all)
# Build an archive
#
$(SOPATH)/$(AFILE) : $(OBJ_all)
if [ ! -d $(SOPATH) ]; then mkdir $(SOPATH); fi
if [ ! -d $(SOPATH) ]; then mkdir -p $(SOPATH); fi
ar -scruv $(SOPATH)/$(AFILE) $?
#

View File

@@ -0,0 +1,5 @@
*.dat
*.dsk
*.log
*license.txt
*license.pdf

View File

@@ -0,0 +1,19 @@
; $Id: 211bsd_rk_boot.scmd 517 2013-05-09 21:34:45Z mueller $
;
; Setup file for 211bsd RK based system
;
; Usage:
;
; pdp11 211bsd_rk_boot.scmd
;
do ../../simh/setup_w11a_max.scmd
set tto 7b
set dlo0 7b
;
att rk0 211bsd_rk_root.dsk
att rk1 211bsd_rk_swap.dsk
att rk2 211bsd_rk_tmp.dsk
att rk3 211bsd_rk_bin.dsk
att rk4 211bsd_rk_usr.dsk
;
boo rk0

View File

@@ -0,0 +1,29 @@
# $Id: 211bsd_rk_boot.tcl 517 2013-05-09 21:34:45Z mueller $
#
# Setup file for 211bsd RK05 based system
#
# Usage:
#
# telnet_starter -d DL0 &
# telnet_starter -d DL1 &
# ti_w11 -xxx @211bsd_rk_boot.tcl ( -xxx depends on sim or fpga connect)
#
# setup w11 cpu
puts [rlw]
# setup tt,lp (211bsd uses parity -> use 7 bit mode)
rw11::setup_tt "cpu0" {to7bit 1}
rw11::setup_lp
# mount disks
cpu0rka0 att 211bsd_rk_root.dsk
cpu0rka1 att 211bsd_rk_swap.dsk
cpu0rka2 att 211bsd_rk_tmp.dsk
cpu0rka3 att 211bsd_rk_bin.dsk
cpu0rka4 att 211bsd_rk_usr.dsk
# and boot
rw11::cpumon
rw11::cpucons
cpu0 boot rka0

View File

@@ -0,0 +1,123 @@
# $Id: README_211bsd_rkset.txt 518 2013-05-12 16:45:02Z mueller $
Notes on oskit: 2.11BSD system on RK05 volumes
Table of content:
1. General remarks
2. Installation
3. Usage
1. General remarks ---------------------------------------------------
See notes on
1. I/O emulation setup
2. FPGA Board setup
3. Rlink and Backend Server setup
4. Legal terms
in $RETROBASE/doc/w11a_os_guide.txt
2. Installation ------------------------------------------------------
- A disk set is available from
http://www.retro11.de/data/oc_w11/211bsd_rkset.tgz
Download, unpack and copy the disk images (*.dsk), e.g.
cd $RETROBASE/tools/oskit/211bsd_rk/
wget http://www.retro11.de/data/oc_w11/211bsd_rkset.tgz
tar -xzf 211bsd_rkset.tgz
3. Usage -------------------------------------------------------------
- Start backend server and boot system (see section 3 in w11a_os_guide.txt)
boot script: 211bsd_rk_boot.tcl
example: ti_w11 -u @211bsd_rk_boot.tcl
- Hit <ENTER> in the xterm window to connnect to backend server.
The boot dialog in the console xterm window will look like
(required input is in {..}, with {<CR>} denoting a carriage return:
70Boot from rk(0,0,0) at 0177404
: {<CR>}
: rk(0,0,0)unix
Boot: bootdev=03000 bootcsr=0177404
2.11 BSD UNIX #26: Thu Jan 1 19:49:13 PST 2009
root@curly.2bsd.com:/usr/src/sys/RETRONFPRK
phys mem = 3932160
avail mem = 3577856
user mem = 307200
January 4 16:45:33 init: configure system
dz ? csr 160100 vector 310 skipped: No CSR.
lp 0 csr 177514 vector 200 attached
rk ? csr 177400 vector 220 didn't interrupt.
rl ? csr 174400 vector 160 skipped: No CSR.
tm ? csr 172520 vector 224 skipped: No CSR.
xp ? csr 176700 vector 254 skipped: No CSR.
cn 1 csr 176500 vector 300 attached
erase, kill ^U, intr ^C
In first '#' prompt the system is in single-user mode. Just enter a ^D
to continue the system startup to multi-user mode:
#^D
checking quotas: done.
Assuming non-networking system ...
checking for core dump...
preserving editor files
clearing /tmp
standard daemons: update cron accounting.
starting lpd
starting local daemons:Sun Jan 4 16:46:37 PST 2009
January 4 16:46:37 init: kernel security level changed from 0 to 1
January 4 16:46:40 getty: /dev/tty01: Device not configured
...
2.11 BSD UNIX (curly.2bsd.com) (console)
login:
The login prompt is sometimes mangled with the 'Device not configured'
system messages, if its not visible just hit <ENTER> to get a fresh one.
login: {root}
erase, kill ^U, intr ^C
Now the system is in multi-user mode, daemons runnng. You can explore
the system, e.g. with a 'pstat -T' or a 'mount' command. The second
xterm can be activated too, it will connect to a second emulated DL11.
At the end is important to shutdown properly with a 'halt':
# {pstat -T}
7/186 files
39/208 inodes
11/150 processes
6/ 46 texts active, 28 used
2/135 swapmap entries, 366 kB used, 2069 kB free, 2063 kB max
33/150 coremap entries, 2960 kB free, 2867 kB max
1/ 10 ub_map entries, 10 free, 10 max
# {mount}
/dev/rk0h on /
/dev/rk2h on /tmp
/dev/rk3h on /bin
/dev/rk4h on /usr
# {halt}
syncing disks... done
halting
While the system was running the server process display the
cpumon>
prompt. When the w11 has halted after 211bsd shutdown a message like
CPU down attention
Processor registers and status:
PS: 030350 cm,pm=k,u s,p,t=0,7,0 NZVC=1000 rust: 01 HALTed
R0: 177560 R1: 161322 R2: 053436 R3: 000010
R4: 003000 R5: 147510 SP: 147466 PC: 000014
will be visible. Now the server process can be stopped with ^D.

View File

@@ -0,0 +1,4 @@
*.dat
*.dsk
*.log
*license.txt

View File

@@ -0,0 +1,93 @@
# $Id: README_rsx11m-31_rkset.txt 518 2013-05-12 16:45:02Z mueller $
Notes on oskit: RSX-11M V3.1 system on RK05 volumes
Table of content:
1. General remarks
2. Installation
3. Usage
1. General remarks ---------------------------------------------------
See notes, especially on legal terms, in $RETROBASE/doc/w11a_os_guide.txt
Also read README_license.txt !!
2. Installation ------------------------------------------------------
- A disk set is available from
http://www.retro11.de/data/oc_w11/rsx11m-31_rkset.tgz
Download, unpack and copy the disk images (*.dsk), e.g.
cd $RETROBASE/tools/oskit/rsx11m-31_rk
wget http://www.retro11.de/data/oc_w11/rsx11m-31_rkset.tgz
tar -xzf rsx11m-31_rkset.tgz
3. Usage -------------------------------------------------------------
- Start them in simulator
pdp11 rsx11m-31_rk_boot.scmd
or ONLY IF YOU HAVE A VALID LICENSE on w11a
ti_w11 -u @rsx11m-31_rk_boot.tcl
- Hit <ENTER> in the xterm window to connect to simh or backend server.
The boot dialog in the console xterm window will look like
(required input is in {..}, with {<CR>} denoting a carriage return:
RSX-11M V3.1 BL22 65408K MAPPED
>RED DK0:=SY0:
>RED DK0:=LB0:
>MOU DK0:SYSTEM0
>@[1,2]STARTUP
That RSX shows '65408K' is a bug in V3.1. It should be 1920K' the
size of accessible memory in words. For configurations with 1 MByte
and below the correct value is displayed, above a wrong one.
This os version was released in December 1977, so it's no suprise
that it is not y2k ready. So enter a date before prior to 2000.
>* PLEASE ENTER TIME AND DATE (HR:MN DD-MMM-YY) [S]: {<.. see above ..>}
>TIM 17:18 12-may-83
>;
>RUN ERRLOG
>
;ERL -- ERROR LOG INITIALIZED
>MOU DK1:SYSTEM1
>;
>INS DK1:[1,54]BIGMAC/PAR=GEN
>INS DK1:[1,54]BIGTKB/PAR=GEN
>INS DK1:[1,54]CDA
>INS DK1:[1,54]DSC/PAR=GEN
>INS DK1:[1,54]EDT/PAR=GEN
>INS DK1:[1,54]FLX
>INS DK1:[1,54]FOR
>INS DK1:[1,54]FTB
>INS DK1:[1,54]LBR
>INS DK1:[1,54]PSE
>INS DK1:[1,54]RNO
>INS DK1:[1,54]SRD
>INS DK1:[1,54]SYE
>;
>INS DK1:[1,54]TEC
>INS DK1:[1,54]TEC/TASK=...MAK
>INS DK1:[1,54]TEC/TASK=...MUN
>;
>INS DK1:[1,54]VTEC
>;
>;
>SET /UIC=[1,6]
>PSE =
>SET /UIC=[200,200]
>;
>ACS DK1:/BLKS=512.
>;
>@ <EOF>
>
Now you are at the MCR prompt and can exercise the system.
At the end is important to shutdown properly with a 'run $shutup'.
The simululaor (or the rlink backend) can be stopped when the
CPU has halted.

View File

@@ -0,0 +1,15 @@
; $Id: rsx11m-31_rk_boot.scmd 517 2013-05-09 21:34:45Z mueller $
;
; Setup file for RSX11-M V3.1 RK05 based system
;
; Usage:
;
; pdp11 rsx11m-31_rk_boot.scmd
;
do ../../simh/setup_w11a_max.scmd
;
att rk0 RSX11M_V3.1_SYSTEM0.dsk
att rk1 RSX11M_V3.1_SYSTEM1.dsk
att rk2 RSX11M_USER.dsk
;
boo rk0

View File

@@ -0,0 +1,28 @@
# $Id: rsx11m-31_rk_boot.tcl 517 2013-05-09 21:34:45Z mueller $
#
# Setup file for RSX11-M V3.1 RK05 based system
#
# Usage:
#
# telnet_starter -d DL0 &
# telnet_starter -d DL1 &
# ti_w11 -xxx @rsx11m-31_rk_boot.tcl ( -xxx depends on sim or fpga connect)
#
# setup w11 cpu
puts [rlw]
# setup tt,lp,pp (enable rx rate limiter on old DEC OS)
rw11::setup_tt "cpu0" {dlrlim 5}
rw11::setup_lp
rw11::setup_pp
# mount disks
cpu0rka0 att RSX11M_V3.1_SYSTEM0.dsk
cpu0rka1 att RSX11M_V3.1_SYSTEM1.dsk
cpu0rka2 att RSX11M_USER.dsk
# and boot
rw11::cpumon
rw11::cpucons
cpu0 boot rka0

View File

@@ -0,0 +1,4 @@
*.dat
*.dsk
*.log
*license.txt

View File

@@ -0,0 +1,83 @@
# $Id: README_rsx11m-40_rkset.txt 518 2013-05-12 16:45:02Z mueller $
Notes on oskit: RSX-11M V4.0 system on RK05 volumes
Table of content:
1. General remarks
2. Installation
3. Usage
1. General remarks ---------------------------------------------------
See notes, especially on legal terms, in $RETROBASE/doc/w11a_os_guide.txt
Also read README_license.txt !!
2. Installation ------------------------------------------------------
- A disk set is available from
http://www.retro11.de/data/oc_w11/rsx11m-40_rkset.tgz
Download, unpack and copy the disk images (*.dsk), e.g.
cd $RETROBASE/tools/oskit/rsx11m-40_rk
wget http://www.retro11.de/data/oc_w11/rsx11m-40_rkset.tgz
tar -xzf rsx11m-40_rkset.tgz
3. Usage -------------------------------------------------------------
- Start them in simulator
pdp11 rsx11m-40_rk_boot.scmd
or ONLY IF YOU HAVE A VALID LICENSE on w11a
ti_w11 -u @rsx11m-40_rk_boot.tcl
- Hit <ENTER> in the xterm window to connect to simh or backend server.
The boot dialog in the console xterm window will look like
(required input is in {..}, with {<CR>} denoting a carriage return:
RSX-11M V4.0 BL32 1920.K MAPPED
>RED DK:=SY:
>RED DK:=LB:
>MOU DK:SYSM40RKV0
>@DK:[1,2]STARTUP
This os version was released in November 1981, so it's no suprise
that it is not y2k ready. So enter a date before prior to 2000.
>* PLEASE ENTER TIME AND DATE (HR:MN DD-MMM-YY) [S]: {<.. see above ..>}
>TIM 18:17 12-may-83
>* ENTER LINE WIDTH OF THIS TERMINAL [D D:132.]: {<CR>}
>SET /BUF=TI:132.
>ACS SY:/BLKS=512.
>CLI /INIT=DCL/TASK=...DCL
>;
>; mount 2nd system disk
>;
>mou dk1:SYSM40RKV1/pub
>;
>; installing tasks from 2nd system disk
>;
>INS DK1:$BRU
>INS DK1:$DMP
>INS DK1:$DSC
>INS DK1:$EDT
>INS DK1:$FLX
>INS DK1:$K11RSX/TASK=...KER
>INS DK1:$LBR
>INS DK1:$MAC
>INS DK1:$RMD
>INS DK1:$SLP
>INS DK1:$SRD
>INS DK1:$TEC
>INS DK1:$TEC/TASK=...MAK
>INS DK1:$TKB
>INS DK1:$VFY
>INS DK1:$VTEC
>@ <EOF>
>
Now you are at the MCR prompt and can exercise the system.
At end is important to shutdown properly with a 'run $shutup'.
The simululaor (or the rlink backend) can be stopped when the
CPU has halted.

View File

@@ -0,0 +1,15 @@
; $Id: $
;
; Setup file for RSX11-M V4.0 RK05 based system
;
; Usage:
;
; pdp11 rsx11m-40_rk_boot.scmd
;
do ../../simh/setup_w11a_max.scmd
;
att rk0 RSX11M_V4.0_SYSTEM0.dsk
att rk1 RSX11M_V4.0_SYSTEM1.dsk
att rk2 RSX11M_USER.dsk
;
boo rk0

View File

@@ -0,0 +1,28 @@
# $Id: $
#
# Setup file for RSX11-M V4.0 RK05 based system
#
# Usage:
#
# telnet_starter -d DL0 &
# telnet_starter -d DL1 &
# ti_w11 -xxx @rsx11m-40_rk_boot.tcl ( -xxx depends on sim or fpga connect)
#
# setup w11 cpu
puts [rlw]
# setup tt,lp,pp (enable rx rate limiter on old DEC OS)
rw11::setup_tt "cpu0" {dlrlim 5}
rw11::setup_lp
rw11::setup_pp
# mount disks
cpu0rka0 att RSX11M_V4.0_SYSTEM0.dsk
cpu0rka1 att RSX11M_V4.0_SYSTEM1.dsk
cpu0rka2 att RSX11M_USER.dsk
# and boot
rw11::cpumon
rw11::cpucons
cpu0 boot rka0

View File

@@ -0,0 +1,4 @@
*.dat
*.dsk
*.log
*license.txt

View File

@@ -0,0 +1,61 @@
# $Id: $
Notes on oskit: RT-11 V4.0 system on RK05 volumes
Table of content:
1. General remarks
2. Installation
3. Usage
1. General remarks ---------------------------------------------------
See notes, especially on legal terms, in $RETROBASE/doc/w11a_os_guide.txt
Also read README_license.txt !!
2. Installation ------------------------------------------------------
- A disk set is available from
http://www.retro11.de/data/oc_w11/rsx11m-31_rkset.tgz
Download, unpack and copy the disk images (*.dsk), e.g.
cd $RETROBASE/tools/oskit/rt11-40_rk
wget http://www.retro11.de/data/oc_w11/rt11-40_rkset.tgz
tar -xzf rt11-40_rkset.tgz
3. Usage -------------------------------------------------------------
- Start them in simulator
pdp11 rt11-40_rk_boot.scmd
or ONLY IF YOU HAVE A VALID LICENSE on w11a
ti_w11 -u @rt11-40_rk_boot.tcl
- Hit <ENTER> in the xterm window to connect to simh or backend server.
The boot dialog in the console xterm window will look like
(required input is in {..}, with {<CR>} denoting a carriage return:
RT-11SJ V04.00C
.D 56=5015
.TYPE V4USER.TXT
Welcome to RT-11 Version 4. RT-11 V04 provides new hardware support
and some major enhancements over Version 3B.
Please use the HELP command; it describes the new options in many
of the utilities.
If you are using a terminal that requires fill characters,
modify location 56 with a Deposit command before proceeding with
system installation. LA36 DECwriter II and VT52 DECscope terminals
do NOT require such modification.
.D 56=0
.
Now you are at the RT-11 prompt and can exercise the system.
There is no 'halt' or 'shutdown' command, just terminate the
simulator or backend server session.

View File

@@ -0,0 +1,13 @@
; $Id: rt11-40_rk_boot.scmd 517 2013-05-09 21:34:45Z mueller $
;
; Setup file for RT-11 V4.0 RK05 based system
;
; Usage:
;
; pdp11 rt11-40_rk_boot.scmd
;
do ../../simh/setup_w11a_min.scmd
;
att rk0 rtv4_rk.dsk
;
boo rk0

View File

@@ -0,0 +1,25 @@
# $Id: rt11-40_rk_boot.tcl 517 2013-05-09 21:34:45Z mueller $
#
# Setup file for RT-11 V4.0 RK05 based system
#
# Usage:
#
# telnet_starter -d DL0 &
# ti_w11 -xxx @rt11-40_rk_boot.tcl ( -xxx depends on sim or fpga connect)
#
# setup w11 cpu
puts [rlw]
# setup tt,lp,pp (single console; enable rx rate limiter on old DEC OS)
rw11::setup_tt "cpu0" {ndl 1 dlrlim 5}
rw11::setup_lp
rw11::setup_pp
# mount disks
cpu0rka0 att rtv4_rk.dsk
# and boot
rw11::cpumon
rw11::cpucons
cpu0 boot rka0

View File

@@ -0,0 +1,5 @@
*.dat
*.dsk
*.log
*license.txt
*license.pdf

View File

@@ -0,0 +1,64 @@
# $Id: README_unix_v5_rkset.txt 518 2013-05-12 16:45:02Z mueller $
Notes on oskit: Unix V5 system on RK05 volumes
Table of content:
1. General remarks
2. Installation
3. Usage
1. General remarks ---------------------------------------------------
See notes on
1. I/O emulation setup
2. FPGA Board setup
3. Rlink and Backend Server setup
4. Legal terms
in $RETROBASE/doc/w11a_os_guide.txt
2. Installation ------------------------------------------------------
- A disk set is available from
http://www.retro11.de/data/oc_w11/unix_v5_rkset.tgz
Download, unpack and copy the disk images (*.dsk), e.g.
cd $RETROBASE/tools/oskit/unix-v5_rk
wget http://www.retro11.de/data/oc_w11/unix_v5_rkset.tgz
tar -xzf unix_v5_rkset.tgz
3. Usage -------------------------------------------------------------
- Start backend server and boot system (see section 3 in w11a_os_guide.txt)
boot script: uv5_rk_boot.tcl
example: ti_w11 -u @uv5_rk_boot.tcl
- Hit <ENTER> in the xterm window to connect to backend server.
The boot dialog in the console xterm window will look like
(required input is in {..}, with {<CR>} denoting a carriage return:
@{unix}
login: {root}
Now you are at the shell prompt and can exercise the system, e.g.
# {ls -al}
total 62
drwxr-xr-x 9 bin 160 Jan 29 16:14 .
drwxr-xr-x 9 bin 160 Jan 29 16:14 ..
drwxr-xr-x 2 bin 944 Nov 26 18:13 bin
drwxr-xr-x 2 bin 80 Nov 26 18:13 dev
drwxr-xr-x 2 bin 240 Mar 21 12:07 etc
drwxr-xr-x 2 bin 224 Nov 26 18:13 lib
drwxr-xr-x 2 bin 32 Nov 26 18:13 mnt
drwxrwxrwx 2 bin 32 Nov 26 18:13 tmp
-rwxrwxrwx 1 bin 25802 Mar 21 12:07 unix
drwxr-xr-x 14 bin 224 Nov 26 18:13 usr
There is no 'halt' or 'shutdown' command, just terminate the server
session with a
tirri_exit
command. The disks aren't cached, so no need to sync either.

View File

@@ -0,0 +1,15 @@
; $Id: uv5_rk_boot.scmd 517 2013-05-09 21:34:45Z mueller $
;
; Setup file for Unix V5 RK05 based system
;
; Usage:
;
; pdp11 uv5_rk_boot.scmd
;
do ../../simh/setup_w11a_min.scmd
set tto 7b
set dlo0 7b
;
att rk0 unix_v5_rk.dsk
;
boo rk0

View File

@@ -0,0 +1,23 @@
# $Id: uv5_rk_boot.tcl 517 2013-05-09 21:34:45Z mueller $
#
# Setup file for Unix V5 RK05 based system
#
# Usage:
#
# telnet_starter -d DL0 &
# ti_w11 -xxx @uv5_boot.tcl ( -xxx depends on sim or fpga connect)
# setup w11 cpu
puts [rlw]
# setup tt,lp (uses only 1 console; uses parity -> use 7 bit mode)
rw11::setup_tt "cpu0" {ndl 1 to7bit 1}
rw11::setup_lp
# mount disks
cpu0rka0 att unix_v5_rk.dsk
# and boot
rw11::cpumon
rw11::cpucons
cpu0 boot rka0

View File

@@ -0,0 +1,97 @@
; $Id: setup_w11a_max.scmd 518 2013-05-12 16:45:02Z mueller $
;
; Setup file for 'maximal' w11a configuration under simh 3.8 and above
;
; This setup reflects the planned w11a system on a Nexys[234] board
; --> 4 MByte, 2 DL11, DZ+LP+PC, RK05+RL02+RP06+TM11, DEUNA
;
; 11/70 CPU no FPP, 1 MByte memory
; 2 DL11
; 1 DZ11
; 1 LP11
; 1 PC11
; 1 RK11 + 8 RK05 drives
; 1 RL11 + 4 RL01/02 drives
; 1 RH70 + 4 RP06 drives
; 1 TM11 + 4 drives
; 1 DEUNA
;
; processor options
;
set cpu 11/70
set cpu nofpp
set cpu 4m
set cpu oct
set cpu idle
;
; clock options
;
set clk 50hz
;
; terminal interface options
; the default tti time=0 setting gives 50 chars/sec, slow
; setting time=50000 (means 1 char every 50000 instructions) is much
; faster and seems still save for old DEC OS like XXDP, RT-11, RXS11-M
;
set cons log=simh_dl0.log
dep tti time 50000
set tto 8b
;
; 2nd DL11 interface options
; Note: set dli vector=300 not allowed, rely on autoconf to set vec->300
; Note: default for DLO's is UC ! -> set to 8bit
;
set dli enabled
set dli lines=1
att dli 5670
set dlo0 log=simh_dl1.log
set dlo0 8b
;
set dz enabled
set dz lines=8
set dz vector=310
att dz -m 5671
set dz log=0=simh_dz0.log
set dz log=1=simh_dz1.log
set dz log=2=simh_dz2.log
; dz log file names must be quoted, otherwise they'll be uppercased !
;
; line printer
;
set lpt enabled
att lpt simh_lpt.dat
;
; paper tape read/punch
;
set ptr enabled
set ptp enabled
att ptp simh_ptp.dat
;
; disk drives
;
set rk enabled
;
set rl enabled
;
set rha enabled
set rp enabled
;
; tape drives
;
set tm enabled
;
; ethernet interfaces
;
set xu enabled
;
; DISABLE all else
;
set cr disabled
set vh disabled
set hk disabled
set rx disabled
set rq disabled
set tq disabled
;
;sho conf
;

View File

@@ -0,0 +1,85 @@
; $Id: setup_w11a_min.scmd 518 2013-05-12 16:45:02Z mueller $
;
; Setup file for 'minimal' w11a configuration under simh 3.8 and above
;
; This setup reflects the current w11a system on a S3BOARD
; --> 1MByte, 2 DL11, LP+PC, RK05
;
; 11/70 CPU no FPP, 1 MByte memory
; 2 DL11
; 0 DZ11
; 1 LP11
; 1 PC11
; 1 RK11 + 8 RK05 drives
; 0 RL11 + 0 RL01/02 drives
; 0 RH70 + 0 RP06 drives
; 0 TM11 + 0 drives
; 0 DEUNA
;
; processor options
;
set cpu 11/70
set cpu nofpp
set cpu 1m
set cpu oct
set cpu idle
;
; clock options
;
set clk 50hz
;
; terminal interface options
; the default tti time=0 setting gives 50 chars/sec, slow
; setting time=50000 (means 1 char every 50000 instructions) is much
; faster and seems still save for old DEC OS like XXDP, RT-11, RXS11-M
;
set cons log=simh_dl0.log
dep tti time 50000
set tto 8b
;
; 2nd DL11 interface options
; Note: set dli vector=300 not allowed, rely on autoconf to set vec->300
; Note: default for DLO's is UC ! -> set to 8bit
;
set dli enabled
set dli lines=1
att dli 5670
set dlo0 log=simh_dl1.log
set dlo0 8b
;
; line printer
;
set lpt enabled
att lpt simh_lpt.dat
;
; paper tape read/punch
;
set ptr enabled
set ptp enabled
att ptp simh_ptp.dat
;
; disk drives
;
set rk enabled
;
; tape drives (none)
; ethernet interfaces (none)
;
; DISABLE all else
;
set dz disabled
set rl disabled
set rha disabled
set rp disabled
set tm disabled
set xu disabled
;
set cr disabled
set vh disabled
set hk disabled
set rx disabled
set rq disabled
set tq disabled
;
;sho conf
;

View File

@@ -1,4 +1,4 @@
// $Id: ReventLoop.hpp 494 2013-03-03 21:50:07Z mueller $
// $Id: ReventLoop.hpp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.1.1 fTraceLevel now uint32_t
// 2013-02-22 491 1.1 use new RlogFile/RlogMsg interfaces
// 2013-01-11 473 1.0 Initial version
// ---------------------------------------------------------------------------
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: ReventLoop.hpp 494 2013-03-03 21:50:07Z mueller $
\version $Id: ReventLoop.hpp 513 2013-05-01 14:02:06Z mueller $
\brief Declaration of class \c ReventLoop.
*/
@@ -55,8 +56,8 @@ namespace Retro {
void RemovePollHandler(int fd);
void SetLogFile(const boost::shared_ptr<RlogFile>& splog);
void SetTraceLevel(size_t level);
size_t TraceLevel() const;
void SetTraceLevel(uint32_t level);
uint32_t TraceLevel() const;
void Stop();
virtual void EventLoop();
@@ -84,7 +85,7 @@ namespace Retro {
std::vector<PollDsc> fPollDsc;
std::vector<pollfd> fPollFd;
std::vector<pollhdl_t> fPollHdl;
size_t fTraceLevel; //!< trace level
uint32_t fTraceLevel; //!< trace level
boost::shared_ptr<RlogFile> fspLog; //!< log file ptr
};

View File

@@ -1,4 +1,4 @@
// $Id: ReventLoop.ipp 491 2013-02-23 12:41:18Z mueller $
// $Id: ReventLoop.ipp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.1.1 fTraceLevel now uint32_t
// 2013-02-22 491 1.1 use new RlogFile/RlogMsg interfaces
// 2013-01-11 473 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: ReventLoop.ipp 491 2013-02-23 12:41:18Z mueller $
\version $Id: ReventLoop.ipp 513 2013-05-01 14:02:06Z mueller $
\brief Implemenation (inline) of class ReventLoop.
*/
@@ -47,7 +48,7 @@ inline void ReventLoop::SetLogFile(const boost::shared_ptr<RlogFile>& splog)
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline void ReventLoop::SetTraceLevel(size_t level)
inline void ReventLoop::SetTraceLevel(uint32_t level)
{
fTraceLevel = level;
return;
@@ -56,7 +57,7 @@ inline void ReventLoop::SetTraceLevel(size_t level)
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t ReventLoop::TraceLevel() const
inline uint32_t ReventLoop::TraceLevel() const
{
return fTraceLevel;
}

View File

@@ -1,4 +1,4 @@
// $Id: RlinkPort.hpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RlinkPort.hpp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.2.1 fTraceLevel now uint32_t
// 2013-02-23 492 1.2 use RparseUrl
// 2013-02-22 491 1.1 use new RlogFile/RlogMsg interfaces
// 2013-01-27 477 1.0.3 add RawRead(),RawWrite() methods
@@ -25,7 +26,7 @@
/*!
\file
\version $Id: RlinkPort.hpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RlinkPort.hpp 513 2013-05-01 14:02:06Z mueller $
\brief Declaration of class RlinkPort.
*/
@@ -69,8 +70,8 @@ namespace Retro {
int FdWrite() const;
void SetLogFile(const boost::shared_ptr<RlogFile>& splog);
void SetTraceLevel(size_t level);
size_t TraceLevel() const;
void SetTraceLevel(uint32_t level);
uint32_t TraceLevel() const;
const Rstats& Stats() const;
@@ -101,7 +102,7 @@ namespace Retro {
int fFdRead; //!< fd for read
int fFdWrite; //!< fd for write
boost::shared_ptr<RlogFile> fspLog; //!< log file ptr
size_t fTraceLevel; //!< trace level
uint32_t fTraceLevel; //!< trace level
Rstats fStats; //!< statistics
};

View File

@@ -1,4 +1,4 @@
// $Id: RlinkPort.ipp 492 2013-02-24 22:14:47Z mueller $
// $Id: RlinkPort.ipp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.2.1 fTraceLevel now uint32_t
// 2013-02-23 492 1.2 use RparseUrl
// 2013-02-22 491 1.1 use new RlogFile/RlogMsg interfaces
// 2011-03-27 375 1.0 Initial version
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RlinkPort.ipp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RlinkPort.ipp 513 2013-05-01 14:02:06Z mueller $
\brief Implemenation (inline) of RlinkPort.
*/
@@ -72,7 +73,7 @@ inline void RlinkPort::SetLogFile(const boost::shared_ptr<RlogFile>& splog)
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline void RlinkPort::SetTraceLevel(size_t level)
inline void RlinkPort::SetTraceLevel(uint32_t level)
{
fTraceLevel = level;
return;
@@ -81,7 +82,7 @@ inline void RlinkPort::SetTraceLevel(size_t level)
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t RlinkPort::TraceLevel() const
inline uint32_t RlinkPort::TraceLevel() const
{
return fTraceLevel;
}

View File

@@ -1,4 +1,4 @@
// $Id: RlinkPortCuff.cpp 504 2013-04-13 15:37:24Z mueller $
// $Id: RlinkPortCuff.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2012-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -22,7 +22,7 @@
/*!
\file
\version $Id: RlinkPortCuff.cpp 504 2013-04-13 15:37:24Z mueller $
\version $Id: RlinkPortCuff.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of RlinkPortCuff.
*/
@@ -126,10 +126,10 @@ bool RlinkPortCuff::Open(const std::string& url, RerrMsg& emsg)
char* env_pid = ::getenv("RETRO_FX2_PID");
if (env_vid && ::strlen(env_vid) == 4 &&
env_pid && ::strlen(env_pid) == 4) {
fUrl.SetPath(string(env_vid) + string(":") + string(env_pid));
fUrl.SetPath(string(env_vid) + ":" + string(env_pid));
} else {
emsg.Init("RlinkPortCuff::Open()",
string("RETRO_FX2_VID/PID not or ill defined"));
"RETRO_FX2_VID/PID not or ill defined");
Cleanup();
return false;
}
@@ -302,9 +302,7 @@ bool RlinkPortCuff::OpenPipe(int& fdread, int& fdwrite, RerrMsg& emsg)
irc = ::pipe(pipefd);
if (irc < 0) {
emsg.InitErrno("RlinkPortCuff::OpenPipe()",
string("pipe() failed: "),
errno);
emsg.InitErrno("RlinkPortCuff::OpenPipe()", "pipe() failed: ", errno);
return false;
}
@@ -501,7 +499,7 @@ void RlinkPortCuff::BadSysCall(const char* meth, const char* text, int rc)
{
stringstream ss;
ss << rc;
throw Rexception(meth, string(text)+string(" failed with rc=")+ss.str(),
throw Rexception(meth, string(text) + " failed with rc=" + ss.str(),
errno);
}
@@ -512,8 +510,8 @@ void RlinkPortCuff::BadUSBCall(const char* meth, const char* text, int rc)
{
stringstream ss;
ss << rc;
throw Rexception(meth, string(text)+string(" failed with rc=")+ss.str()+
string(" : ")+string(USBErrorName(rc)));
throw Rexception(meth, string(text) + " failed with rc=" + ss.str() +
" : " + string(USBErrorName(rc)));
}
//------------------------------------------+-----------------------------------

View File

@@ -1,4 +1,4 @@
// $Id: RlinkPortFactory.cpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RlinkPortFactory.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -21,7 +21,7 @@
/*!
\file
\version $Id: RlinkPortFactory.cpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RlinkPortFactory.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of RlinkPortFactory.
*/
@@ -52,7 +52,7 @@ RlinkPort* Retro::RlinkPortFactory::New(const std::string& url, RerrMsg& emsg)
if (scheme.length() == 0) {
emsg.Init("RlinkPortFactory::New()",
string("no scheme specified in url '" + url + string("'")));
string("no scheme specified in url '" + url + "'"));
return 0;
}

View File

@@ -1,4 +1,4 @@
// $Id: RlinkPortFifo.cpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RlinkPortFifo.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2011-2013 y Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -20,7 +20,7 @@
/*!
\file
\version $Id: RlinkPortFifo.cpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RlinkPortFifo.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of RlinkPortFifo.
*/
@@ -97,7 +97,7 @@ int RlinkPortFifo::OpenFifo(const std::string& name, bool snd, RerrMsg& emsg)
if (irc == 0) {
if ((stat_fifo.st_mode & S_IFIFO) == 0) {
emsg.Init("RlinkPortFifo::OpenFiFo()",
string("'") + name + string("' exists but is not a pipe"));
string("'") + name + "' exists but is not a pipe");
return -1;
}
} else {
@@ -105,7 +105,7 @@ int RlinkPortFifo::OpenFifo(const std::string& name, bool snd, RerrMsg& emsg)
irc = mkfifo(name.c_str(), mode);
if (irc != 0) {
emsg.InitErrno("RlinkPortFifo::OpenFifo()",
string("mkfifo() for '") + name + string("' failed: "),
string("mkfifo() for '") + name + "' failed: ",
errno);
return -1;
}
@@ -114,7 +114,7 @@ int RlinkPortFifo::OpenFifo(const std::string& name, bool snd, RerrMsg& emsg)
irc = open(name.c_str(), snd ? O_WRONLY : O_RDONLY);
if (irc < 0) {
emsg.InitErrno("RlinkPortFifo::OpenFifo()",
string("open() for '") + name + string("' failed: "),
string("open() for '") + name + "' failed: ",
errno);
return -1;
}

View File

@@ -1,4 +1,4 @@
// $Id: RlinkPortTerm.cpp 494 2013-03-03 21:50:07Z mueller $
// $Id: RlinkPortTerm.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -25,7 +25,7 @@
/*!
\file
\version $Id: RlinkPortTerm.cpp 494 2013-03-03 21:50:07Z mueller $
\version $Id: RlinkPortTerm.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of RlinkPortTerm.
*/
@@ -114,7 +114,7 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
if (baud=="4000000" || baud=="4000k" || baud=="4M") speed = B4000000;
if (speed == B0) {
emsg.Init("RlinkPortTerm::Open()",
string("invalid baud rate '") + baud + string("' specified"));
string("invalid baud rate '") + baud + "' specified");
return false;
}
}
@@ -124,23 +124,22 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
fd = open(fUrl.Path().c_str(), O_RDWR|O_NOCTTY);
if (fd < 0) {
emsg.InitErrno("RlinkPortTerm::Open()",
string("open() for '") + fUrl.Path() + string("' failed: "),
string("open() for '") + fUrl.Path() + "' failed: ",
errno);
return false;
}
if (!isatty(fd)) {
emsg.Init("RlinkPortTerm::Open()",
string("isatty() check for '") + fUrl.Path() +
string("' failed: not a TTY"));
string("isatty() check for '") + fUrl.Path() +
"' failed: not a TTY");
close(fd);
return false;
}
if (tcgetattr(fd, &fTiosOld) != 0) {
emsg.InitErrno("RlinkPortTerm::Open()",
string("tcgetattr() for '") + fUrl.Path() +
string("' failed: "),
string("tcgetattr() for '") + fUrl.Path() + "' failed: ",
errno);
close(fd);
return false;
@@ -174,7 +173,7 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
if (cfsetspeed(&fTiosNew, speed) != 0) {
emsg.InitErrno("RlinkPortTerm::Open()",
string("cfsetspeed() for '") + baud + string("' failed: "),
string("cfsetspeed() for '") + baud + "' failed: ",
errno);
close(fd);
return false;
@@ -198,8 +197,7 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
if (tcsetattr(fd, TCSANOW, &fTiosNew) != 0) {
emsg.InitErrno("RlinkPortTerm::Open()",
string("tcsetattr() for '") + fUrl.Path() +
string("' failed: "),
string("tcsetattr() for '") + fUrl.Path() + "' failed: ",
errno);
close(fd);
return false;
@@ -212,9 +210,8 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
struct termios tios;
if (tcgetattr(fd, &tios) != 0) {
emsg.InitErrno("RlinkPortTerm::Open()",
string("2nd tcgetattr() for '") + fUrl.Path() +
string("' failed: "),
errno);
string("2nd tcgetattr() for '") + fUrl.Path() +
"' failed: ", errno);
close(fd);
return false;
}
@@ -232,8 +229,7 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
if (pmsg) {
emsg.Init("RlinkPortTerm::Open()",
string("tcsetattr() failed to set") +
string(pmsg));
string("tcsetattr() failed to set") + string(pmsg));
close(fd);
return false;
}
@@ -246,7 +242,7 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
if (tcsendbreak(fd, 0) != 0) {
emsg.InitErrno("RlinkPortTerm::Open()",
string("tcsendbreak() for '") + fUrl.Path() +
string("' failed: "), errno);
"' failed: ", errno);
Close();
return false;
}

View File

@@ -1,4 +1,4 @@
// $Id: RlinkServer.cpp 509 2013-04-21 20:46:20Z mueller $
// $Id: RlinkServer.cpp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0.2 fTraceLevel now uint32_t
// 2013-04-21 509 1.0.1 add Resume(), reorganize server start handling
// 2013-03-06 495 1.0 Initial version
// 2013-01-12 474 0.5 First draft
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: RlinkServer.cpp 509 2013-04-21 20:46:20Z mueller $
\version $Id: RlinkServer.cpp 513 2013-05-01 14:02:06Z mueller $
\brief Implemenation of RlinkServer.
*/
@@ -295,7 +296,7 @@ bool RlinkServer::IsActiveOutside() const
//------------------------------------------+-----------------------------------
//! FIXME_docs
void RlinkServer::SetTraceLevel(size_t level)
void RlinkServer::SetTraceLevel(uint32_t level)
{
fTraceLevel = level;
fELoop.SetTraceLevel(level);

View File

@@ -1,4 +1,4 @@
// $Id: RlinkServer.hpp 509 2013-04-21 20:46:20Z mueller $
// $Id: RlinkServer.hpp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0.2 fTraceLevel now uint32_t
// 2013-04-21 509 1.0.1 add Resume(), reorganize server start handling
// 2013-03-06 495 1.0 Initial version
// 2013-01-12 474 0.5 First draft
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: RlinkServer.hpp 509 2013-04-21 20:46:20Z mueller $
\version $Id: RlinkServer.hpp 513 2013-05-01 14:02:06Z mueller $
\brief Declaration of class \c RlinkServer.
*/
@@ -99,8 +100,8 @@ namespace Retro {
bool IsActiveInside() const;
bool IsActiveOutside() const;
void SetTraceLevel(size_t level);
size_t TraceLevel() const;
void SetTraceLevel(uint32_t level);
uint32_t TraceLevel() const;
const Rstats& Stats() const;
@@ -169,7 +170,7 @@ namespace Retro {
boost::thread fServerThread;
bool fAttnSeen;
uint16_t fAttnPatt;
size_t fTraceLevel; //!< trace level
uint32_t fTraceLevel; //!< trace level
Rstats fStats; //!< statistics
};

View File

@@ -1,4 +1,4 @@
// $Id: RlinkServer.ipp 495 2013-03-06 17:13:48Z mueller $
// $Id: RlinkServer.ipp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0.1 fTraceLevel now uint32_t
// 2013-03-06 495 1.0 Initial version
// 2013-01-12 474 0.5 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RlinkServer.ipp 495 2013-03-06 17:13:48Z mueller $
\version $Id: RlinkServer.ipp 513 2013-05-01 14:02:06Z mueller $
\brief Implemenation (inline) of RlinkServer.
*/
@@ -77,7 +78,7 @@ inline bool RlinkServer::Exec(RlinkCommandList& clist)
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t RlinkServer::TraceLevel() const
inline uint32_t RlinkServer::TraceLevel() const
{
return fTraceLevel;
}

View File

@@ -1,4 +1,4 @@
// $Id: RtclRlinkServer.cpp 510 2013-04-26 16:14:57Z mueller $
// $Id: RtclRlinkServer.cpp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0.5 TraceLevel now uint32_t
// 2013-04-26 510 1.0.4 change M_attn, now -info instead of -show
// 2013-04-21 509 1.0.3 add server -resume
// 2013-02-05 483 1.0.2 ClassCmdConfig: use RtclArgs
@@ -22,7 +23,7 @@
/*!
\file
\version $Id: RtclRlinkServer.cpp 510 2013-04-26 16:14:57Z mueller $
\version $Id: RtclRlinkServer.cpp 513 2013-05-01 14:02:06Z mueller $
\brief Implemenation of class RtclRlinkServer.
*/
@@ -125,10 +126,10 @@ int RtclRlinkServer::M_server(RtclArgs& args)
if (!args.AllDone()) return kERR;
args.SetResult(Obj().IsActive());
} else if (opt == "-trace") { // server -trace ...
int level;
uint32_t level;
if (!args.GetArg("?level", level)) return kERR;
if (args.NOptMiss()==0) { // server -trace level
Obj().SetTraceLevel((size_t)level);
Obj().SetTraceLevel(level);
} else { // server -trace
args.SetResult((int)Obj().TraceLevel());
}

View File

@@ -1,4 +1,4 @@
// $Id: RtclCmdBase.cpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RtclCmdBase.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -20,7 +20,7 @@
/*!
\file
\version $Id: RtclCmdBase.cpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RtclCmdBase.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of RtclCmdBase.
*/
@@ -132,8 +132,8 @@ void RtclCmdBase::AddMeth(const std::string& name, const methfo_t& methfo)
{
mmap_ins_t ret = fMapMeth.insert(mmap_val_t(name, methfo));
if (ret.second == false) // or use !(ret.second)
throw Rexception("RtclCmdBase::AddMeth:", "Bad args: " +
string("duplicate name: ") + name);
throw Rexception("RtclCmdBase::AddMeth:",
string("Bad args: duplicate name: '") + name + "'");
return;
}

View File

@@ -1,4 +1,4 @@
// $Id: RtclGetList.cpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RtclGetList.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -18,7 +18,7 @@
/*!
\file
\version $Id: RtclGetList.cpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RtclGetList.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of class RtclGetList.
*/
@@ -64,8 +64,8 @@ void RtclGetList::Add(const std::string& name, RtclGetBase* pget)
typedef std::pair<Retro::RtclGetList::map_it_t, bool> map_ins_t;
map_ins_t ret = fMap.insert(map_val_t(name, pget));
if (ret.second == false)
throw Rexception("RtclGetList::Add:", "Bad args: " +
string("duplicate name: ") + name);
throw Rexception("RtclGetList::Add:",
string("Bad args: duplicate name: '") + name + "'");
return;
}

View File

@@ -1,4 +1,4 @@
// $Id: RtclNameSet.cpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RtclNameSet.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -19,7 +19,7 @@
/*!
\file
\version $Id: RtclNameSet.cpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RtclNameSet.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of RtclNameSet.
*/
@@ -64,7 +64,7 @@ RtclNameSet::RtclNameSet(const std::string& nset)
if (ret.second == false) // or use !(ret.second)
throw Rexception("RtclNameSet::<ctor>", "Bad args: " +
string("duplicate name '") + name +
string("' in set '") + nset + string("'"));
"' in set '" + nset + "'");
}
if (iend == string::npos) break;
ibeg = iend+1;

View File

@@ -1,4 +1,4 @@
// $Id: RtclSetList.cpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RtclSetList.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -18,7 +18,7 @@
/*!
\file
\version $Id: RtclSetList.cpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RtclSetList.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of class RtclSetList.
*/
@@ -64,8 +64,8 @@ void RtclSetList::Add(const std::string& name, RtclSetBase* pset)
typedef std::pair<Retro::RtclSetList::map_it_t, bool> map_ins_t;
map_ins_t ret = fMap.insert(map_val_t(name, pset));
if (ret.second == false)
throw Rexception("RtclSetList::Add:", "Bad args: " +
string("duplicate name: ") + name);
throw Rexception("RtclSetList::Add:",
string("Bad args: duplicate name: '") + name + "'");
return;
}

View File

@@ -1,4 +1,4 @@
// $Id: RparseUrl.cpp 492 2013-02-24 22:14:47Z mueller $
// $Id: RparseUrl.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -19,7 +19,7 @@
/*!
\file
\version $Id: RparseUrl.cpp 492 2013-02-24 22:14:47Z mueller $
\version $Id: RparseUrl.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of RparseUrl.
*/
@@ -97,8 +97,7 @@ bool RparseUrl::Set(const std::string& url, const std::string& optlist,
if (c == '\\') {
if (i+1 >= url.length()) {
emsg.Init("RparseUrl::ParseUrl()",
string("invalid trailing \\ in url '") + url +
string("'"));
string("invalid trailing \\ in url '") + url + "'");
return false;
}
i += 1;
@@ -107,7 +106,7 @@ bool RparseUrl::Set(const std::string& url, const std::string& optlist,
case ';' : c = ';'; break;
default : emsg.Init("RparseUrl::ParseUrl()",
string("invalid \\ escape in url '") +
url + string("'"));
url + "'");
return false;
}
}
@@ -208,7 +207,8 @@ bool RparseUrl::AddOpt(const std::string& key, const std::string& val,
lkey += "|";
if (optlist.find(lkey) == string::npos) {
emsg.Init("RparseUrl::AddOpt()",
string("invalid field name '") + lkey + string("'"));
string("invalid field name '") + lkey + "'; allowed: '" +
optlist + "'");
return false;
}

View File

@@ -1,4 +1,4 @@
// $Id: Rtools.cpp 493 2013-03-01 21:02:33Z mueller $
// $Id: Rtools.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-04 516 1.0.3 add CreateBackupFile()
// 2013-02-13 481 1.0.2 remove Throw(Logic|Runtime)(); use Rexception
// 2011-04-10 376 1.0.1 add ThrowLogic(), ThrowRuntime()
// 2011-03-12 368 1.0 Initial version
@@ -20,13 +21,19 @@
/*!
\file
\version $Id: Rtools.cpp 493 2013-03-01 21:02:33Z mueller $
\version $Id: Rtools.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of Rtools .
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <iostream>
#include <vector>
#include "RerrMsg.hpp"
#include "Rexception.hpp"
#include "Rtools.hpp"
@@ -40,12 +47,12 @@ using namespace std;
// all method definitions in namespace Retro
namespace Retro {
namespace Rtools {
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string Rtools::Flags2String(uint32_t flags, const RflagName* fnam,
char delim)
std::string Flags2String(uint32_t flags, const RflagName* fnam, char delim)
{
if (fnam == 0)
throw Rexception("Rtools::Flags2String()","Bad args: fnam==NULL");
@@ -61,4 +68,105 @@ std::string Rtools::Flags2String(uint32_t flags, const RflagName* fnam,
return rval;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool String2Long(const std::string& str, long& res, RerrMsg& emsg, int base)
{
char* endptr;
res = ::strtol(str.c_str(), &endptr, base);
if (*endptr == 0) return true;
emsg.Init("Rtools::String2Long",
string("conversion error in '") + str +"'");
res = 0;
return false;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool String2Long(const std::string& str, unsigned long& res,
RerrMsg& emsg, int base)
{
char* endptr;
res = ::strtoul(str.c_str(), &endptr, base);
if (*endptr == 0) return true;
emsg.Init("Rtools::String2Long",
string("conversion error in '") + str +"'");
res = 0;
return false;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool CreateBackupFile(const std::string& fname, size_t nbackup, RerrMsg& emsg)
{
if (nbackup == 0) return true;
size_t dotpos = fname.find_last_of('.');
string fbase = fname.substr(0,dotpos);
string fext = fname.substr(dotpos);
if (nbackup > 99) {
emsg.Init("Rtools::CreateBackupFile",
"only up to 99 backup levels supported");
return false;
}
vector<string> fnames;
fnames.push_back(fname);
for (size_t i=1; i<=nbackup; i++) {
char fnum[4];
snprintf(fnum, 4, "%d", i);
fnames.push_back(fbase + "_" + fnum + fext);
}
for (size_t i=nbackup; i>0; i--) {
string fnam_new = fnames[i];
string fnam_old = fnames[i-1];
struct stat sbuf;
int irc = ::stat(fnam_old.c_str(), &sbuf);
if (irc < 0) {
if (errno == ENOENT) continue;
emsg.InitErrno("Rtools::CreateBackupFile",
string("stat() for '") + fnam_old + "'failed: ", errno);
return false;
}
if (S_ISREG(sbuf.st_mode) == 0) {
emsg.Init("Rtools::CreateBackupFile",
"backups only supported for regular files");
return false;
}
// here we know old file exists and is a regular file
irc = ::rename(fnam_old.c_str(), fnam_new.c_str());
if (irc < 0) {
emsg.InitErrno("Rtools::CreateBackupFile",
string("rename() for '") + fnam_old + "' -> '" +
fnam_new + "'failed: ", errno);
return false;
}
}
return true;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool CreateBackupFile(const RparseUrl& purl, RerrMsg& emsg)
{
string bck;
if (!purl.FindOpt("app") && purl.FindOpt("bck", bck)) {
unsigned long nbck;
if (!Rtools::String2Long(bck, nbck, emsg)) return false;
if (nbck > 0) {
if (!Rtools::CreateBackupFile(purl.Path(), nbck, emsg)) return false;
}
}
return true;
}
} // end namespace Rtools
} // end namespace Retro

View File

@@ -1,4 +1,4 @@
// $Id: Rtools.hpp 486 2013-02-10 22:34:43Z mueller $
// $Id: Rtools.hpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-04 516 1.0.3 add CreateBackupFile(), String2Long()
// 2013-02-13 481 1.0.2 remove ThrowLogic(), ThrowRuntime()
// 2011-04-10 376 1.0.1 add ThrowLogic(), ThrowRuntime()
// 2011-03-12 368 1.0 Initial version
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rtools.hpp 486 2013-02-10 22:34:43Z mueller $
\version $Id: Rtools.hpp 516 2013-05-05 21:24:52Z mueller $
\brief Declaration of class Rtools .
*/
@@ -30,6 +31,9 @@
#include <cstdint>
#include <string>
#include "RerrMsg.hpp"
#include "RparseUrl.hpp"
namespace Retro {
struct RflagName {
@@ -40,6 +44,15 @@ namespace Retro {
namespace Rtools {
std::string Flags2String(uint32_t flags, const RflagName* fnam,
char delim='|');
bool String2Long(const std::string& str, long& res,
RerrMsg& emsg, int base=10);
bool String2Long(const std::string& str, unsigned long& res,
RerrMsg& emsg, int base=10);
bool CreateBackupFile(const std::string& fname, size_t nbackup,
RerrMsg& emsg);
bool CreateBackupFile(const RparseUrl& purl, RerrMsg& emsg);
};
} // end namespace Retro

View File

@@ -1,4 +1,4 @@
# $Id: Makefile 504 2013-04-13 15:37:24Z mueller $
# $Id: Makefile 515 2013-05-04 17:28:59Z mueller $
#
# Revision History:
# Date Rev Version Comment
@@ -26,11 +26,15 @@ OBJ_all += Rw11Probe.o
OBJ_all += Rw11Cntl.o Rw11Unit.o
OBJ_all += Rw11UnitTerm.o
OBJ_all += Rw11UnitDisk.o
OBJ_all += Rw11UnitStream.o
OBJ_all += Rw11CntlDL11.o Rw11UnitDL11.o
OBJ_all += Rw11CntlRK11.o Rw11UnitRK11.o
OBJ_all += Rw11CntlLP11.o Rw11UnitLP11.o
OBJ_all += Rw11CntlPC11.o Rw11UnitPC11.o
OBJ_all += Rw11Virt.o
OBJ_all += Rw11VirtTerm.o Rw11VirtTermPty.o Rw11VirtTermTcp.o
OBJ_all += Rw11VirtDisk.o Rw11VirtDiskFile.o
OBJ_all += Rw11VirtStream.o
#
DEP_all = $(OBJ_all:.o=.dep)
#

View File

@@ -1,4 +1,4 @@
// $Id: Rw11CntlDL11.cpp 508 2013-04-20 18:43:28Z mueller $
// $Id: Rw11CntlDL11.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-04 516 1.0.2 add RxRlim support (receive interrupt rate limit)
// 2013-04-20 508 1.0.1 add trace support
// 2013-03-06 495 1.0 Initial version
// 2013-02-05 483 0.1 First draft
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlDL11.cpp 508 2013-04-20 18:43:28Z mueller $
\version $Id: Rw11CntlDL11.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of Rw11CntlDL11.
*/
@@ -59,6 +60,9 @@ const uint16_t Rw11CntlDL11::kProbeOff;
const bool Rw11CntlDL11::kProbeInt;
const bool Rw11CntlDL11::kProbeRem;
const uint16_t Rw11CntlDL11::kRCSR_M_RXRLIM;
const uint16_t Rw11CntlDL11::kRCSR_V_RXRLIM;
const uint16_t Rw11CntlDL11::kRCSR_B_RXRLIM;
const uint16_t Rw11CntlDL11::kRCSR_M_RDONE;
const uint16_t Rw11CntlDL11::kXCSR_M_XRDY;
const uint16_t Rw11CntlDL11::kXBUF_M_RRDY;
@@ -70,7 +74,8 @@ const uint16_t Rw11CntlDL11::kXBUF_M_XBUF;
Rw11CntlDL11::Rw11CntlDL11()
: Rw11CntlBase<Rw11UnitDL11,1>("dl11"),
fPC_xbuf(0)
fPC_xbuf(0),
fRxRlim(0)
{
// must here because Unit have a back-pointer (not available at Rw11CntlBase)
for (size_t i=0; i<NUnit(); i++) {
@@ -117,6 +122,20 @@ void Rw11CntlDL11::Start()
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlDL11::UnitSetup(size_t ind)
{
Rw11Cpu& cpu = Cpu();
uint16_t rcsr = (fRxRlim<<kRCSR_V_RXRLIM) & kRCSR_M_RXRLIM;
RlinkCommandList clist;
cpu.AddIbrb(clist, fBase);
cpu.AddWibr(clist, fBase+kRCSR, rcsr);
Server().Exec(clist);
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlDL11::Wakeup()
{
if (!fspUnit[0]->RcvQueueEmpty()) {
@@ -141,11 +160,33 @@ void Rw11CntlDL11::Wakeup()
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlDL11::SetRxRlim(uint16_t rlim)
{
if (rlim > kRCSR_B_RXRLIM)
throw Rexception("Rw11CntlDL11::SetRxRlim","Bad args: rlim too large");
fRxRlim = rlim;
UnitSetup(0);
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
uint16_t Rw11CntlDL11::RxRlim() const
{
return fRxRlim;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlDL11::Dump(std::ostream& os, int ind, const char* text) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlDL11 @ " << this << endl;
os << bl << " fPC_xbuf: " << fPC_xbuf << endl;
os << bl << " fRxRlim: " << fRxRlim << endl;
Rw11CntlBase<Rw11UnitDL11,1>::Dump(os, ind, " ^");
return;

View File

@@ -1,4 +1,4 @@
// $Id: Rw11CntlDL11.hpp 504 2013-04-13 15:37:24Z mueller $
// $Id: Rw11CntlDL11.hpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-04 516 1.0.1 add RxRlim support (receive interrupt rate limit)
// 2013-03-06 495 1.0 Initial version
// 2013-02-05 483 0.1 First draft
// ---------------------------------------------------------------------------
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlDL11.hpp 504 2013-04-13 15:37:24Z mueller $
\version $Id: Rw11CntlDL11.hpp 516 2013-05-05 21:24:52Z mueller $
\brief Declaration of class Rw11CntlDL11.
*/
@@ -42,13 +43,17 @@ namespace Retro {
virtual void Start();
virtual void UnitSetup(size_t ind);
void Wakeup();
void SetRxRlim(uint16_t rlim);
uint16_t RxRlim() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0177560; //!< RK11 default address
static const int kLam = 1; //!< RK11 default lam
static const uint16_t kIbaddr = 0177560; //!< DL11 default address
static const int kLam = 1; //!< DL11 default lam
static const uint16_t kRCSR = 000; //!< RCSR register address offset
static const uint16_t kRBUF = 002; //!< RBUF register address offset
@@ -59,17 +64,21 @@ namespace Retro {
static const bool kProbeInt = true; //!< probe int active
static const bool kProbeRem = true; //!< probr rem active
static const uint16_t kRCSR_M_RDONE = kWBit07;
static const uint16_t kXCSR_M_XRDY = kWBit07;
static const uint16_t kXBUF_M_RRDY = kWBit09;
static const uint16_t kXBUF_M_XVAL = kWBit08;
static const uint16_t kXBUF_M_XBUF = 0xff;
static const uint16_t kRCSR_M_RXRLIM = 0070000;
static const uint16_t kRCSR_V_RXRLIM = 12;
static const uint16_t kRCSR_B_RXRLIM = 007;
static const uint16_t kRCSR_M_RDONE = kWBit07;
static const uint16_t kXCSR_M_XRDY = kWBit07;
static const uint16_t kXBUF_M_RRDY = kWBit09;
static const uint16_t kXBUF_M_XVAL = kWBit08;
static const uint16_t kXBUF_M_XBUF = 0xff;
protected:
int AttnHandler(const RlinkServer::AttnArgs& args);
protected:
size_t fPC_xbuf; //!< PrimClist: xbuf index
uint16_t fRxRlim; //!< rx interrupt rate limit
};
} // end namespace Retro

View File

@@ -0,0 +1,195 @@
// $Id: Rw11CntlLP11.cpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-04 515 1.0 Initial version
// 2013-05-01 513 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11CntlLP11.cpp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation of Rw11CntlLP11.
*/
#include "boost/bind.hpp"
#include "librtools/RosFill.hpp"
#include "librtools/RosPrintBvi.hpp"
#include "librtools/RosPrintf.hpp"
#include "librtools/Rexception.hpp"
#include "librtools/RlogMsg.hpp"
#include "Rw11CntlLP11.hpp"
using namespace std;
/*!
\class Retro::Rw11CntlLP11
\brief FIXME_docs
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
// constants definitions
const uint16_t Rw11CntlLP11::kIbaddr;
const int Rw11CntlLP11::kLam;
const uint16_t Rw11CntlLP11::kCSR;
const uint16_t Rw11CntlLP11::kBUF;
const uint16_t Rw11CntlLP11::kProbeOff;
const bool Rw11CntlLP11::kProbeInt;
const bool Rw11CntlLP11::kProbeRem;
const uint16_t Rw11CntlLP11::kCSR_M_ERROR;
const uint16_t Rw11CntlLP11::kBUF_M_VAL;
const uint16_t Rw11CntlLP11::kBUF_M_BUF;
//------------------------------------------+-----------------------------------
//! Default constructor
Rw11CntlLP11::Rw11CntlLP11()
: Rw11CntlBase<Rw11UnitLP11,1>("lp11"),
fPC_buf(0)
{
// must here because Unit have a back-pointer (not available at Rw11CntlBase)
for (size_t i=0; i<NUnit(); i++) {
fspUnit[i].reset(new Rw11UnitLP11(this, i));
}
}
//------------------------------------------+-----------------------------------
//! Destructor
Rw11CntlLP11::~Rw11CntlLP11()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlLP11::Config(const std::string& name, uint16_t base, int lam)
{
ConfigCntl(name, base, lam, kProbeOff, kProbeInt, kProbeRem);
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlLP11::Start()
{
if (fStarted || fLam<0 || !fEnable || !fProbe.Found())
throw Rexception("Rw11CntlLP11::Start",
"Bad state: started, no lam, not enable, not found");
// setup primary info clist
fPrimClist.Clear();
Cpu().AddIbrb(fPrimClist, fBase);
fPC_buf = Cpu().AddRibr(fPrimClist, fBase+kBUF);
// add attn handler
Server().AddAttnHandler(boost::bind(&Rw11CntlLP11::AttnHandler, this, _1),
uint16_t(1)<<fLam, (void*)this);
fStarted = true;
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlLP11::UnitSetup(size_t ind)
{
Rw11UnitLP11& unit = *fspUnit[ind];
SetOnline(unit.Virt()); // online if stream attached
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlLP11::Dump(std::ostream& os, int ind, const char* text) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlLP11 @ " << this << endl;
os << bl << " fPC_buf: " << fPC_buf << endl;
Rw11CntlBase<Rw11UnitLP11,1>::Dump(os, ind, " ^");
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
int Rw11CntlLP11::AttnHandler(const RlinkServer::AttnArgs& args)
{
RlinkCommandList* pclist;
size_t off;
GetPrimInfo(args, pclist, off);
uint16_t buf = (*pclist)[off+fPC_buf].Data();
bool val = buf & kBUF_M_VAL;
uint8_t ochr = buf & kBUF_M_BUF;
if (fTraceLevel>0) {
RlogMsg lmsg(LogFile());
lmsg << "-I LP11." << Name()
<< " buf=" << RosPrintBvi(buf,8)
<< " val=" << val;
if (val) {
lmsg << " char=";
if (ochr>=040 && ochr<0177) {
lmsg << "'" << char(ochr) << "'";
} else {
lmsg << RosPrintBvi(ochr,8);
}
}
}
if (val) {
RerrMsg emsg;
bool rc = fspUnit[0]->VirtWrite(&ochr, 1, emsg);
if (!rc) {
RlogMsg lmsg(LogFile());
lmsg << emsg;
SetOnline(false);
}
if (ochr == 014) { // ^L = FF = FormFeed seen ?
rc = fspUnit[0]->VirtFlush(emsg);
}
}
return 0;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlLP11::SetOnline(bool online)
{
Rw11Cpu& cpu = Cpu();
uint16_t csr = online ? 0 : kCSR_M_ERROR;
RlinkCommandList clist;
cpu.AddIbrb(clist, fBase);
cpu.AddWibr(clist, fBase+kCSR, csr);
Server().Exec(clist);
return;
}
} // end namespace Retro

View File

@@ -0,0 +1,75 @@
// $Id: Rw11CntlLP11.hpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11CntlLP11.hpp 515 2013-05-04 17:28:59Z mueller $
\brief Declaration of class Rw11CntlLP11.
*/
#ifndef included_Retro_Rw11CntlLP11
#define included_Retro_Rw11CntlLP11 1
#include "Rw11CntlBase.hpp"
#include "Rw11UnitLP11.hpp"
namespace Retro {
class Rw11CntlLP11 : public Rw11CntlBase<Rw11UnitLP11,1> {
public:
Rw11CntlLP11();
~Rw11CntlLP11();
void Config(const std::string& name, uint16_t base, int lam);
virtual void Start();
virtual void UnitSetup(size_t ind);
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0177514; //!< LP11 default address
static const int kLam = 8; //!< LP11 default lam
static const uint16_t kCSR = 000; //!< CSR register address offset
static const uint16_t kBUF = 002; //!< BUF register address offset
static const uint16_t kProbeOff = kCSR; //!< probe address offset (rcsr)
static const bool kProbeInt = true; //!< probe int active
static const bool kProbeRem = true; //!< probr rem active
static const uint16_t kCSR_M_ERROR = kWBit15;
static const uint16_t kBUF_M_VAL = kWBit08;
static const uint16_t kBUF_M_BUF = 0177;
protected:
int AttnHandler(const RlinkServer::AttnArgs& args);
void SetOnline(bool online);
protected:
size_t fPC_buf; //!< PrimClist: buf index
};
} // end namespace Retro
//#include "Rw11CntlLP11.ipp"
#endif

View File

@@ -0,0 +1,316 @@
// $Id: Rw11CntlPC11.cpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11CntlPC11.cpp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation of Rw11CntlPC11.
*/
#include "boost/bind.hpp"
#include "boost/foreach.hpp"
#define foreach_ BOOST_FOREACH
#include "librtools/RosFill.hpp"
#include "librtools/RosPrintBvi.hpp"
#include "librtools/RosPrintf.hpp"
#include "librtools/Rexception.hpp"
#include "librtools/RlogMsg.hpp"
#include "Rw11CntlPC11.hpp"
using namespace std;
/*!
\class Retro::Rw11CntlPC11
\brief FIXME_docs
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
// constants definitions
const uint16_t Rw11CntlPC11::kIbaddr;
const int Rw11CntlPC11::kLam;
const uint16_t Rw11CntlPC11::kRCSR;
const uint16_t Rw11CntlPC11::kRBUF;
const uint16_t Rw11CntlPC11::kPCSR;
const uint16_t Rw11CntlPC11::kPBUF;
const uint16_t Rw11CntlPC11::kUnit_PR;
const uint16_t Rw11CntlPC11::kUnit_PP;
const uint16_t Rw11CntlPC11::kProbeOff;
const bool Rw11CntlPC11::kProbeInt;
const bool Rw11CntlPC11::kProbeRem;
const uint16_t Rw11CntlPC11::kRCSR_M_ERROR;
const uint16_t Rw11CntlPC11::kPCSR_M_ERROR;
const uint16_t Rw11CntlPC11::kPBUF_M_RBUSY;
const uint16_t Rw11CntlPC11::kPBUF_M_PVAL;
const uint16_t Rw11CntlPC11::kPBUF_M_BUF;
//------------------------------------------+-----------------------------------
//! Default constructor
Rw11CntlPC11::Rw11CntlPC11()
: Rw11CntlBase<Rw11UnitPC11,2>("pc11"),
fPC_pbuf(0)
{
// must here because Unit have a back-pointer (not available at Rw11CntlBase)
for (size_t i=0; i<NUnit(); i++) {
fspUnit[i].reset(new Rw11UnitPC11(this, i));
}
}
//------------------------------------------+-----------------------------------
//! Destructor
Rw11CntlPC11::~Rw11CntlPC11()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlPC11::Config(const std::string& name, uint16_t base, int lam)
{
ConfigCntl(name, base, lam, kProbeOff, kProbeInt, kProbeRem);
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlPC11::Start()
{
if (fStarted || fLam<0 || !fEnable || !fProbe.Found())
throw Rexception("Rw11CntlPC11::Start",
"Bad state: started, no lam, not enable, not found");
// setup primary info clist
fPrimClist.Clear();
Cpu().AddIbrb(fPrimClist, fBase);
fPC_pbuf = Cpu().AddRibr(fPrimClist, fBase+kPBUF);
// add attn handler
Server().AddAttnHandler(boost::bind(&Rw11CntlPC11::AttnHandler, this, _1),
uint16_t(1)<<fLam, (void*)this);
fStarted = true;
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool Rw11CntlPC11::BootCode(size_t unit, std::vector<uint16_t>& code,
uint16_t& aload, uint16_t& astart)
{
uint16_t kBOOT_START = 0017476;
uint16_t bootcode[] = { // papertape lda loader, from dec-11-l2pc-po
0000000, // C000: halt
0010706, // astart: mov pc,sp
0024646, // cmp -(sp),-(sp)
0010705, // mov pc,r5
0062705, 0000112, // add #000112,r5
0005001, // clr r1
0013716, 0177570, // B000: mov @#cp.dsr,(sp)
0006016, // ror (sp)
0103402, // bcs B001
0005016, // clr (sp)
0000403, // br B002
0006316, // B001: asl (sp)
0001001, // bne B002
0010116, // mov r1,(sp)
0005000, // B002: clr r0
0004715, // jsr pc,(r5)
0105303, // decb r3
0001374, // bne B002
0004715, // jsr pc,(r5)
0004767, 0000074, // jsr pc,R000
0010402, // mov r4,r2
0162702, 0000004, // sub #000004,r2
0022702, 0000002, // cmp #000002,r2
0001441, // beq B007
0004767, 0000054, // jsr pc,R000
0061604, // add (sp),r4
0010401, // mov r4,r1
0004715, // B003: jsr pc,(r5)
0002004, // bge B005
0105700, // tstb r0
0001753, // beq B002
0000000, // B004: halt
0000751, // br B002
0110321, // B005: movb r3,(r1)+
0000770, // br B003
0016703, 0000152, // ldchr: mov p.prcs,r3
0105213, // incb (r3)
0105713, // B006: tstb (r3)
0100376, // bpl B006
0116303, 0000002, // movb 000002(r3),r3
0060300, // add r3,r0
0042703, 0177400, // bic #177400,r3
0005302, // dec r2
0000207, // rts pc
0012667, 0000046, // R000: mov (sp)+,D000
0004715, // jsr pc,(r5)
0010304, // mov r3,r4
0004715, // jsr pc,(r5)
0000303, // swap r3
0050304, // bis r3,r4
0016707, 0000030, // mov D000,pc
0004767, 0177752, // B007: jsr pc,R000
0004715, // jsr pc,(r5)
0105700, // tstb r0
0001342, // bne B004
0006204, // asr r4
0103002, // bcc B008
0000000, // halt
0000700, // br B000
0006304, // B008: asl r4
0061604, // add (sp),r4
0000114, // jmp (r4)
0000000, // D000: .word 000000
0012767, 0000352, 0000020, // L000: mov #000352,B009+2
0012767, 0000765, 0000034, // mov #000765,D001
0000167, 0177532, // jmp C000
0016701, 0000026, // bstart: mov p.prcs,r1
0012702, 0000352, // B009: mov #000352,r2
0005211, // inc (r1)
0105711, // B010: tstb (r1)
0100376, // bpl B010
0116162, 0000002, 0157400, // movb 000002(r1),157400(r2)
0005267, 0177756, // inc B009+2
0000765, // D001: br B009
0177550 // p.prcs: .word 177550
};
code.clear();
foreach_ (uint16_t& w, bootcode) code.push_back(w);
aload = kBOOT_START;
astart = kBOOT_START+2;
return true;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlPC11::UnitSetup(size_t ind)
{
Rw11UnitPC11& unit = *fspUnit[ind];
SetOnline(ind, unit.Virt()); // online if stream attached
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlPC11::Dump(std::ostream& os, int ind, const char* text) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlPC11 @ " << this << endl;
os << bl << " fPC_pbuf: " << fPC_pbuf << endl;
Rw11CntlBase<Rw11UnitPC11,2>::Dump(os, ind, " ^");
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
int Rw11CntlPC11::AttnHandler(const RlinkServer::AttnArgs& args)
{
RlinkCommandList* pclist;
size_t off;
GetPrimInfo(args, pclist, off);
uint16_t pbuf = (*pclist)[off+fPC_pbuf].Data();
bool pval = pbuf & kPBUF_M_PVAL;
bool rbusy = pbuf & kPBUF_M_RBUSY;
uint8_t ochr = pbuf & kPBUF_M_BUF;
if (fTraceLevel>0) {
RlogMsg lmsg(LogFile());
lmsg << "-I PC11." << Name()
<< " pbuf=" << RosPrintBvi(pbuf,8)
<< " pval=" << pval
<< " rbusy=" << rbusy;
if (pval) {
lmsg << " char=";
if (ochr>=040 && ochr<0177) {
lmsg << "'" << char(ochr) << "'";
} else {
lmsg << RosPrintBvi(ochr,8);
}
}
}
if (pval) {
RerrMsg emsg;
bool rc = fspUnit[kUnit_PP]->VirtWrite(&ochr, 1, emsg);
if (!rc) {
RlogMsg lmsg(LogFile());
lmsg << emsg;
SetOnline(1, false);
}
}
if (rbusy) {
uint8_t ichr = 0;
RerrMsg emsg;
int irc = fspUnit[kUnit_PR]->VirtRead(&ichr, 1, emsg);
if (irc < 0) {
RlogMsg lmsg(LogFile());
lmsg << emsg;
}
if (irc <= 0) {
SetOnline(0, false);
} else {
RlinkCommandList clist;
Cpu().AddWibr(clist, fBase+kRBUF, ichr);
Server().Exec(clist);
}
}
return 0;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlPC11::SetOnline(size_t ind, bool online)
{
Rw11Cpu& cpu = Cpu();
RlinkCommandList clist;
cpu.AddIbrb(clist, fBase);
if (ind == kUnit_PR) { // reader on/offline
uint16_t rcsr = online ? 0 : kRCSR_M_ERROR;
cpu.AddWibr(clist, fBase+kRCSR, rcsr);
} else { // puncher on/offline
uint16_t pcsr = online ? 0 : kPCSR_M_ERROR;
cpu.AddWibr(clist, fBase+kPCSR, pcsr);
}
Server().Exec(clist);
return;
}
} // end namespace Retro

View File

@@ -0,0 +1,85 @@
// $Id: Rw11CntlPC11.hpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11CntlPC11.hpp 515 2013-05-04 17:28:59Z mueller $
\brief Declaration of class Rw11CntlPC11.
*/
#ifndef included_Retro_Rw11CntlPC11
#define included_Retro_Rw11CntlPC11 1
#include "Rw11CntlBase.hpp"
#include "Rw11UnitPC11.hpp"
namespace Retro {
class Rw11CntlPC11 : public Rw11CntlBase<Rw11UnitPC11,2> {
public:
Rw11CntlPC11();
~Rw11CntlPC11();
void Config(const std::string& name, uint16_t base, int lam);
virtual void Start();
virtual bool BootCode(size_t unit, std::vector<uint16_t>& code,
uint16_t& aload, uint16_t& astart);
virtual void UnitSetup(size_t ind);
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0177550; //!< PC11 default address
static const int kLam = 10; //!< PC11 default lam
static const uint16_t kRCSR = 000; //!< RCSR register address offset
static const uint16_t kRBUF = 002; //!< RBUF register address offset
static const uint16_t kPCSR = 004; //!< PCSR register address offset
static const uint16_t kPBUF = 006; //!< PBUF register address offset
static const uint16_t kUnit_PR = 0; //<! unit number of paper reader
static const uint16_t kUnit_PP = 1; //<! unit number of paper puncher
static const uint16_t kProbeOff = kRCSR; //!< probe address offset (rcsr)
static const bool kProbeInt = true; //!< probe int active
static const bool kProbeRem = true; //!< probr rem active
static const uint16_t kRCSR_M_ERROR = kWBit15;
static const uint16_t kPCSR_M_ERROR = kWBit15;
static const uint16_t kPBUF_M_RBUSY = kWBit09;
static const uint16_t kPBUF_M_PVAL = kWBit08;
static const uint16_t kPBUF_M_BUF = 0377;
protected:
int AttnHandler(const RlinkServer::AttnArgs& args);
void SetOnline(size_t ind, bool online);
protected:
size_t fPC_pbuf; //!< PrimClist: pbuf index
};
} // end namespace Retro
//#include "Rw11CntlPC11.ipp"
#endif

View File

@@ -1,4 +1,4 @@
// $Id: Rw11CntlRK11.cpp 509 2013-04-21 20:46:20Z mueller $
// $Id: Rw11CntlRK11.cpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Other credits:
@@ -21,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlRK11.cpp 509 2013-04-21 20:46:20Z mueller $
\version $Id: Rw11CntlRK11.cpp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation of Rw11CntlRK11.
*/
@@ -224,30 +224,30 @@ bool Rw11CntlRK11::BootCode(size_t unit, std::vector<uint16_t>& code,
uint16_t& aload, uint16_t& astart)
{
uint16_t kBOOT_START = 02000;
uint16_t bootcode[] = { // rk05 boot loader - from simh pdp11_rk.c
0042113, // "KD"
0012706, kBOOT_START, // MOV #boot_start, SP
0012700, uint16_t(unit), // MOV #unit, R0 ; unit number
0010003, // # MOV R0, R3
0000303, // # SWAB R3
0006303, // # ASL R3
0006303, // # ASL R3
0006303, // # ASL R3
0006303, // # ASL R3
0006303, // # ASL R3
0012701, 0177412, // # MOV #RKDA, R1 ; rkda
0010311, // # MOV R3, (R1) ; load da
0005041, // # CLR -(R1) ; clear ba
0012741, 0177000, // # MOV #-256.*2, -(R1) ; load wc
0012741, 0000005, // # MOV #READ+GO, -(R1) ; read & go
0005002, // # CLR R2
0005003, // # CLR R3
0012704, uint16_t(kBOOT_START+020), // # MOV #START+20, R4
0005005, // # CLR R5
0105711, // # TSTB (R1)
0100376, // # BPL .-4
0105011, // # CLRB (R1)
0005007 // # CLR PC (5007)
uint16_t bootcode[] = { // rk05 boot loader - from simh pdp11_rk.c
0042113, // "KD"
0012706, kBOOT_START, // MOV #boot_start, SP
0012700, uint16_t(unit), // MOV #unit, R0 ; unit number
0010003, // MOV R0, R3
0000303, // SWAB R3
0006303, // ASL R3
0006303, // ASL R3
0006303, // ASL R3
0006303, // ASL R3
0006303, // ASL R3
0012701, 0177412, // MOV #RKDA, R1 ; rkda
0010311, // MOV R3, (R1) ; load da
0005041, // CLR -(R1) ; clear ba
0012741, 0177000, // MOV #-256.*2, -(R1) ; load wc
0012741, 0000005, // MOV #READ+GO, -(R1) ; read & go
0005002, // CLR R2
0005003, // CLR R3
0012704, uint16_t(kBOOT_START+020), // MOV #START+20, R4
0005005, // CLR R5
0105711, // TSTB (R1)
0100376, // BPL .-4
0105011, // CLRB (R1)
0005007 // CLR PC (5007)
};
code.clear();

View File

@@ -1,4 +1,4 @@
// $Id: Rw11Cpu.cpp 506 2013-04-14 21:54:03Z mueller $
// $Id: Rw11Cpu.cpp 516 2013-05-05 21:24:52Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -20,7 +20,7 @@
/*!
\file
\version $Id: Rw11Cpu.cpp 506 2013-04-14 21:54:03Z mueller $
\version $Id: Rw11Cpu.cpp 516 2013-05-05 21:24:52Z mueller $
\brief Implemenation of Rw11Cpu.
*/
#include <stdlib.h>
@@ -399,7 +399,7 @@ bool Rw11Cpu::LoadAbs(const std::string& fname, RerrMsg& emsg, bool trace)
if (fd < 0) {
emsg.InitErrno("Rw11Cpu::LoadAbs()", string("open() for '") + fname +
string("' failed: "), errno);
"' failed: ", errno);
return false;
}
@@ -590,8 +590,7 @@ bool Rw11Cpu::Boot(const std::string& uname, RerrMsg& emsg)
}
if (!TestCntl(cname)) {
emsg.Init("Rw11Cpu::Boot", string("controller '") + cname +
string("' not known"));
emsg.Init("Rw11Cpu::Boot", string("controller '") + cname + "' not known");
return false;
}
@@ -605,7 +604,7 @@ bool Rw11Cpu::Boot(const std::string& uname, RerrMsg& emsg)
if (!cntl.BootCode(uind, code, aload, astart) || code.size()==0) {
emsg.Init("Rw11Cpu::Boot", string("boot not supported for controller '")
+ cname + string("'"));
+ cname + "'");
return false;
}

View File

@@ -1,4 +1,4 @@
// $Id: Rw11Unit.cpp 495 2013-03-06 17:13:48Z mueller $
// $Id: Rw11Unit.cpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.1 use AttachDone(),DetachCleanup(),DetachDone()
// 2013-03-06 495 1.0 Initial version
// 2013-02-13 488 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11Unit.cpp 495 2013-03-06 17:13:48Z mueller $
\version $Id: Rw11Unit.cpp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation of Rw11Unit.
*/
@@ -43,6 +44,7 @@ namespace Retro {
Rw11Unit::Rw11Unit(Rw11Cntl* pcntl, size_t index)
: fpCntlBase(pcntl),
fIndex(index),
fAttachOpts(),
fStats()
{}
@@ -78,6 +80,7 @@ void Rw11Unit::Dump(std::ostream& os, int ind, const char* text) const
os << bl << (text?text:"--") << "Rw11Unit @ " << this << endl;
os << bl << " fIndex: " << fIndex << endl;
os << bl << " fAttachOpts: " << fAttachOpts << endl;
fStats.Dump(os, ind+2, "fStats: ");
return;
}
@@ -85,7 +88,7 @@ void Rw11Unit::Dump(std::ostream& os, int ind, const char* text) const
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11Unit::AttachSetup()
void Rw11Unit::AttachDone()
{}
//------------------------------------------+-----------------------------------
@@ -94,4 +97,10 @@ void Rw11Unit::AttachSetup()
void Rw11Unit::DetachCleanup()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11Unit::DetachDone()
{}
} // end namespace Retro

View File

@@ -1,4 +1,4 @@
// $Id: Rw11Unit.hpp 495 2013-03-06 17:13:48Z mueller $
// $Id: Rw11Unit.hpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.1 use AttachDone(),DetachCleanup(),DetachDone()
// 2013-05-01 513 1.0.1 add fAttachOpts, (Set)AttachOpts()
// 2013-03-06 495 1.0 Initial version
// 2013-02-13 488 0.1 First draft
// ---------------------------------------------------------------------------
@@ -20,13 +22,15 @@
/*!
\file
\version $Id: Rw11Unit.hpp 495 2013-03-06 17:13:48Z mueller $
\version $Id: Rw11Unit.hpp 515 2013-05-04 17:28:59Z mueller $
\brief Declaration of class Rw11Unit.
*/
#ifndef included_Retro_Rw11Unit
#define included_Retro_Rw11Unit 1
#include <string>
#include "boost/utility.hpp"
#include "librtools/Rstats.hpp"
@@ -47,6 +51,9 @@ namespace Retro {
size_t Index() const;
std::string Name() const;
void SetAttachOpts(const std::string& opts);
const std::string& AttachOpts() const;
Rw11Cntl& CntlBase() const;
Rw11Cpu& Cpu() const;
Rw11& W11() const;
@@ -66,8 +73,9 @@ namespace Retro {
};
protected:
virtual void AttachSetup();
virtual void AttachDone();
virtual void DetachCleanup();
virtual void DetachDone();
private:
Rw11Unit() {} //!< default ctor blocker
@@ -75,6 +83,7 @@ namespace Retro {
protected:
Rw11Cntl* fpCntlBase; //!< plain Rw11Cntl ptr
size_t fIndex; //!< unit number
std::string fAttachOpts; //!< unit context options for attach
Rstats fStats; //!< statistics
};

View File

@@ -1,4 +1,4 @@
// $Id: Rw11Unit.ipp 495 2013-03-06 17:13:48Z mueller $
// $Id: Rw11Unit.ipp 513 2013-05-01 14:02:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0.1 add fAttachOpts, (Set)AttachOpts()
// 2013-03-06 495 1.0 Initial version
// 2013-02-13 488 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11Unit.ipp 495 2013-03-06 17:13:48Z mueller $
\version $Id: Rw11Unit.ipp 513 2013-05-01 14:02:06Z mueller $
\brief Implemenation (inline) of Rw11Unit.
*/
@@ -45,6 +46,23 @@ inline std::string Rw11Unit::Name() const
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline void Rw11Unit::SetAttachOpts(const std::string& opts)
{
fAttachOpts = opts;
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline const std::string& Rw11Unit::AttachOpts() const
{
return fAttachOpts;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline Rw11Cntl& Rw11Unit::CntlBase() const
{
return *fpCntlBase;

View File

@@ -1,123 +0,0 @@
// $Id: Rw11UnitBase.ipp 495 2013-03-06 17:13:48Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-03-06 495 1.0 Initial version
// 2013-02-05 483 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitBase.ipp 495 2013-03-06 17:13:48Z mueller $
\brief Implemenation (inline) of Rw11UnitBase.
*/
#include "boost/thread/locks.hpp"
#include "librtools/RosFill.hpp"
#include "Rw11CntlBase.hpp"
#include "Rw11UnitBase.hpp"
/*!
\class Retro::Rw11UnitBase
\brief FIXME_docs
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
template <class TC, class TV>
Rw11UnitBase<TC,TV>::Rw11UnitBase(TC* pcntl, size_t index)
: Rw11Unit(index),
fpCntl(pcntl),
fpVirt()
{}
//------------------------------------------+-----------------------------------
//! Destructor
template <class TC, class TV>
Rw11UnitBase<TC,TV>::~Rw11UnitBase()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TC, class TV>
inline TC& Rw11UnitBase<TC,TV>::Cntl() const
{
return *fpCntl;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TC, class TV>
inline TV* Rw11UnitBase<TC,TV>::Virt() const
{
return fpVirt.get();
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TC, class TV>
inline bool Rw11UnitBase<TC,TV>::Attach(const std::string& url, RerrMsg& emsg)
{
// synchronize with server thread
boost::lock_guard<RlinkConnect> lock(Cntl().Connect());
if (fpVirt) DetachCleanup();
fpVirt.reset(TV::New(url, emsg));
if (fpVirt) AttachSetup();
return fpVirt;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TC, class TV>
inline void Rw11UnitBase<TC,TV>::Detach()
{
// synchronize with server thread
boost::lock_guard<RlinkConnect> lock(Cntl().Connect());
if (fpVirt) DetachCleanup();
fpVirt.reset();
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TC, class TV>
void Rw11UnitBase<TC,TV>::Dump(std::ostream& os, int ind,
const char* text) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11UnitBase @ " << this << std::endl;
os << bl << " fpCntl: " << fpCntl << std::endl;
if (fpVirt) {
fpVirt->Dump(os, ind+2, "*fpVirt: ");
} else {
os << bl << " fpVirt: " << fpVirt.get() << std::endl;
}
Rw11Unit::Dump(os, ind, " ^");
return;
}
} // end namespace Retro

View File

@@ -1,4 +1,4 @@
// $Id: Rw11UnitDiskBase.hpp 509 2013-04-21 20:46:20Z mueller $
// $Id: Rw11UnitDiskBase.hpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.1 use AttachDone(),DetachCleanup(),DetachDone()
// 2013-04-14 506 1.0 Initial version
// 2013-02-22 490 0.1 First draft
// ---------------------------------------------------------------------------
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11UnitDiskBase.hpp 509 2013-04-21 20:46:20Z mueller $
\version $Id: Rw11UnitDiskBase.hpp 515 2013-05-04 17:28:59Z mueller $
\brief Declaration of class Rw11UnitDiskBase.
*/
@@ -43,8 +44,8 @@ namespace Retro {
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
protected:
virtual void AttachSetup();
virtual void DetachCleanup();
virtual void AttachDone();
virtual void DetachDone();
protected:
TC* fpCntl;

View File

@@ -1,4 +1,4 @@
// $Id: Rw11UnitDiskBase.ipp 509 2013-04-21 20:46:20Z mueller $
// $Id: Rw11UnitDiskBase.ipp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.1 use AttachDone(),DetachCleanup(),DetachDone()
// 2013-04-14 506 1.0 Initial version
// 2013-02-22 490 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitDiskBase.ipp 509 2013-04-21 20:46:20Z mueller $
\version $Id: Rw11UnitDiskBase.ipp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation (inline) of Rw11UnitDiskBase.
*/
@@ -76,7 +77,7 @@ void Rw11UnitDiskBase<TC>::Dump(std::ostream& os, int ind,
//! FIXME_docs
template <class TC>
void Rw11UnitDiskBase<TC>::AttachSetup()
void Rw11UnitDiskBase<TC>::AttachDone()
{
Virt()->Setup(BlockSize(), NBlock());
Cntl().UnitSetup(Index());
@@ -88,7 +89,7 @@ void Rw11UnitDiskBase<TC>::AttachSetup()
//! FIXME_docs
template <class TC>
void Rw11UnitDiskBase<TC>::DetachCleanup()
void Rw11UnitDiskBase<TC>::DetachDone()
{
SetWProt(false);
Cntl().UnitSetup(Index());

View File

@@ -0,0 +1,68 @@
// $Id: Rw11UnitLP11.cpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitLP11.cpp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation of Rw11UnitLP11.
*/
#include "boost/bind.hpp"
#include "librtools/RosFill.hpp"
#include "Rw11CntlLP11.hpp"
#include "Rw11UnitLP11.hpp"
using namespace std;
/*!
\class Retro::Rw11UnitLP11
\brief FIXME_docs
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
Rw11UnitLP11::Rw11UnitLP11(Rw11CntlLP11* pcntl, size_t index)
: Rw11UnitStreamBase<Rw11CntlLP11>(pcntl, index)
{
SetAttachOpts("?wonly"); // use write only (output) streams
}
//------------------------------------------+-----------------------------------
//! Destructor
Rw11UnitLP11::~Rw11UnitLP11()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11UnitLP11::Dump(std::ostream& os, int ind, const char* text) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11UnitLP11 @ " << this << endl;
Rw11UnitStreamBase<Rw11CntlLP11>::Dump(os, ind, " ^");
return;
}
} // end namespace Retro

View File

@@ -0,0 +1,53 @@
// $Id: Rw11UnitLP11.hpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitLP11.hpp 515 2013-05-04 17:28:59Z mueller $
\brief Declaration of class Rw11UnitLP11.
*/
#ifndef included_Retro_Rw11UnitLP11
#define included_Retro_Rw11UnitLP11 1
#include "Rw11VirtStream.hpp"
#include "Rw11UnitStreamBase.hpp"
namespace Retro {
class Rw11CntlLP11; // forw decl to avoid circular incl
class Rw11UnitLP11 : public Rw11UnitStreamBase<Rw11CntlLP11> {
public:
Rw11UnitLP11(Rw11CntlLP11* pcntl, size_t index);
~Rw11UnitLP11();
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
protected:
};
} // end namespace Retro
//#include "Rw11UnitLP11.ipp"
#endif

View File

@@ -0,0 +1,71 @@
// $Id: Rw11UnitPC11.cpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitPC11.cpp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation of Rw11UnitPC11.
*/
#include "boost/bind.hpp"
#include "librtools/RosFill.hpp"
#include "Rw11CntlPC11.hpp"
#include "Rw11UnitPC11.hpp"
using namespace std;
/*!
\class Retro::Rw11UnitPC11
\brief FIXME_docs
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
Rw11UnitPC11::Rw11UnitPC11(Rw11CntlPC11* pcntl, size_t index)
: Rw11UnitStreamBase<Rw11CntlPC11>(pcntl, index)
{
// unit 0 -> reader -> read only stream
// unit 1 -> puncher -> write only stream
const char* opts = (index==0) ? "?ronly" : "?wonly";
SetAttachOpts(opts);
}
//------------------------------------------+-----------------------------------
//! Destructor
Rw11UnitPC11::~Rw11UnitPC11()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11UnitPC11::Dump(std::ostream& os, int ind, const char* text) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11UnitPC11 @ " << this << endl;
Rw11UnitStreamBase<Rw11CntlPC11>::Dump(os, ind, " ^");
return;
}
} // end namespace Retro

View File

@@ -0,0 +1,53 @@
// $Id: Rw11UnitPC11.hpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-03 515 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitPC11.hpp 515 2013-05-04 17:28:59Z mueller $
\brief Declaration of class Rw11UnitPC11.
*/
#ifndef included_Retro_Rw11UnitPC11
#define included_Retro_Rw11UnitPC11 1
#include "Rw11VirtStream.hpp"
#include "Rw11UnitStreamBase.hpp"
namespace Retro {
class Rw11CntlPC11; // forw decl to avoid circular incl
class Rw11UnitPC11 : public Rw11UnitStreamBase<Rw11CntlPC11> {
public:
Rw11UnitPC11(Rw11CntlPC11* pcntl, size_t index);
~Rw11UnitPC11();
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
protected:
};
} // end namespace Retro
//#include "Rw11UnitPC11.ipp"
#endif

View File

@@ -0,0 +1,135 @@
// $Id: Rw11UnitStream.cpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-04 515 1.0 Initial version
// 2013-05-01 513 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitStream.cpp 515 2013-05-04 17:28:59Z mueller $
\brief Implemenation of Rw11UnitStream.
*/
#include "librtools/Rexception.hpp"
#include "Rw11UnitStream.hpp"
using namespace std;
/*!
\class Retro::Rw11UnitStream
\brief FIXME_docs
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
Rw11UnitStream::Rw11UnitStream(Rw11Cntl* pcntl, size_t index)
: Rw11UnitVirt<Rw11VirtStream>(pcntl, index)
{
fStats.Define(kStatNPreAttDrop, "NPreAttDrop",
"output bytes dropped prior attach");
fStats.Define(kStatNPreAttMiss, "NPreAttMiss",
"input bytes missed prior attach");
}
//------------------------------------------+-----------------------------------
//! Destructor
Rw11UnitStream::~Rw11UnitStream()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11UnitStream::SetPos(int pos)
{
if (!Virt())
throw Rexception("Rw11UnitStream::SetPos", "no stream attached");
RerrMsg emsg;
if (!Virt()->Seek(pos, emsg)) throw Rexception(emsg);
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
int Rw11UnitStream::Pos() const
{
if (!Virt())
throw Rexception("Rw11UnitStream::Pos", "no stream attached");
RerrMsg emsg;
int irc = Virt()->Tell(emsg);
if (irc < 0) throw Rexception(emsg);
return irc;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
int Rw11UnitStream::VirtRead(uint8_t* data, size_t count, RerrMsg& emsg)
{
if (!Virt()) {
fStats.Inc(kStatNPreAttMiss);
emsg.Init("Rw11UnitStream::VirtRead", "no stream attached");
return -1;
}
return Virt()->Read(data, count, emsg);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool Rw11UnitStream::VirtWrite(const uint8_t* data, size_t count, RerrMsg& emsg)
{
if (!Virt()) {
fStats.Inc(kStatNPreAttDrop, double(count));
emsg.Init("Rw11UnitStream::VirtWrite", "no stream attached");
return false;
}
return Virt()->Write(data, count, emsg);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool Rw11UnitStream::VirtFlush(RerrMsg& emsg)
{
if (!Virt()) {
emsg.Init("Rw11UnitStream::VirtFlush", "no stream attached");
return false;
}
return Virt()->Flush(emsg);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11UnitStream::Dump(std::ostream& os, int ind, const char* text) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11UnitStream @ " << this << endl;
Rw11UnitVirt<Rw11VirtStream>::Dump(os, ind, " ^");
return;
}
} // end namespace Retro

View File

@@ -0,0 +1,64 @@
// $Id: Rw11UnitStream.hpp 515 2013-05-04 17:28:59Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-05-04 515 1.0 Initial version
// 2013-05-01 513 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitStream.hpp 515 2013-05-04 17:28:59Z mueller $
\brief Declaration of class Rw11UnitStream.
*/
#ifndef included_Retro_Rw11UnitStream
#define included_Retro_Rw11UnitStream 1
#include "Rw11VirtStream.hpp"
#include "Rw11UnitVirt.hpp"
namespace Retro {
class Rw11UnitStream : public Rw11UnitVirt<Rw11VirtStream> {
public:
Rw11UnitStream(Rw11Cntl* pcntl, size_t index);
~Rw11UnitStream();
void SetPos(int pos);
int Pos() const;
int VirtRead(uint8_t* data, size_t count, RerrMsg& emsg);
bool VirtWrite(const uint8_t* data, size_t count, RerrMsg& emsg);
bool VirtFlush(RerrMsg& emsg);
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
// statistics counter indices
enum stats {
kStatNPreAttDrop = Rw11Unit::kDimStat,
kStatNPreAttMiss,
kDimStat
};
protected:
};
} // end namespace Retro
//#include "Rw11UnitStream.ipp"
#endif

Some files were not shown because too many files have changed in this diff Show More