/* This file is part of the program psim.
- Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
+ Copyright 1994, 1995, 2002 Andrew Cagney <cagney@highland.com.au>
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
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#endif
-/* Intel host BSWAP support:
-
- Whether to use bswap on the 486 and pentiums rather than the 386
- sequence that uses xchgb/rorl/xchgb */
-#ifndef WITH_BSWAP
-#define WITH_BSWAP 0
-#endif
-
-
/* SMP support:
Sets a limit on the number of processors that can be simulated. If
#define VIRTUAL_ENVIRONMENT 2
#define OPERATING_ENVIRONMENT 3
-#ifndef WITH_ENVIRONMENT
-#define WITH_ENVIRONMENT 0
-#endif
-
extern int current_environment;
#define CURRENT_ENVIRONMENT (WITH_ENVIRONMENT \
? WITH_ENVIRONMENT \
Control the inclusion of debugging code. */
-/* Include the tracing code. Disabling this eliminates all tracing
- code */
-
-#ifndef WITH_TRACE
-#define WITH_TRACE 1
-#endif
-
-/* include code that checks assertions scattered through out the
- program */
-
-#ifndef WITH_ASSERT
-#define WITH_ASSERT 1
-#endif
-
/* Whether to check instructions for reserved bits being set */
#ifndef WITH_RESERVED_BITS
? WITH_MODEL_ISSUE \
: current_model_issue)
+/* Whether or not input/output just uses stdio, or uses printf_filtered for
+ output, and polling input for input. */
+
+#define DONT_USE_STDIO 2
+#define DO_USE_STDIO 1
+
+extern int current_stdio;
+#define CURRENT_STDIO (WITH_STDIO \
+ ? WITH_STDIO \
+ : current_stdio)
+
+
+
/* INLINE CODE SELECTION:
GCC -O3 attempts to inline any function or procedure in scope. The
to both eliminate the overhead of function calls and (as a
consequence) also eliminate further dead code.
- On a CISC (x86) I've found that I can achieve an order of magintude
+ On a CISC (x86) I've found that I can achieve an order of magnitude
speed improvement (x3-x5). In the case of RISC (sparc) while the
performance gain isn't as great it is still significant.
The following additional values are `bit fields' and can be
combined.
- 1 Include the C file for the module into the file being compiled
+ REVEAL_MODULE:
+
+ Include the C file for the module into the file being compiled
but do not make the functions within the module inline.
While of no apparent benefit, this makes it possible for the
included module, when compiled to inline its calls to what
would otherwize be external functions.
- 2 Make external functions within the module `inline'. Thus if
+ INLINE_MODULE:
+
+ Make external functions within the module `inline'. Thus if
the module is included into a file being compiled, calls to
its funtions can be eliminated. 2 implies 1.
- 4 Make internal (static) functions within the module `inline'.
+ PSIM_INLINE_LOCALS:
+
+ Make internal (static) functions within the module `inline'.
+
+ The following abreviations are available:
+
+ INCLUDE_MODULE == (REVEAL_MODULE | INLINE_MODULE)
+
+ ALL_INLINE == (REVEAL_MODULE | INLINE_MODULE | PSIM_INLINE_LOCALS)
In addition to this, modules have been put into two categories.
REALITY CHECK:
- This is not for the faint hearted. I've seen GCC get up to 200mb
+ This is not for the faint hearted. I've seen GCC get up to 500mb
trying to compile what this can create.
Some of the modules do not yet implement the WITH_INLINE_STATIC
local function.
Because of the way that GCC parses __attribute__(), the macro's
- need to be adjacent to the functioin name rather then at the start
+ need to be adjacent to the function name rather than at the start
of the line vis:
int STATIC_INLINE_MODULE f(void);
#define REVEAL_MODULE 1
#define INLINE_MODULE 2
#define INCLUDE_MODULE (INLINE_MODULE | REVEAL_MODULE)
-#define INLINE_LOCALS 4
+#define PSIM_INLINE_LOCALS 4
#define ALL_INLINE 7
/* Your compilers inline reserved word */
#endif
#endif
+
/* Default prefix for static functions */
#ifndef STATIC_INLINE
/* Default macro to simplify control several of key the inlines */
#ifndef DEFAULT_INLINE
-#define DEFAULT_INLINE INLINE_LOCALS
+#define DEFAULT_INLINE PSIM_INLINE_LOCALS
#endif
/* Code that converts between hosts and target byte order. Used on
real hardware instead of RAM.
Also, most of the functions in devices.c are always called through
- a jump table.
-
- There seems to be some problem with making either device_tree or
- devices inline. It reports the message: device_tree_find_node()
- not a leaf */
+ a jump table. */
#ifndef DEVICE_INLINE
-#define DEVICE_INLINE DEFAULT_INLINE
+#define DEVICE_INLINE (DEFAULT_INLINE ? PSIM_INLINE_LOCALS : 0)
+#endif
+
+/* Code called used while the device tree is being built.
+
+ Inlining this is of no benefit */
+
+#ifndef TREE_INLINE
+#define TREE_INLINE (DEFAULT_INLINE ? PSIM_INLINE_LOCALS : 0)
#endif
/* Code called whenever information on a Special Purpose Register is
inline all of their called functions */
#ifndef SEMANTICS_INLINE
-#define SEMANTICS_INLINE DEFAULT_INLINE
+#define SEMANTICS_INLINE (DEFAULT_INLINE & ~INLINE_MODULE)
#endif
-/* Code to decode an instruction. Normally called on every instruction
- cycle */
+/* When using the instruction cache, code to decode an instruction and
+ install it into the cache. Normally called when ever there is a
+ miss in the instruction cache. */
-#ifndef IDECODE_INLINE
-#define IDECODE_INLINE DEFAULT_INLINE
+#ifndef ICACHE_INLINE
+#define ICACHE_INLINE (DEFAULT_INLINE & ~INLINE_MODULE)
+#endif
+
+/* General functions called by semantics functions but part of the
+ instruction table. Although called by the semantic functions the
+ frequency of calls is low. Consequently the need to inline this
+ code is reduced. */
+
+#ifndef SUPPORT_INLINE
+#define SUPPORT_INLINE PSIM_INLINE_LOCALS
#endif
/* Model specific code used in simulating functional units. Note, it actaully
of the code, which is not friendly to the cache. */
#ifndef MODEL_INLINE
-#define MODEL_INLINE DEFAULT_INLINE
+#define MODEL_INLINE (DEFAULT_INLINE & ~INLINE_MODULE)
#endif
/* Code to print out what options we were compiled with. Because this
routines will be pulled in twice. */
#ifndef OPTIONS_INLINE
-#define OPTIONS_INLINE DEFAULT_INLINE
+#define OPTIONS_INLINE MODEL_INLINE
+#endif
+
+/* idecode acts as the hub of the system, everything else is imported
+ into this file */
+
+#ifndef IDECOCE_INLINE
+#define IDECODE_INLINE PSIM_INLINE_LOCALS
+#endif
+
+/* psim, isn't actually inlined */
+
+#ifndef PSIM_INLINE
+#define PSIM_INLINE PSIM_INLINE_LOCALS
#endif
-/* Code to emulate os or rom compatibility. Called on the rare
- occasion that the OS or ROM code is being emulated. */
+/* Code to emulate os or rom compatibility. This code is called via a
+ table and hence there is little benefit in making it inline */
#ifndef OS_EMUL_INLINE
#define OS_EMUL_INLINE 0