2002-11-21 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Update copyright. IGEN contributed to the FSF.
* filter.c, filter.h, filter_host.c, filter_host.h: Ditto.
* gen-engine.c, gen-engine.h, gen-icache.c, gen-icache.h: Ditto.
* gen-idecode.c, gen-idecode.h, gen-itable.c: Ditto.
* gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h, gen.c: Ditto.
* gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:09:40 +01:00
|
|
|
/* The IGEN simulator generator for GDB, the GNU Debugger.
|
|
|
|
|
2017-01-01 07:50:51 +01:00
|
|
|
Copyright 2002-2017 Free Software Foundation, Inc.
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Update copyright. IGEN contributed to the FSF.
* filter.c, filter.h, filter_host.c, filter_host.h: Ditto.
* gen-engine.c, gen-engine.h, gen-icache.c, gen-icache.h: Ditto.
* gen-idecode.c, gen-idecode.h, gen-itable.c: Ditto.
* gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h, gen.c: Ditto.
* gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:09:40 +01:00
|
|
|
|
|
|
|
Contributed by Andrew Cagney.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
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
|
2007-08-24 16:30:15 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Update copyright. IGEN contributed to the FSF.
* filter.c, filter.h, filter_host.c, filter_host.h: Ditto.
* gen-engine.c, gen-engine.h, gen-icache.c, gen-icache.h: Ditto.
* gen-idecode.c, gen-idecode.h, gen-itable.c: Ditto.
* gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h, gen.c: Ditto.
* gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:09:40 +01:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-24 16:30:15 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Update copyright. IGEN contributed to the FSF.
* filter.c, filter.h, filter_host.c, filter_host.h: Ditto.
* gen-engine.c, gen-engine.h, gen-icache.c, gen-icache.h: Ditto.
* gen-idecode.c, gen-idecode.h, gen-itable.c: Ditto.
* gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h, gen.c: Ditto.
* gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:09:40 +01:00
|
|
|
|
1999-04-16 03:35:26 +02:00
|
|
|
|
|
|
|
#include "misc.h"
|
|
|
|
#include "lf.h"
|
|
|
|
#include "table.h"
|
|
|
|
#include "filter.h"
|
|
|
|
|
|
|
|
#include "igen.h"
|
|
|
|
|
|
|
|
#include "ld-insn.h"
|
|
|
|
#include "ld-decode.h"
|
|
|
|
|
|
|
|
#include "gen.h"
|
|
|
|
|
|
|
|
#include "gen-semantics.h"
|
|
|
|
#include "gen-support.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_support_function_name (lf *file,
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
function_entry * function,
|
1999-04-16 03:35:26 +02:00
|
|
|
int is_function_definition)
|
|
|
|
{
|
|
|
|
if (function->is_internal)
|
|
|
|
{
|
|
|
|
lf_print__function_type_function (file, print_semantic_function_type,
|
|
|
|
"INLINE_SUPPORT",
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
(is_function_definition ? "\n" :
|
|
|
|
" "));
|
|
|
|
print_function_name (file, function->name, NULL, NULL, NULL,
|
1999-04-16 03:35:26 +02:00
|
|
|
function_name_prefix_semantics);
|
|
|
|
lf_printf (file, "\n(");
|
|
|
|
lf_indent (file, +1);
|
|
|
|
print_semantic_function_formal (file, 0);
|
|
|
|
lf_indent (file, -1);
|
|
|
|
lf_printf (file, ")");
|
|
|
|
if (!is_function_definition)
|
|
|
|
lf_printf (file, ";");
|
|
|
|
lf_printf (file, "\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* map the name onto a globally valid name */
|
|
|
|
if (!is_function_definition
|
|
|
|
&& strcmp (options.module.support.prefix.l, "") != 0)
|
|
|
|
{
|
|
|
|
lf_indent_suppress (file);
|
|
|
|
lf_printf (file, "#define %s %s%s\n",
|
|
|
|
function->name,
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
options.module.support.prefix.l, function->name);
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
|
|
|
lf_print__function_type (file,
|
|
|
|
function->type,
|
|
|
|
"INLINE_SUPPORT",
|
|
|
|
(is_function_definition ? "\n" : " "));
|
|
|
|
lf_printf (file, "%s%s\n(",
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
options.module.support.prefix.l, function->name);
|
1999-04-16 03:35:26 +02:00
|
|
|
if (options.gen.smp)
|
|
|
|
lf_printf (file,
|
|
|
|
"sim_cpu *cpu, %sinstruction_address cia, int MY_INDEX",
|
|
|
|
options.module.support.prefix.l);
|
|
|
|
else
|
|
|
|
lf_printf (file,
|
|
|
|
"SIM_DESC sd, %sinstruction_address cia, int MY_INDEX",
|
|
|
|
options.module.support.prefix.l);
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
if (function->param != NULL && strlen (function->param) > 0)
|
1999-04-16 03:35:26 +02:00
|
|
|
lf_printf (file, ", %s", function->param);
|
|
|
|
lf_printf (file, ")%s", (is_function_definition ? "\n" : ";\n"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
support_h_function (lf *file, function_entry * function, void *data)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
|
|
|
ASSERT (function->type != NULL);
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
print_support_function_name (file, function, 0 /*!is_definition */ );
|
|
|
|
lf_printf (file, "\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
gen_support_h (lf *file, insn_table *table)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
/* output the definition of `SD_' */
|
|
|
|
if (options.gen.smp)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "#define SD CPU_STATE (cpu)\n");
|
|
|
|
lf_printf (file, "#define CPU cpu\n");
|
|
|
|
lf_printf (file, "#define CPU_ cpu\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "#define SD sd\n");
|
|
|
|
lf_printf (file, "#define CPU (STATE_CPU (sd, 0))\n");
|
|
|
|
lf_printf (file, "#define CPU_ sd\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "#define CIA_ cia\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
if (options.gen.delayed_branch)
|
|
|
|
{
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "#define CIA cia.ip\n");
|
|
|
|
lf_printf (file,
|
|
|
|
"/* #define NIA nia.dp -- do not define, ambigious */\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "#define CIA cia\n");
|
|
|
|
lf_printf (file, "#define NIA nia\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "#define SD_ CPU_, CIA_, MY_INDEX\n");
|
|
|
|
lf_printf (file, "#define _SD SD_ /* deprecated */\n");
|
|
|
|
lf_printf (file, "\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2002-08-28 18:01:31 +02:00
|
|
|
/* Map <PREFIX>_xxxx onto the shorter xxxx for the following names:
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
instruction_word
|
|
|
|
idecode_issue
|
|
|
|
semantic_illegal
|
2002-08-28 18:01:31 +02:00
|
|
|
|
|
|
|
Map defined here as name space problems are created when the name is
|
|
|
|
defined in idecode.h */
|
1999-04-16 03:35:26 +02:00
|
|
|
if (strcmp (options.module.idecode.prefix.l, "") != 0)
|
|
|
|
{
|
|
|
|
lf_indent_suppress (file);
|
|
|
|
lf_printf (file, "#define %s %s%s\n",
|
|
|
|
"instruction_word",
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
options.module.idecode.prefix.l, "instruction_word");
|
1999-04-16 03:35:26 +02:00
|
|
|
lf_printf (file, "\n");
|
|
|
|
lf_indent_suppress (file);
|
|
|
|
lf_printf (file, "#define %s %s%s\n",
|
|
|
|
"idecode_issue",
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
options.module.idecode.prefix.l, "idecode_issue");
|
1999-04-16 03:35:26 +02:00
|
|
|
lf_printf (file, "\n");
|
2002-08-28 18:01:31 +02:00
|
|
|
lf_indent_suppress (file);
|
|
|
|
lf_printf (file, "#define %s %s%s\n",
|
|
|
|
"semantic_illegal",
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
options.module.idecode.prefix.l, "semantic_illegal");
|
2002-08-28 18:01:31 +02:00
|
|
|
lf_printf (file, "\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* output a declaration for all functions */
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
function_entry_traverse (file, table->functions, support_h_function, NULL);
|
|
|
|
lf_printf (file, "\n");
|
|
|
|
lf_printf (file, "#if defined(SUPPORT_INLINE)\n");
|
|
|
|
lf_printf (file, "# if ((SUPPORT_INLINE & INCLUDE_MODULE)\\\n");
|
|
|
|
lf_printf (file, " && (SUPPORT_INLINE & INCLUDED_BY_MODULE))\n");
|
|
|
|
lf_printf (file, "# include \"%ssupport.c\"\n",
|
|
|
|
options.module.support.prefix.l);
|
|
|
|
lf_printf (file, "# endif\n");
|
|
|
|
lf_printf (file, "#endif\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
support_c_function (lf *file, function_entry * function, void *data)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
|
|
|
ASSERT (function->type != NULL);
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
print_support_function_name (file, function, 1 /*!is_definition */ );
|
1999-04-16 03:35:26 +02:00
|
|
|
lf_printf (file, "{\n");
|
|
|
|
lf_indent (file, +2);
|
|
|
|
if (function->code == NULL)
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
error (function->line, "Function without body (or null statement)");
|
1999-04-16 03:35:26 +02:00
|
|
|
lf_print__line_ref (file, function->code->line);
|
|
|
|
table_print_code (file, function->code);
|
|
|
|
if (function->is_internal)
|
|
|
|
{
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file,
|
|
|
|
"sim_engine_abort (SD, CPU, cia, \"Internal function must longjump\\n\");\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
lf_printf (file, "return cia;\n");
|
|
|
|
}
|
|
|
|
lf_indent (file, -2);
|
|
|
|
lf_printf (file, "}\n");
|
|
|
|
lf_print__internal_ref (file);
|
|
|
|
lf_printf (file, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
gen_support_c (lf *file, insn_table *table)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
lf_printf (file, "#include \"sim-main.h\"\n");
|
|
|
|
lf_printf (file, "#include \"%sidecode.h\"\n",
|
|
|
|
options.module.idecode.prefix.l);
|
|
|
|
lf_printf (file, "#include \"%sitable.h\"\n",
|
|
|
|
options.module.itable.prefix.l);
|
|
|
|
lf_printf (file, "#include \"%ssupport.h\"\n",
|
|
|
|
options.module.support.prefix.l);
|
|
|
|
lf_printf (file, "\n");
|
1999-04-16 03:35:26 +02:00
|
|
|
|
|
|
|
/* output a definition (c-code) for all functions */
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 05:20:49 +01:00
|
|
|
function_entry_traverse (file, table->functions, support_c_function, NULL);
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|