1
0
mirror of synced 2026-05-03 14:39:01 +00:00

Fixed (?) cc hang related to RTC readings: in this version, the simulator is making certain

that no two subsequent RTC readings will produce the same output.
This commit is contained in:
Andras Tantos
2020-09-12 23:36:36 +00:00
parent d14f08e161
commit 0c5ab84c89
3 changed files with 27 additions and 19 deletions

View File

@@ -263,7 +263,7 @@ Mainframe_c::Mainframe_c(const Configuration_c &aConfig, CLogger_c &aLogger, boo
std::string Direction = CpuChannel.second.get<std::string>("Direction", "Auto");
bool IsInput;
if (Direction == "Input") { IsInput = true; }
else if (Direction == "Output") { IsInput = false; }
else if (Direction == "Output") { IsInput = false; }
else if (Direction == "Auto") { IsInput = (ChannelIdx % 2) == 0; }
else throw InvalidParameter_x(boost::format("Invalid direction for logger channel %1%: %2%") % (ChannelIdx + 8) % Direction);
mOwnedChannels[ChannelIdx] = std::make_unique<LoggerChannel_c>(CpuChannel.second, ChannelIdx + 8, *this, mLogger, IsInput);
@@ -763,3 +763,17 @@ CInt_t Mainframe_c::SimToHost(CInt_t aValue) {
CInt_t Mainframe_c::HostToSim() {
return CInt_t(1) << 63;
}
CInt_t Mainframe_c::GetRealTimeClock() const {
if (mUseHostRealTimeClock) {
boost::timer::nanosecond_type DeltaTime = mRealTimeTimer.elapsed().wall - mRealTimeStart;
CInt_t DeltaClocks = CInt_t(double(DeltaTime) / mCpuClockPeriod);
if (DeltaClocks == mLastRealTimeReading) {
DeltaClocks += 1;
}
mLastRealTimeReading = DeltaClocks;
return mRealTimeClock + DeltaClocks;
} else {
return mRealTimeClock;
}
}

View File

@@ -328,18 +328,11 @@ public:
void DeadStart();
void ChannelTick();
virtual CInt_t GetRealTimeClock() const {
if (mUseHostRealTimeClock) {
boost::timer::nanosecond_type DeltaTime = mRealTimeTimer.elapsed().wall - mRealTimeStart;
CInt_t DeltaClocks = CInt_t(double(DeltaTime) / mCpuClockPeriod);
return mRealTimeClock + DeltaClocks;
} else {
return mRealTimeClock;
}
}
virtual CInt_t GetRealTimeClock() const;
void SetRealTimeClock(CInt_t aValue) {
if (mUseHostRealTimeClock) {
mRealTimeStart = mRealTimeTimer.elapsed().wall;
mLastRealTimeReading = 0;
}
mRealTimeClock = aValue;
}
@@ -373,6 +366,7 @@ protected:
MachineTypes_e mMachineType;
bool mMultiThreaded;
bool mDisableAutoTerminal;
mutable CInt_t mLastRealTimeReading;
class MainFrameEventDispatcher_c: public DebugEventDispatcher_c {
public:
@@ -441,7 +435,7 @@ protected:
bool mCpuMasterClear;
uint64_t mTickCnt;
bool mEnableTimeStamp;
OsTypes_e mOsType;

View File

@@ -33,7 +33,7 @@ SysCallTableEnd 0x000C5A57
ProcTableBase 0x000357B7
ProcTableLength 650 ; NPROC from config.h
RealTimeClockIncrement 90 ; By how much should the real time clock increment for every instruction burst
RealTimeClockIncrement 10 ; By how much should the real time clock increment for every instruction burst
OsType UNICOS ; Controls how syscalls are decoded for the logger
@@ -92,13 +92,13 @@ IopClusters {
Channel 17
}
EthInterfaces {
; en0 {
; InterfaceNameLinux tap0 ; Tap interface name to connect to on Linux
; InterfaceNameWindows "Cray Ethernet" ; WinTap interface name to connect to on Windows
; SimMacAddr 0x020143524159
; Channel 020
; IopNumber 0
; }
en0 {
InterfaceNameLinux tap1 ; Tap interface name to connect to on Linux
InterfaceNameWindows "Cray Ethernet" ; WinTap interface name to connect to on Windows
SimMacAddr 0x020143524159
Channel 020
IopNumber 0
}
}
Disks { ; Disc configuration must precisely match that in install.param. Best not to touch unless you know what you're doing
swap {