bugSimulavr: an AVR simulator - Bugs: bug #47065, RemoveMinimumAndInsert does not...

 
 

bug #47065: RemoveMinimumAndInsert does not work for two simulation members, in systemclock.cpp

Submitted by:  None
Submitted on:  Fri 05 Feb 2016 09:40:34 AM UTC  
 
Category: SimulationSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Component Version: simulavr

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 05 Feb 2016 09:40:34 AM UTC, original submission:

example, with two SimulationMembers: ui and core

heap:
0: <10, ui>
1: <10, core>
heap->size=2

remove minimum and insert:
k=40 v=ui

execution:
i = 1

first iteration:
left = i*2 = 2
right = i*2+1 = 3
smallest = i = 1
if(1 < 2 && 10 < 40) // true
smallest = left = 2
if(2 < 2 && ...) // false
if(smallest == i) // false
k_temp, v_temp = heap[smallest-1] = heap[1] = <10, core>
heap[1] = <40, ui>
k, v = k_temp, v_temp = <10, core>
i = smallest = 2

second iteration:
left = i*2 = 4
right = i*2+1 = 5
smallest = 2
if(3 < 2 && ...) // false
if(4 < 2 && ...) // false
if(smallest == i) // true
heap[smallest-1] = heap[1] = k,v = <10, core>
return

heap:
0: <10, ui>
1: <10, core>

meaning that core->Step will not be called again until ui has finished

a patch that fixes this bug (among other things) is
http://sgerwk.altervista.org/simulavrscript/simulavr-1.0.0.patch

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup1