From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17293 invoked by alias); 28 May 2010 15:36:49 -0000 Received: (qmail 17285 invoked by uid 22791); 28 May 2010 15:36:48 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pv0-f175.google.com (HELO mail-pv0-f175.google.com) (74.125.83.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 May 2010 15:36:39 +0000 Received: by pvc30 with SMTP id 30so593661pvc.20 for ; Fri, 28 May 2010 08:36:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.132.6 with SMTP id j6mr306682wfn.278.1275060998211; Fri, 28 May 2010 08:36:38 -0700 (PDT) Received: by 10.142.232.6 with HTTP; Fri, 28 May 2010 08:36:38 -0700 (PDT) Date: Fri, 28 May 2010 15:36:00 -0000 Message-ID: Subject: Problem Halting Execution From: Joseph Altmaier To: sid@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact sid-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00002.txt.bz2 I'm writing a SID port, and I can't get it to halt properly.=A0 What is the functionality of yield()?=A0 It does not seem to stop instruction flow.=A0 When yield() is called step_insns() will return after the break at the end of the loop but then it gets called again.=A0 Included is pseudocode for my step_insns() function.=A0 Any help would be appreciated. Thanks! Joseph Altmaier void *processor*_cpu::step_insns () { =A0 bool found; =A0 while (true) =A0=A0=A0 { =A0=A0=A0=A0=A0 get next PC =A0=A0=A0=A0=A0 for(int u =3D 0; u < 2; u++) {//Two execution units =A0=A0=A0=A0=A0=A0=A0 Get next instruction for current execution unit =A0=A0=A0=A0 =A0=A0 if (the instruction is not found) =A0 =A0=A0 =A0=A0 { =A0=A0=A0 =A0=A0 =A0=A0 Get the instruction manually =A0=A0 =A0 =A0=A0 } =A0=A0=A0 =A0 =A0 Instruction disassembley... =A0=A0=A0 =A0 =A0 try//Execute the instruction and cope with it if the inst= ruction fails. =A0=A0=A0 =A0 =A0 { =A0=A0=A0 =A0=A0 =A0=A0 Execute the current instruction for the current exe= cution unit =A0=A0 =A0=A0 =A0 } =A0=A0=A0 =A0 =A0 catch (cpu_memory_fault& t) =A0=A0 =A0=A0 =A0 { =A0=A0 =A0=A0 =A0=A0=A0 this->memory_trap (t); =A0 =A0 =A0 =A0=A0=A0 this->yield (); =A0 =A0 =A0 =A0 } =A0=A0=A0=A0=A0=A0=A0 catch (cpu_exception& t) =A0 =A0 =A0 =A0 { =A0=A0=A0 =A0=A0 =A0=A0 this->yield ();//A halt instruction will cause a cpu_exception and a yeild() =A0=A0 =A0=A0 =A0 } =A0=A0 =A0=A0=A0=A0 try { =A0 =A0 =A0 =A0=A0=A0 if(Second execution unit){ =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 Execute a writeback on a pair of write stac= ks =A0=A0 =A0=A0 =A0=A0=A0 } =A0 =A0=A0 =A0=A0 } =A0=A0 =A0=A0 =A0 catch (cpu_memory_fault& t) =A0=A0 =A0=A0 =A0 { =A0=A0 =A0=A0 =A0=A0=A0 this->memory_trap (t); =A0=A0 =A0=A0 =A0=A0=A0 this->yield(); =A0 =A0=A0 =A0=A0 } =A0=A0 =A0=A0 =A0 catch (cpu_exception& t) =A0 =A0=A0 =A0=A0 { =A0 =A0=A0 =A0=A0=A0=A0 this->yield (); =A0 =A0=A0 =A0=A0 } =A0=A0 =A0=A0=A0=A0 move ahead through circular pipeline =A0=A0=A0=A0=A0=A0=A0 Do post-instruction processing =A0 =A0=A0=A0 } =A0=A0=A0=A0=A0 if (stop_after_insns_p (1)) =A0 =A0=A0=A0=A0=A0 break; =A0=A0=A0 } }