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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [sim/] [igen/] [gen-semantics.h] - Diff between revs 578 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 578 Rev 1765
/*  This file is part of the program psim.
/*  This file is part of the program psim.
 
 
    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
 
 
    This program is free software; you can redistribute it and/or modify
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    (at your option) any later version.
 
 
    This program is distributed in the hope that it will be useful,
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    GNU General Public License for more details.
 
 
    You should have received a copy of the GNU General Public License
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
    */
    */
 
 
 
 
/* Creates the files semantics.[hc].
/* Creates the files semantics.[hc].
 
 
   The generated file semantics contains functions that implement the
   The generated file semantics contains functions that implement the
   operations required to model a single target processor instruction.
   operations required to model a single target processor instruction.
 
 
   Several different variations on the semantics file can be created:
   Several different variations on the semantics file can be created:
 
 
        o       uncached
        o       uncached
 
 
                No instruction cache exists.  The semantic function
                No instruction cache exists.  The semantic function
                needs to generate any required values locally.
                needs to generate any required values locally.
 
 
        o       cached - separate cracker and semantic
        o       cached - separate cracker and semantic
 
 
                Two independant functions are created.  Firstly the
                Two independant functions are created.  Firstly the
                function that cracks an instruction entering it into a
                function that cracks an instruction entering it into a
                cache and secondly the semantic function propper that
                cache and secondly the semantic function propper that
                uses the cache.
                uses the cache.
 
 
        o       cached - semantic + cracking semantic
        o       cached - semantic + cracking semantic
 
 
                The function that cracks the instruction and enters
                The function that cracks the instruction and enters
                all values into the cache also contains a copy of the
                all values into the cache also contains a copy of the
                semantic code (avoiding the need to call both the
                semantic code (avoiding the need to call both the
                cracker and the semantic function when there is a
                cracker and the semantic function when there is a
                cache miss).
                cache miss).
 
 
   For each of these general forms, several refinements can occure:
   For each of these general forms, several refinements can occure:
 
 
        o       do/don't duplicate/expand semantic functions
        o       do/don't duplicate/expand semantic functions
 
 
                As a consequence of decoding an instruction, the
                As a consequence of decoding an instruction, the
                decoder, as part of its table may have effectivly made
                decoder, as part of its table may have effectivly made
                certain of the variable fields in an instruction
                certain of the variable fields in an instruction
                constant. Separate functions for each of the
                constant. Separate functions for each of the
                alternative values for what would have been treated as
                alternative values for what would have been treated as
                a variable part can be created.
                a variable part can be created.
 
 
        o       use cache struct directly.
        o       use cache struct directly.
 
 
                When a cracking cache is present, the semantic
                When a cracking cache is present, the semantic
                functions can be generated to either hold intermediate
                functions can be generated to either hold intermediate
                cache values in local variables or always refer to the
                cache values in local variables or always refer to the
                contents of the cache directly. */
                contents of the cache directly. */
 
 
 
 
 
 
 
 
 
 
 
 
extern void print_semantic_declaration
extern void print_semantic_declaration
(lf *file,
(lf *file,
 insn_entry *insn,
 insn_entry *insn,
 opcode_bits *bits,
 opcode_bits *bits,
 insn_opcodes *opcodes,
 insn_opcodes *opcodes,
 int nr_prefetched_words);
 int nr_prefetched_words);
 
 
extern void print_semantic_definition
extern void print_semantic_definition
(lf *file,
(lf *file,
 insn_entry *insn,
 insn_entry *insn,
 opcode_bits *bits,
 opcode_bits *bits,
 insn_opcodes *opcodes,
 insn_opcodes *opcodes,
 cache_entry *cache_rules,
 cache_entry *cache_rules,
 int nr_prefetched_words);
 int nr_prefetched_words);
 
 
 
 
typedef enum {
typedef enum {
  invalid_illegal,
  invalid_illegal,
  invalid_fp_unavailable,
  invalid_fp_unavailable,
  invalid_wrong_slot,
  invalid_wrong_slot,
} invalid_type;
} invalid_type;
 
 
extern void print_idecode_invalid
extern void print_idecode_invalid
(lf *file,
(lf *file,
 const char *result,
 const char *result,
 invalid_type type);
 invalid_type type);
 
 
extern void print_semantic_body
extern void print_semantic_body
(lf *file,
(lf *file,
 insn_entry *instruction,
 insn_entry *instruction,
 opcode_bits *expanded_bits,
 opcode_bits *expanded_bits,
 insn_opcodes *opcodes);
 insn_opcodes *opcodes);
 
 
 
 

powered by: WebSVN 2.1.0

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