Guys, <div><br></div><div>Now I am facing another problem. In the file disksim_interface.c it is written that the function disksim_interface_io_done_notify () can be used as a call back for request completion. <div><br></div>

<div>/* This is the disksim callback for reporting completion of a disk</div><div> * request to the system-level simulation -- the system-level *</div><div> * simulation should incorporate this completion as appropriate *</div>

<div> * (probably by inserting a simulated "disk completion interrupt" at *</div><div> * the specified simulated time).  Based on the requestdesc pointed to</div><div> * * by "curr->buf" (below), the system-level simulation should be</div>

<div> * able * to determine which request completed.  (A ptr to the</div><div> * system-level * simulator's request structure is a reasonable use of</div><div> * "curr->buf".)</div><div><br></div><div>According to this paragraph it says that curr->buf can be used at the system level driver for calculating statistics. However, buff->start is not indicating the start time of the request that got completed and is indicating the start time of the recent request scheduled (It perfectly works for synchronous requests as the example shows, but for asynchronous requests its giving out -ve response times). Am I missing something here, any advice on the situation is highly appreciated.</div>

<div><br></div><div><br></div><br><div class="gmail_quote">On 18 December 2011 03:20, kolla purushotham <span dir="ltr"><<a href="mailto:kollapurushotham@gmail.com">kollapurushotham@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Guys,<div><br></div><div>First of all let me thank Peter :). This is what I ended up with to make the system level simulation work in an asynchronous way (so that some one can use it as a reference). </div><div><br></div>

<div>
<div>while(fgets(line, 200, tracefile)) </div><div>{</div><div><br></div><div>    sscanf(line, "%lf %d %d %d %d \n", &r.start, &r.devno, &r.blkno, &r.bytecount, &r.flags);</div><div>    printf("%lf %d %d %d \n", r.start, r.devno, r.blkno, r.bytecount/512);</div>


<div>    fflush(stdout);</div><div>    nextiotime = r.start;</div><div><br></div><div>    while((nextiotime >= next_event) & (start == 1))    // used start as a flag to mark it as a first time entry to the loop.</div>


<div>    {</div><div>        currtime = next_event;</div><div>        disksim_interface_internal_event(disksimIntr, currtime, 0);</div><div>    }</div><div>    {</div><div>        start = 1;</div><div>        currtime = nextiotime;</div>


<div>        disksim_interface_request_arrive(disksimIntr, currtime, &r);</div><div>    }</div><div>}</div><div><br></div><font color="#888888">-- <br>Regards,<br>Purushotham<br>
</font></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Purushotham<br>
</div>