From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10717 invoked by alias); 14 Apr 2003 14:49:45 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 10702 invoked from network); 14 Apr 2003 14:49:44 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 14 Apr 2003 14:49:44 -0000 Received: from redhat.com (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 2FEB9800087; Mon, 14 Apr 2003 10:49:44 -0400 (EDT) Message-ID: <3E9ACA6A.3080300@redhat.com> Date: Mon, 14 Apr 2003 14:49:00 -0000 From: Dave Brolley User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021216 X-Accept-Language: en-us, en MIME-Version: 1.0 To: cgen@sources.redhat.com, sid@sources.redhat.com Subject: Re: [patch][rfa] CGEN Model Support for SID References: <3E88B3D9.6060000@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-q2/txt/msg00007.txt.bz2 No comments on this? Too much or too little information? OK to commit? Dave Dave Brolley wrote: > Hi, > > This submission cleans up the partially adapted support for CGEN > models for SID and enables it. Attached are patches for CGEN and SID > which accomplish this: > > o sid-model.patch.txt's: Patches for CGEN and SID > o cgen-model.h: New class definition in sid/component/cgen-cpu > o *.ChangeLog: ChangeLogs for the above > > Also attached are examples of the generated code and suggested usage > for the xstormy16: > > o xstormy16-model.{cxx,h}: CGEN-generated model code > o xstormy16-model-gen.patch.txt: Additional code generated into > xstormy16-decode.h and xstormy16-sem.cxx > o xstormy16-model.patch.txt: Patch showing suggest usage of the > generated code by a SID cgen-cpu. > > Notes: > > o The implementation is similar to the existing implementation for > sim/common simulators except: > - The generated functions are encapsulated into a class: > __model > - Functions are generated for modelling each insn both before and > after execution. The sim/common implementation only generated a > function to be called after execution, however, there was a need for > modelling both before and after in the implementaion of the FRV > simulator which was handled somewhat awkwardly. Therefore I added this > capability for this implementation. > - As in the existing sim/common implementation, there are hooks > provided (at the cgen-model level) for modelling before and after > groups of parallel insns. > > A general outline of the design follows: > > o A new class, cgen-model, has been defined in > sid/component/cgen-cpu/cgen-model.h. It provides the methods for > modelling before and after groups of parallel insns with default > virtual implementations and keeps a pointer to the cpu for reporting > computed latencies. > > o The script sid/component/cgen-cpu/CGEN.sh has been enhanced to > process the option 'with-profile=fn' and to generate the files > model.cxx and model.h. > > o For each model (cgen model) used by a all machines (cgen mach) being > generated, a class, @prefix@_@model@_model is generated in > sid/component/cgen-cpu/@cpu@/@prefix@-model.{cxx,h}. These classes > each inherit from cgen-cpu and implement the functions for modelling > each unit before and after each insn. Default virtual implementations > are provided as well as a table mapping each insn to its unit > modelling functions and functions for indexing the table to make the > calls. > > o The generated code, as is, is complete and implements default > latency computations as defined by the (timing ...) elements of each > insn in the .cpu file. > > o Since the default implementations are virtual, the programmer may > inherit the generated class(es) to implement more complex modelling > behavior for each unit of each model as needed. > > o Calls to the modelling functions are inserted, as necessary, into > the cpu's step_insns method. See xstormy16-model.patch.txt for an > example. > > This implementation has been tested on xstormy16 and an internal port > which makes extensive use of this new work. Other ports are not > affected since they do not make use of this functionality. > > I am seeking comments leading toward approval to commit the general > changes. I can also commit the xtormy16-specific code if folks think > it would be of use as an example. > > Dave