public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Altmaier <joseph.altmaier@gmail.com>
To: sid@sources.redhat.com
Subject: Problem Halting Execution
Date: Fri, 28 May 2010 15:36:00 -0000	[thread overview]
Message-ID: <AANLkTikXtJzwH_0TxMmvCGn0PLM9U0-mxwiKg4tGEd8Q@mail.gmail.com> (raw)

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;
    }
}

             reply	other threads:[~2010-05-28 15:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28 15:36 Joseph Altmaier [this message]
2010-05-28 15:58 ` Frank Ch. Eigler
2010-05-28 16:12   ` Joseph Altmaier
2010-05-28 16:20     ` Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikXtJzwH_0TxMmvCGn0PLM9U0-mxwiKg4tGEd8Q@mail.gmail.com \
    --to=joseph.altmaier@gmail.com \
    --cc=sid@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).