public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* Problem Halting Execution
@ 2010-05-28 15:36 Joseph Altmaier
  2010-05-28 15:58 ` Frank Ch. Eigler
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph Altmaier @ 2010-05-28 15:36 UTC (permalink / raw)
  To: sid

I'm writing a SID port, and I can't get it to halt properly.  What is
the functionality of yield()?  It does not seem to stop instruction
flow.  When yield() is called step_insns() will return after the break
at the end of the loop but then it gets called again.  Included is
pseudocode for my step_insns() function.  Any help would be
appreciated.

Thanks!
Joseph Altmaier

void
*processor*_cpu::step_insns ()
{
  bool found;

  while (true)
    {
      get next PC

      for(int u = 0; u < 2; u++) {//Two execution units

        Get next instruction for current execution unit

        if (the instruction is not found)
        {
          Get the instruction manually
        }

        Instruction disassembley...

        try//Execute the instruction and cope with it if the instruction fails.
        {
          Execute the current instruction for the current execution unit
        }
        catch (cpu_memory_fault& t)
        {
          this->memory_trap (t);
          this->yield ();
        }
        catch (cpu_exception& t)
        {
          this->yield ();//A halt instruction will cause a
cpu_exception and a yeild()
        }

        try {
          if(Second execution unit){
            Execute a writeback on a pair of write stacks
          }
        }
        catch (cpu_memory_fault& t)
        {
          this->memory_trap (t);
          this->yield();
        }
        catch (cpu_exception& t)
        {
          this->yield ();
        }

        move ahead through circular pipeline

        Do post-instruction processing
      }

      if (stop_after_insns_p (1))
        break;
    }
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem Halting Execution
  2010-05-28 15:36 Problem Halting Execution Joseph Altmaier
@ 2010-05-28 15:58 ` Frank Ch. Eigler
  2010-05-28 16:12   ` Joseph Altmaier
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Ch. Eigler @ 2010-05-28 15:58 UTC (permalink / raw)
  To: Joseph Altmaier; +Cc: sid

Hi -

> I'm writing a SID port, and I can't get it to halt properly.

What kind of halt do you want exactly?  A simulator termination?
Handing of control to gdb?

> What is the functionality of yield()?� It does not seem to stop
> instruction flow.

It should end the step_insn() loop soon and return.

> When yield() is called step_insns() will return after the break at
> the end of the loop but then it gets called again. [...]

Yes, unless told otherwise, the scheduler that's driving the cpu
instruction steps will signal again to continue running.

- FChE

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem Halting Execution
  2010-05-28 15:58 ` Frank Ch. Eigler
@ 2010-05-28 16:12   ` Joseph Altmaier
  2010-05-28 16:20     ` Frank Ch. Eigler
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph Altmaier @ 2010-05-28 16:12 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: sid

I'm trying to hand control to GDB.  I have looked at other ports and I
have not seen where they do this, but I must have missed something.

Joseph

On Fri, May 28, 2010 at 10:58 AM, Frank Ch. Eigler <fche@redhat.com> wrote:
> Hi -
>
>> I'm writing a SID port, and I can't get it to halt properly.
>
> What kind of halt do you want exactly?  A simulator termination?
> Handing of control to gdb?
>
>> What is the functionality of yield()?� It does not seem to stop
>> instruction flow.
>
> It should end the step_insn() loop soon and return.
>
>> When yield() is called step_insns() will return after the break at
>> the end of the loop but then it gets called again. [...]
>
> Yes, unless told otherwise, the scheduler that's driving the cpu
> instruction steps will signal again to continue running.
>
> - FChE
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem Halting Execution
  2010-05-28 16:12   ` Joseph Altmaier
@ 2010-05-28 16:20     ` Frank Ch. Eigler
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Ch. Eigler @ 2010-05-28 16:20 UTC (permalink / raw)
  To: Joseph Altmaier; +Cc: sid

Hi -

> I'm trying to hand control to GDB.  I have looked at other ports and I
> have not seen where they do this, but I must have missed something.

OK.  The magic there should reside in the sid configuration, and
cpu<->gdb component pin-connections related to traps and the target
scheduler.  See also include/sidcpuutil.h's signal_trap().

- FChE

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-28 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-28 15:36 Problem Halting Execution Joseph Altmaier
2010-05-28 15:58 ` Frank Ch. Eigler
2010-05-28 16:12   ` Joseph Altmaier
2010-05-28 16:20     ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).