OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [model.scm] - Rev 26

Go to most recent revision | Compare with Previous | Blame | View Log

; CPU implementation description.
; Copyright (C) 2000, 2003, 2009 Red Hat, Inc.
; This file is part of CGEN.
; See file COPYING.CGEN for details.
; A model is an implementation of a mach.
; NOTE: wip [with all the caveats that implies].
; The intent here is to define the aspects of a CPU that affect performance,
; usable by any tool (but for the immediate future a simulator).
; Pipeline specification.
; Function unit specification.
; FIXME: Might wish to record which pipeline element(s) the unit is associated
; with.  At the moment pipeline data isn't used, but later.
; wip
; Lists of (name mode) pairs that record unit state.
; Lists of (name mode [default-value]).
; RTL of code to invoke to do profiling.
; `nil' means use the default
; ??? Not currently used since all profiling handlers
; are user-written.
; Model this unit is associated with.
; ??? Rather than create a circularity, we record the model's symbol in
; the `model' element.
; FIXME: Shouldn't use current-model-lookup.  Guile is better at printing
; things with circularities now, so should probably put back the circularity
; and delete the current-model-lookup reference.
; Create a copy of unit U with new values for ISSUE and DONE.
; This is used when recording an instruction's timing information.
; ??? This might be better recorded in a different class from UNIT
; since we're not creating a new unit, we're just special casing it for
; one instruction.
; FIXME: No longer used.
; The `<model>' class.
;
; FETCH is the instruction fetch process as it relates to the implementation.
; e.g.
; - how many instructions are fetched at once
; - how those instructions are initially processed for delivery to the
;   appropriate pipeline
; RETIRE is used to specify any final processing needed to complete an insn.
; PIPELINES is a list of pipeline objects.
; UNITS is a list of function units.
; STATE is a list of (var mode) pairs.
;
; For the more complicated cpus this can get really complicated really fast.
; No intent is made to get there in one day.
"MODEL_"; Parse a `prefetch' spec.
; Parse a `retire' spec.
; Parse a `pipeline' spec.
; ??? Perhaps we should also use name/value pairs here, but that's an
; unnecessary complication at this point in time.
; name comments attrs elements)
"pipeline spec not `name comment attrs elements'"; Parse a function `unit' spec.
; ??? Perhaps we should also use name/value pairs here, but that's an
; unnecessary complication at this point in time.
; name comments attrs elements)
"unit spec not `name comment attrs issue done state inputs outputs profile'"; Parse a model definition.
; This is the main routine for building a model object from a
; description in the .cpu file.
; All arguments are in raw (non-evaluated) form.
"Processing model "" ...\n";; Pick out name first to augment the error context.
"there must be at least one function unit"; is `mach' being "kept"?
"cpu"; MACH wasn't found, ignore this model.
"Nonexistant mach "", ignoring "".\n"; Read a model description.
; This is the main routine for analyzing models in the .cpu file.
; CONTEXT is a <context> object for error messages.
; ARG-LIST is an associative list of field name and field value.
; -model-parse is invoked to create the `model' object.
; name of model
; description of model
; attributes
; mach this model implements
; instruction prefetch handling
; instruction completion handling
; list of pipelines
; list of (name mode) pairs to record state
; list of function units
"invalid model arg"; Now that we've identified the elements, build the object.
; Define a cpu model object, name/value pair list version.
"define-model"; Instruction timing.
; There is one of these for each model timing description per instruction.
; timing:units is a list of these.
; ARGS is a list of (name value) pairs.
; Return the default unit used by MODEL.
; ??? For now this is always u-exec.
; Subroutine of parse-insn-timing to parse the timing spec for MODEL.
; The result is a <timing> object.
; syntax is `unit name (arg1 val1) ...'
"unknown function unit""bad unit timing spec"; Given the timing information for an instruction return an associative
; list of timing objects (one for each specified model).
; INSN-TIMING-DESC is a list of
; (model1 (unit unit1-name ...) ...) (model2 (unit unit1-name ...) ...) ...
; Entries for models not included (because the machine wasn't selected)
; are returned as (model1), i.e. an empty unit list.
"  parse-insn-timing: context= "", desc= ""\n"; Called before a .cpu file is read in.
"\
Define a cpu model, name/value pair list version.
"; Called after a .cpu file has been read in.
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.