From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25095 invoked by alias); 16 Jan 2012 07:50:22 -0000 Received: (qmail 25080 invoked by uid 22791); 16 Jan 2012 07:50:20 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jan 2012 07:50:07 +0000 Received: by vcdn13 with SMTP id n13so47449vcd.0 for ; Sun, 15 Jan 2012 23:50:06 -0800 (PST) Received: by 10.221.13.138 with SMTP id pm10mr6450841vcb.60.1326700206331; Sun, 15 Jan 2012 23:50:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.67.105 with HTTP; Sun, 15 Jan 2012 23:49:45 -0800 (PST) In-Reply-To: References: From: Julius Baxter Date: Mon, 16 Jan 2012 07:50:00 -0000 Message-ID: Subject: Re: Delay slots in GNU sim To: cgen@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2012-q1/txt/msg00004.txt.bz2 On Sun, Jan 15, 2012 at 2:24 PM, Julius Baxter wro= te: > Hi, > > I've been working on the OpenRISC CGEN description and have got the > assembler working and am now looking at getting a GNU sim port running > too. > > I can see a lot of functionality working OK so far (I've based my > simulator port on the lm32 and m32r ports, which are both CGEN-based > implementations of the simulator) but one thing which is not working > are delay slots. They never appear to b executed when a branch is > going to be taken. > > I'm yet to delve into the workings if the simulator to figure out why > it's not executing the delay slots, but I just wanted to ask if this > is a known issue with the particular configuration I'm using. The sim > port has "#define WITH_SCACHE_PBB 1", in the tconfig.in file and the > Makefile calls the mloop.c generation script with: > > ... > $(SHELL) $(srccom)/genmloop.sh \ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-mono -fast -pbb -full-switch -switch sem-= switch.c \ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-cpu or1k32bef -infile $(srcdir)/mloop.in > > ... > > My understanding is that this will generate a main loop for a "fast" > model with pseudo-basic-block processing. This is an "upgrade" over > the default "simple" model without pbb. > > I'm wondering if delay slots not working are a known issue when > compiling a fast model with pbb support? > > As far as I can tell, my semantic description is correct. For example, > the jump instruction is: > > (dni l-j "jump (pc-relative iaddr)" > =A0 =A0 ; This function may not be in delay slot > =A0 =A0 (NOT-IN-DELAY-SLOT) > > =A0 =A0 "l.j ${disp-26}" > =A0 =A0 (+ OPC_J disp-26) > > =A0 =A0 ; We execute the delay slot before doin' the real branch > =A0 =A0 (delay 1 (set pc disp-26)) > =A0 =A0 () > ) > > Other semantic descriptions of delay slot execution appear to be along > the same lines, but I can't see any CGEN-based sim ports which have > instructions with delay slots, so, as I said, I'm wondering if this is > even supported at all. I didn't look hard enough, the cris and iq2000 sim ports implement instructions using delay slots. I fixed this issue after looking at their mloop.in files and realised I was missing a section to handle delay slots. With this code added it looks like delay slot instructions are getting executed. Cheers Julius