Skip to content

Treating empty cycles in performance simulator #1444

Answered by pavelkryukov
graudtv asked this question in UI/UX
Discussion options

You must be logged in to vote

Empty loops are often used as an indication to halt.
Here is where it is handled:

static void check_halt_trap( Instr* instr) {
// Handles 'goto nullptr;' and 'while (1);' cases
if ( instr->new_PC == 0 || instr->new_PC == instr->PC)
instr->trap = Trap::HALT;
}

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pavelkryukov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
UI/UX
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1444 on December 10, 2020 14:54.