Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/iti/cmdline"
"github.com/iti/evt/evtm"
"github.com/iti/evt/vrtime"
"github.com/iti/mrnes"
"github.com/iti/rngstream"
"golang.org/x/exp/slices"
Expand Down Expand Up @@ -103,7 +104,9 @@ func ReadSimArgs() (*cmdline.CmdParser, *evtm.EventManager) {
}

// if there is no stop argument, termination is made very large
termination = math.MaxFloat64/10.0
// termination CANNOT be the max float value because it will overflow vrtime's internal
// (int64) tick counter and become VERY negative.
termination = vrtime.TicksToSeconds(math.MaxInt64 / 2)
if cp.IsLoaded("stop") {
termination = cp.GetVar("stop").(float64)
}
Expand Down