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

 
 

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

Submitter:  None
Submitted:  Fri 05 Feb 2016 09:40:34 AM UTC
   
 
Category:  Simulation Severity:  3 - Normal
Item Group:  None Status:  Need Info
Privacy:  Public Assigned to:  None
Originator Email:  * -email is unavailable- Open/Closed:  Open
Component Version:  * simulavr
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 04 Dec 2019 03:41:59 PM UTC, comment #1: 

Partly taken over for upcoming release.

Some of the original change are improvements or new features (especially for tcl ui part) not bugs. Some is obsolete with the cmake build configuration.

The part for start bit detection is not solved and to clarify.

systemclock part is rewritten. (method RemoveMinimumAndInsert doesn't exist anymore) For this it's
to check, if the problem with co-simulating device and ui together will make problems with the
current implementation!

@all, which use TCL extention: could you review the changes, which improve / influence ui part and decide, what's good/ok or
what's to discuss.

I have appended the patch file (and a text file with remarks for that) without the parts, which
are taken over!

(file #47995, file #47996)

Thomas K. <tomk>
Group administrator
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 Files:
   
   
Comment:
   

Attached Files
file #47995:  bug47065_remarks.txt added by tomk (1KiB - text/plain)
file #47996:  simulavr-1.0.0.patch added by tomk (16KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tomk (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-04 tomk Attached File- Added bug47065_remarks.txt, #47995
        Attached File- Added simulavr-1.0.0.patch, #47996
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code