1
0
mirror of https://github.com/livingcomputermuseum/UniBone.git synced 2026-05-01 13:57:19 +00:00
Files
livingcomputermuseum.UniBone/10.01_base/2_src/shared/unibus.h
Joerg Hoppe db0167afe1 Version 2019-06: many changes
PRU1 code split into multiple images
1. test functions
2. UNIBUS operation

PRU1 bus latch interface
Write byte/bits access not with MACROS (random optimizer influence),
now with *_helper() procedures. Same timing, more determinism, much code saving.
Nono more  ASM code to write PRU0 XFER area.

demo: menu to test UNIBUS signals directly

rework "Arbitration" logic: now 3-fold
Rework of UNIBUs arbtiration: NONE/CLIENT/MASTER
- no Arbitrator (SACK penidng for 11/34 Konsole) (NONE)
- phyiscal PDP_11 CPU is Arbitrator (CLIENT)
- UniBone implements Arbitrator (MASTER)
- Same PRU code loop handles all arbitration types

PRU buslatch timing slower, for some problematic PCBs

 More aggressive bus latch  selftest
 (mixed patterns, running on PRU now)

Refinement of ready-to-run scripts
- Adapted to changed "demo" menu
- new name scheme
<OS>_<boot- drive>_<PDP-11CPU>
indicates
- which OS is run
- which disk emulation is used and what is the boot device
- what is the (minimum) PDP-11 to run that

Merged in Joshs DMA timing for 11/84
UNIBUS master cycles waits 350 us before MSYN, instead 150.

Merged in Joshs DMA request queue
multiple devices canrequest INTR and DMAs concurrently, will be put on the bus sequentially

Merged in Joshs MSCP driver
- Build RT-11v5.5 for MSCP
- added boot loader "du.lst"

MSCP run scrips
2.11BSD on MSCP on PDP-11/44
RT11 on MSCP

Fix: image file sizing
Disk image file exptend automatically if block beyond current file end is written
2019-06-14 16:31:01 +02:00

120 lines
3.9 KiB
C++

/* unibus.h: shared structs used in PRU and ARM
Copyright (c) 2018, Joerg Hoppe
j_hoppe@t-online.de, www.retrocmp.com
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
JOERG HOPPE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12-nov-2018 JH entered beta phase
19-may-2018 JH created
*/
#ifndef _UNIBUS_H_
#define _UNIBUS_H_
#include <stdint.h>
#define UNIBUS_WORDCOUNT 0x20000 // 128KiW = 256 KiB
// bus transaction. can be directly assigned to lines C1,C0
#define UNIBUS_CONTROL_DATI 0x00 // 16 bit word from slave to master
#define UNIBUS_CONTROL_DATIP 0x01 // DATI, inhibts core restore. DATO must follow.
#define UNIBUS_CONTROL_DATO 0x02 // 16 bit word from master to slave
#define UNIBUS_CONTROL_DATOB 0x03 // 8 bit byte from master to slave
// data<15:8> for a00 = 1, data<7:0> for a00 = 0
#define UNIBUS_CONTROL_ISDATO(c) (!!((c) & 0x02)) // check for DATO/B
#define UNIBUS_TIMEOUTVAL 0xffffffff // EXAM result for bus timeout
// This simple byte/word union works only because PDP-11,ARM and PRU all are little endian.
// "PDP-11 is little-endian (with least significant bytes first)."
// "BeagleBone Debian: lscpu shows that it is little endian."
// pru c-compile is NOT called with --endian=big
typedef struct {
union {
uint16_t words[UNIBUS_WORDCOUNT] ;
uint8_t bytes[2*UNIBUS_WORDCOUNT] ;
} ;
} unibus_memory_t;
#ifdef ARM
// included only by ARM code
#include "logsource.hpp"
#include "utils.hpp"
// parameter and functions for low level UNIBUS control
class unibus_c: public logsource_c {
public:
enum arbitration_mode_enum {
ARBITRATION_MODE_NONE = 0, // no BR*/BG*, NR/NPG SACK protocoll
ARBITRATION_MODE_CLIENT = 1, // external Arbitrator (running PDP-11 CPU) required
ARBITRATION_MODE_MASTER = 2 // implmenet Arbitrator
// with or without physical CPU for arbitration
} ;
private:
timeout_c timeout;
public:
// percent of time to be used for DMA master cycles
unsigned dma_bandwidth_percent ;
// default size of dma block transfers
unsigned dma_wordcount ;
unibus_c() ;
static char *control2text(uint8_t control) ;
static char *data2text(unsigned val);
void init(void);
void powercycle(void) ;
void interrupt(uint8_t priority, uint16_t vector) ;
bool dma(enum unibus_c::arbitration_mode_enum arbitration_mode, uint8_t control, uint32_t startaddr,
unsigned blocksize);
void mem_read(enum unibus_c::arbitration_mode_enum arbitration_mode,
uint16_t *words, uint32_t start_addr,
uint32_t end_addr, unsigned blocksize, bool *timeout) ;
void mem_write(enum unibus_c::arbitration_mode_enum arbitration_mode,
uint16_t *words, unsigned start_addr,
unsigned end_addr, unsigned blocksize, bool *timeout) ;
uint32_t test_sizer(enum unibus_c::arbitration_mode_enum arbitration_mode) ;
uint16_t testwords[UNIBUS_WORDCOUNT];
void test_mem(enum unibus_c::arbitration_mode_enum arbitration_mode, uint32_t start_addr, uint32_t end_addr, unsigned mode) ;
};
extern unibus_c *unibus ;
#endif /* ARM */
#endif /* _UNIBUS_H_ */