mirror of
https://github.com/wfjm/w11.git
synced 2026-04-28 21:08:35 +00:00
add ExecWibr(),ExecRibr() and minor updates
- Rw11Cpu: add ExecWibr(),ExecRibr(); LoadAbs(): better trace format
- Rw11Cntl{DEUNA,DL11,LP11,RK11,RHRP,TM11}: use ExecWibr(),ExecRibr()
- ldadump: better -trec format of start address record
- asm-11: .end directive auto-creates '...end' label
- ti_w11: for -e use .end start address when available
- defs_cpu.mac: add some CPU system registers
- defs_dl.mac: fix naming typo
- defs_tm.mac: add function mnemos
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11CntlDEUNA.cpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11CntlDEUNA.cpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2014-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 0.5.9 use ExecWibr()
|
||||
// 2019-02-23 1114 0.5.8 use std::bind instead of lambda
|
||||
// 2018-12-19 1090 0.5.7 use RosPrintf(bool)
|
||||
// 2018-12-17 1087 0.5.6 use std::lock_guard instead of boost
|
||||
@@ -370,13 +371,7 @@ void Rw11CntlDEUNA::Start()
|
||||
|
||||
void Rw11CntlDEUNA::UnitSetup(size_t /*ind*/)
|
||||
{
|
||||
RlinkCommandList clist;
|
||||
Rw11Cpu& cpu = Cpu();
|
||||
|
||||
cpu.AddWibr(clist, fBase+kPR1, GetPr1());
|
||||
|
||||
Server().Exec(clist);
|
||||
|
||||
Cpu().ExecWibr(fBase+kPR1, GetPr1());
|
||||
// FIXME_code !!! Is that all ???
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11CntlDL11.cpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11CntlDL11.cpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 1.4.2 use ExecWibr(),ExecRibr()
|
||||
// 2019-04-14 1131 1.4.1 proper unit init, call UnitSetupAll() in Start()
|
||||
// 2019-04-06 1126 1.4 xbuf.val in msb; rrdy in rbuf (new iface)
|
||||
// 2019-02-23 1114 1.3.2 use std::bind instead of lambda
|
||||
@@ -154,11 +155,8 @@ void Rw11CntlDL11::Start()
|
||||
|
||||
void Rw11CntlDL11::UnitSetup(size_t /*ind*/)
|
||||
{
|
||||
Rw11Cpu& cpu = Cpu();
|
||||
uint16_t rcsr = (fRxRlim<<kRCSR_V_RLIM) & kRCSR_M_RLIM;
|
||||
RlinkCommandList clist;
|
||||
cpu.AddWibr(clist, fBase+kRCSR, rcsr);
|
||||
Server().Exec(clist);
|
||||
Cpu().ExecWibr(fBase+kRCSR, rcsr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,10 +166,7 @@ void Rw11CntlDL11::UnitSetup(size_t /*ind*/)
|
||||
void Rw11CntlDL11::Wakeup()
|
||||
{
|
||||
if (!fspUnit[0]->RcvQueueEmpty()) {
|
||||
RlinkCommandList clist;
|
||||
size_t ircsr = Cpu().AddRibr(clist, fBase+kRCSR);
|
||||
Server().Exec(clist);
|
||||
uint16_t rcsr = clist[ircsr].Data();
|
||||
uint16_t rcsr = Cpu().ExecRibr(fBase+kRCSR);
|
||||
if ((rcsr & kRCSR_M_RDONE) == 0) RcvChar(); // send if RBUF not full
|
||||
}
|
||||
|
||||
@@ -245,9 +240,7 @@ void Rw11CntlDL11::RcvChar()
|
||||
{
|
||||
uint8_t ichr = fspUnit[0]->RcvQueueNext();
|
||||
if (fTraceLevel>0) TraceChar('r', 0, ichr);
|
||||
RlinkCommandList clist;
|
||||
Cpu().AddWibr(clist, fBase+kRBUF, ichr);
|
||||
Server().Exec(clist);
|
||||
Cpu().ExecWibr(fBase+kRBUF, ichr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11CntlLP11.cpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11CntlLP11.cpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 1.3.3 use ExecWibr()
|
||||
// 2019-04-14 1131 1.3.2 remove SetOnline(), use UnitSetup()
|
||||
// 2019-04-07 1127 1.3.1 add fQueBusy, queue protection; fix logic;
|
||||
// Start(): ensure unit offline; better tracing
|
||||
@@ -161,15 +162,10 @@ void Rw11CntlLP11::Start()
|
||||
void Rw11CntlLP11::UnitSetup(size_t ind)
|
||||
{
|
||||
Rw11UnitLP11& unit = *fspUnit[ind];
|
||||
bool online = unit.HasVirt() && ! unit.Virt().Error();
|
||||
|
||||
Rw11Cpu& cpu = Cpu();
|
||||
uint16_t csr = (online ? 0 : kCSR_M_ERROR) | // err field
|
||||
((fRlim & kCSR_B_RLIM) << kCSR_V_RLIM); // rlim field
|
||||
RlinkCommandList clist;
|
||||
cpu.AddWibr(clist, fBase+kCSR, csr);
|
||||
Server().Exec(clist);
|
||||
|
||||
bool online = unit.HasVirt() && ! unit.Virt().Error();
|
||||
uint16_t csr = (online ? 0 : kCSR_M_ERROR) | // err field
|
||||
((fRlim & kCSR_B_RLIM) << kCSR_V_RLIM); // rlim field
|
||||
Cpu().ExecWibr(fBase+kCSR, csr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -199,6 +195,7 @@ void Rw11CntlLP11::Dump(std::ostream& os, int ind, const char* text,
|
||||
os << bl << " fItype: " << RosPrintf(fItype,"d",3) << endl;
|
||||
os << bl << " fFsize: " << RosPrintf(fFsize,"d",3) << endl;
|
||||
os << bl << " fRblkSize: " << RosPrintf(fRblkSize,"d",3) << endl;
|
||||
os << bl << " fQueBusy: " << RosPrintf(fQueBusy) << endl;
|
||||
|
||||
Rw11CntlBase<Rw11UnitLP11,1>::Dump(os, ind, " ^", detail);
|
||||
return;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11CntlLP11.hpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11CntlLP11.hpp 1132 2019-04-14 20:23:40Z mueller $
|
||||
//
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -95,12 +95,12 @@ namespace Retro {
|
||||
int RcvHandler();
|
||||
|
||||
protected:
|
||||
size_t fPC_buf; //!< PrimClist: buf index
|
||||
uint16_t fRlim; //!< interrupt rate limit
|
||||
uint16_t fItype; //!< interface type
|
||||
uint16_t fFsize; //!< fifo size
|
||||
uint16_t fRblkSize; //!< rblk chunk size
|
||||
bool fQueBusy; //!< rcv queue busy
|
||||
size_t fPC_buf; //!< PrimClist: buf index
|
||||
uint16_t fRlim; //!< interrupt rate limit
|
||||
uint16_t fItype; //!< interface type
|
||||
uint16_t fFsize; //!< fifo size
|
||||
uint16_t fRblkSize; //!< rblk chunk size
|
||||
bool fQueBusy; //!< rcv queue busy
|
||||
};
|
||||
|
||||
} // end namespace Retro
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11CntlRHRP.cpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11CntlRHRP.cpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2015-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Other credits:
|
||||
@@ -15,6 +15,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 1.0.12 use ExecWibr()
|
||||
// 2019-04-14 1131 1.0.11 proper unit init, call UnitSetupAll() in Start()
|
||||
// 2019-02-23 1114 1.0.10 use std::bind instead of lambda
|
||||
// 2018-12-19 1090 1.0.9 use RosPrintf(bool)
|
||||
@@ -292,8 +293,6 @@ void Rw11CntlRHRP::Start()
|
||||
void Rw11CntlRHRP::UnitSetup(size_t ind)
|
||||
{
|
||||
Rw11UnitRHRP& unit = *fspUnit[ind];
|
||||
RlinkCommandList clist;
|
||||
Rw11Cpu& cpu = Cpu();
|
||||
|
||||
// only two mayor drive states are used
|
||||
// power medium wlock : ds flags
|
||||
@@ -318,12 +317,10 @@ void Rw11CntlRHRP::UnitSetup(size_t ind)
|
||||
}
|
||||
|
||||
unit.SetRpds(rpds); // remember new DS
|
||||
cpu.AddWibr(clist, fBase+kRPCS1, // setup unit
|
||||
(ind << kRPCS1_V_RUNIT) |
|
||||
(kRFUNC_WUNIT << kRPCS1_V_FUNC) );
|
||||
cpu.AddWibr(clist, fBase+kRPDT, unit.Rpdt()); // setup DT
|
||||
cpu.AddWibr(clist, fBase+kRPDS, rpds); // setup DS
|
||||
Server().Exec(clist);
|
||||
Cpu().ExecWibr(fBase+kRPCS1, (ind << kRPCS1_V_RUNIT) | // setup unit
|
||||
(kRFUNC_WUNIT << kRPCS1_V_FUNC),
|
||||
fBase+kRPDT, unit.Rpdt(), // setup DT
|
||||
fBase+kRPDS, rpds); // setup DS
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -433,8 +430,8 @@ int Rw11CntlRHRP::AttnHandler(RlinkServer::AttnArgs& args)
|
||||
uint32_t nwrd = (~uint32_t(rpwc)&0xffff) + 1; // transfer size in words
|
||||
|
||||
// all 4 units are always available, but check anyway
|
||||
if (unum > NUnit())
|
||||
throw Rexception("Rw11CntlRHRP::AttnHandler","Bad state: unum > NUnit()");
|
||||
if (unum >= NUnit())
|
||||
throw Rexception("Rw11CntlRHRP::AttnHandler","Bad state: unum >= NUnit()");
|
||||
|
||||
Rw11UnitRHRP& unit = *fspUnit[unum];
|
||||
//Rw11Cpu& cpu = Cpu();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11CntlRK11.cpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11CntlRK11.cpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Other credits:
|
||||
@@ -15,6 +15,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 2.0.12 use ExecWibr()
|
||||
// 2019-04-14 1131 2.0.11 proper unit init, call UnitSetupAll() in Start()
|
||||
// 2019-02-23 1114 2.0.10 use std::bind instead of lambda
|
||||
// 2018-12-19 1090 2.0.9 use RosPrintf(bool)
|
||||
@@ -237,8 +238,6 @@ void Rw11CntlRK11::Start()
|
||||
void Rw11CntlRK11::UnitSetup(size_t ind)
|
||||
{
|
||||
Rw11UnitRK11& unit = *fspUnit[ind];
|
||||
Rw11Cpu& cpu = Cpu();
|
||||
RlinkCommandList clist;
|
||||
|
||||
uint16_t rkds = ind<<kRKDS_V_ID;
|
||||
if (unit.HasVirt()) { // file attached
|
||||
@@ -250,8 +249,7 @@ void Rw11CntlRK11::UnitSetup(size_t ind)
|
||||
rkds |= kRKDS_M_WPS;
|
||||
}
|
||||
unit.SetRkds(rkds);
|
||||
cpu.AddWibr(clist, fBase+kRKDS, rkds);
|
||||
Server().Exec(clist);
|
||||
Cpu().ExecWibr(fBase+kRKDS, rkds);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11CntlTM11.cpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11CntlTM11.cpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2015-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Other credits:
|
||||
@@ -15,6 +15,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 1.0.10 use ExecWibr()
|
||||
// 2019-04-14 1131 1.0.9 proper unit init, call UnitSetupAll() in Start()
|
||||
// 2019-02-23 1114 1.0.8 use std::bind instead of lambda
|
||||
// 2018-12-15 1082 1.0.7 use std::bind or lambda instead of boost::bind
|
||||
@@ -220,8 +221,6 @@ void Rw11CntlTM11::Start()
|
||||
void Rw11CntlTM11::UnitSetup(size_t ind)
|
||||
{
|
||||
Rw11UnitTM11& unit = *fspUnit[ind];
|
||||
Rw11Cpu& cpu = Cpu();
|
||||
RlinkCommandList clist;
|
||||
|
||||
uint16_t tmds = 0;
|
||||
if (unit.HasVirt()) { // file attached
|
||||
@@ -230,10 +229,9 @@ void Rw11CntlTM11::UnitSetup(size_t ind)
|
||||
if (unit.Virt().Bot()) tmds |= kTMRL_M_BOT;
|
||||
}
|
||||
unit.SetTmds(tmds);
|
||||
cpu.AddWibr(clist, fBase+kTMCR, (uint16_t(ind)<<kTMCR_V_RUNIT)|
|
||||
(kRFUNC_WUNIT<<kTMCR_V_FUNC) );
|
||||
cpu.AddWibr(clist, fBase+kTMRL, tmds);
|
||||
Server().Exec(clist);
|
||||
Cpu().ExecWibr(fBase+kTMCR, (uint16_t(ind)<<kTMCR_V_RUNIT)|
|
||||
(kRFUNC_WUNIT<<kTMCR_V_FUNC),
|
||||
fBase+kTMRL, tmds);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -357,7 +355,7 @@ int Rw11CntlTM11::AttnHandler(RlinkServer::AttnArgs& args)
|
||||
}
|
||||
|
||||
// check for general abort conditions: invalid unit number
|
||||
if (unum > NUnit()) {
|
||||
if (unum >= NUnit()) {
|
||||
AddErrorExit(clist, kTMCR_M_RICMD);
|
||||
Server().Exec(clist);
|
||||
return 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11Cpu.cpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11Cpu.cpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 1.2.18 add ExecWibr(),ExecRibr(); LoadAbs(): better trace
|
||||
// 2019-04-13 1131 1.2.17 add defs for w11 cpu component addresses; add
|
||||
// MemSize(),MemWriteByte(); LoadAbs(): return start,
|
||||
// better odd byte handling;
|
||||
@@ -489,6 +490,32 @@ int Rw11Cpu::AddWMem(RlinkCommandList& clist, uint32_t addr,
|
||||
//------------------------------------------+-----------------------------------
|
||||
//! FIXME_docs
|
||||
|
||||
void Rw11Cpu::ExecWibr(uint16_t ibaddr0, uint16_t data0,
|
||||
uint16_t ibaddr1, uint16_t data1,
|
||||
uint16_t ibaddr2, uint16_t data2)
|
||||
{
|
||||
RlinkCommandList clist;
|
||||
AddWibr(clist, ibaddr0, data0);
|
||||
if (ibaddr1 > 0) AddWibr(clist, ibaddr1, data1);
|
||||
if (ibaddr2 > 0) AddWibr(clist, ibaddr2, data2);
|
||||
Server().Exec(clist);
|
||||
return;
|
||||
}
|
||||
|
||||
//------------------------------------------+-----------------------------------
|
||||
//! FIXME_docs
|
||||
|
||||
uint16_t Rw11Cpu::ExecRibr(uint16_t ibaddr)
|
||||
{
|
||||
RlinkCommandList clist;
|
||||
int ic = AddRibr(clist, ibaddr);
|
||||
Server().Exec(clist);
|
||||
return clist[ic].Data();
|
||||
}
|
||||
|
||||
//------------------------------------------+-----------------------------------
|
||||
//! FIXME_docs
|
||||
|
||||
bool Rw11Cpu::MemRead(uint16_t addr, std::vector<uint16_t>& data,
|
||||
size_t nword, RerrMsg& emsg)
|
||||
{
|
||||
@@ -722,8 +749,9 @@ bool Rw11Cpu::LoadAbs(const std::string& fname, RerrMsg& emsg,
|
||||
RlogMsg lmsg(Connect().LogFile());
|
||||
lmsg << "LoadAbs-I: block " << RosPrintf(blknum,"d",3)
|
||||
<< ", length " << RosPrintf(bytcnt-6,"d",5)
|
||||
<< " byte, address " << RosPrintBvi(ldaddr,8)
|
||||
<< ":" << RosPrintBvi(uint16_t(ldaddr+(bytcnt-6)-1),8);
|
||||
<< " byte, address " << RosPrintBvi(ldaddr,8);
|
||||
if (bytcnt > 6)
|
||||
lmsg << ":" << RosPrintBvi(uint16_t(ldaddr+(bytcnt-6)-1),8);
|
||||
}
|
||||
state = (bytcnt == 6) ? s_chksum : s_data;
|
||||
break;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11Cpu.hpp 1131 2019-04-14 13:24:25Z mueller $
|
||||
// $Id: Rw11Cpu.hpp 1133 2019-04-19 18:43:00Z mueller $
|
||||
//
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-04-19 1133 1.2.18 add ExecWibr(),ExecRibr()
|
||||
// 2019-04-13 1131 1.2.17 add defs for w11 cpu component addresses; add
|
||||
// MemSize(),MemWriteByte(); LoadAbs() returns start
|
||||
// 2019-02-15 1112 1.2.16 add HasIbtst()
|
||||
@@ -136,6 +137,11 @@ namespace Retro {
|
||||
const uint16_t* buf, size_t size,
|
||||
uint16_t mode=kCPAH_M_22BIT,
|
||||
bool singleblk=false);
|
||||
|
||||
void ExecWibr(uint16_t ibaddr0, uint16_t data0,
|
||||
uint16_t ibaddr1=0, uint16_t data1=0,
|
||||
uint16_t ibaddr2=0, uint16_t data2=0);
|
||||
uint16_t ExecRibr(uint16_t ibaddr);
|
||||
|
||||
bool MemRead(uint16_t addr, std::vector<uint16_t>& data,
|
||||
size_t nword, RerrMsg& emsg);
|
||||
@@ -248,7 +254,7 @@ namespace Retro {
|
||||
static const uint16_t kCPUSDREG = 0177570; //!< CPU SDREG address
|
||||
|
||||
static const uint16_t kMEMHISIZE = 0177762; //!< MEM HISIZE address
|
||||
static const uint16_t kMEMLOSIZE = 0177760; //!< MEM HISIZE address
|
||||
static const uint16_t kMEMLOSIZE = 0177760; //!< MEM LOSIZE address
|
||||
static const uint16_t kMEMHM = 0177752; //!< MEM HM address
|
||||
static const uint16_t kMEMMAINT = 0177750; //!< MEM MAINT address
|
||||
static const uint16_t kMEMCNTRL = 0177746; //!< MEM CNTRL address
|
||||
|
||||
Reference in New Issue
Block a user