Commit Graph

5177 Commits

Author SHA1 Message Date
Mike Frysinger
82a398adb8 sim: sh: adjust some dsp insn masks
The pmuls encoding is incorrect -- it looks like a copy & paste error
from the padd pmuls variant.  The SuperH software manual covers this.

On the flip side, the manual lists pwsb & pwad as insns that exist,
but no description of what they do, what the insn name means, or the
actual encoding.  Our sim implementation stubs them both out as nops.
Let's mark the fields to avoid unused variable warnings.
2023-12-15 23:59:00 -05:00
Mike Frysinger
0fd9d0cec0 sim: sh: tidy up gencode slightly
Mark a few things static/const, and clean up trailing whitespace.
2023-12-15 23:59:00 -05:00
Mike Frysinger
302bd5bf18 sim: bfin: fix typo in bf52x ports
These should be using the BF52x set of ports, not BF51x.
2023-12-15 21:41:07 -05:00
Mike Frysinger
00383ba6b4 sim: warnings: enable -Wunused-but-set-variable 2023-12-15 21:14:13 -05:00
Mike Frysinger
81a3befa0a sim: mn10300: fix incorrect implementation of a few insns
Fix a few problems caught by compiler warnings:
* Some of the asr & lsr insns were setting up the c state flag,
  but then forgetting to set it in the PSW.  Add it like the other
  asr & lsr variants.
* Some of the dmulh insns were multiplying one of the source regs
  against itself instead of against the other source reg.
* The sat16_cmp parallel insn was using the wrong register in the
  compare -- the reg1 src/dst pair are used in the sat16 op, and
  the reg2 src/dst pair are used in the add op.
2023-12-15 21:14:13 -05:00
Mike Frysinger
10802d9ac0 sim: m32r: fix mloop.in variant stamp deps
The migration to local.mk in commit 0a129eb19a
accidentally listed the deps for all mloop steps as mloop.in instead of the
various variants that m32r uses.

Reported-by: Simon Marchi <simon.marchi@polymtl.ca>
2023-12-14 22:45:22 -05:00
Mike Frysinger
2f1de74501 sim: m32r: use @cpu@_fill_argbuf_tp to set trace & profile state
The mloop.in code does this, but these variants do not.  Use it to
avoid unused function warnings.  The fast_p logic in these files
also looks off, but that'll require a bit more work to fixup.

  CC       m32r/mloopx.o
m32r/mloopx.c:37:1: error: ‘m32rxf_fill_argbuf_tp’ defined but not used [-Werror=unused-function]
   37 | m32rxf_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf,
      | ^~~~~~~~~~~~~~~~~~~~~

  CC       m32r/mloop2.o
m32r/mloop2.c:37:1: error: ‘m32r2f_fill_argbuf_tp’ defined but not used [-Werror=unused-function]
   37 | m32r2f_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf,
      | ^~~~~~~~~~~~~~~~~~~~~

Reported-by: Simon Marchi <simon.marchi@polymtl.ca>
Tested-By: Simon Marchi <simon.marchi@polymtl.ca>
2023-12-14 22:34:28 -05:00
Mike Frysinger
880530b71f sim: igen: do not reindent literal semantics output
When generating semantics.c from .igen source files, indenting the code
makes it more readable, but confuses compiler diagnostics.  The latter
is a bit more important than the former, so bias towards that.

For example, with an introduced error, we can see w/gcc-13:

(before this change)
  CC       mn10300/semantics.o
../../../sim/mn10300/am33-2.igen: In function ‘semantic_dcpf_D1a’:
../../../sim/mn10300/am33-2.igen:11:5: error: ‘srcreg’ undeclared (first use in this function)
   11 |   srcreg = translate_rreg (SD_, RN2);
      |     ^~~~~~

(with this change)
  CC       mn10300/semantics.o
../../../sim/mn10300/am33-2.igen: In function ‘semantic_dcpf_D1a’:
../../../sim/mn10300/am33-2.igen:11:3: error: ‘srcreg’ undeclared (first use in this function)
   11 |   srcreg = translate_rreg (SD_, RN2);
      |   ^~~~~~
2023-12-14 22:33:47 -05:00
Jeff Law
76c51bed59 Improve performance of the H8 simulator
Running the H8 port through the GCC testsuite currently takes 4h 30m on my
fastest server -- that's roughly 1.5hrs per multilib tested and many tests are
disabled for various reasons.

To put that 1.5hr/multilib in perspective, that's roughly 3X the time for other
embedded targets.  Clearly something isn't working as well as it should.

A bit of digging with perf shows that we're spending a crazy amount of time
decoding instructions in the H8 simulator.  It's not hard to see why --
basically we take a blob of instruction data, then try to match it to every
instruction in the H8 opcode table starting at the beginning.  That table has
~8000 entries (each different addressing mode is considered a different
instruction in the table).

Naturally my first thought was to sort the table and use a binary search to
find the right entry.  That's made excessively complex due to the encoding on
the H8.  Just getting the sort right would be much more complex than I'd
consider advisable.

Another thought was to build a mapping to the right entry for all the
instructions that can be disambiguated based on the first nibble (4 bits) of
instruction data and a mapping for those which can be disambiguated based on
the first byte of instruction data.

That seemed feasible until I realized that the H8/SX did some truly horrid
things with encoding branches in the 0x4XYY opcode space.  It uses an "always
zero" bit in the offset to encode new semantic information.  So we can't select
on just 0x4X.  Ugh!

We could always to a custom decoder.  I've done several through the years, they
can be very fast.  But no way I can justify the time to do that.

So what I settled on was to first sort the opcode table by the first nibble,
then find the index of the first instruction for each nibble. Decoding uses
that index to start its search.  This cuts the overall build/test by more than
half.

Next I adjusted the sort so that instructions that are not available on the
current sub architecture are put at the end of the table.   This shaves another
~15% off the total cycle time.

The net of the two changes is on my fastest server we've gone from 4:30 to 1:40
running the GCC testsuite.  Same test results before/after, of course.  It's
still not fast, but it's a hell of a lot better.
2023-12-10 13:26:03 -07:00
Mike Frysinger
c64ec6d082 sim: aarch64: fix -Wunused-but-set-variable warnings 2023-12-07 22:31:21 -07:00
Mike Frysinger
3762437ead sim: common: fix -Wunused-but-set-variable warnings 2023-12-07 22:31:21 -07:00
Mike Frysinger
8958a91714 sim: ppc: fix -Wunused-but-set-variable warnings 2023-12-07 22:31:21 -07:00
Mike Frysinger
bbe7b93875 sim: v850: fix -Wunused-but-set-variable warnings 2023-12-07 22:31:21 -07:00
Mike Frysinger
49b556efb5 sim: sh: fix -Wunused-but-set-variable warnings 2023-12-07 22:31:21 -07:00
Mike Frysinger
0e12bb132e sim: msp430: fix -Wunused-but-set-variable warnings 2023-12-07 22:31:21 -07:00
Mike Frysinger
5dda1cd28a sim: mips: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
2a04b8c908 sim: mcore: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
fca8f1a3dc sim: m68hc11: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
7368a2cf73 sim: h8300: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
ab46df15a0 sim: ft32: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
0dabdc69c7 sim: frv: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
89d7fc2ab0 sim: erc32: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
a886474a62 sim: d10v: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
4125d64738 sim: cris: fix -Wunused-but-set-variable warnings
We suppress the warning in the generated switch file because the cris
cpu file has a hack to workaround a cgen bug, but that generates a set
but unused variable which makes the compiler upset.
2023-12-07 21:41:27 -07:00
Mike Frysinger
ee45e43358 sim: bfin: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
058d0bf5f0 sim: bfin: gui: fix -Wunused-but-set-variable warnings
Rework the code to use static inline functions when it's disabled
rather than macros so the compiler knows the various function args
are always used.  The ifdef macros are a bit ugly, but get the job
done without duplicating the function prototypes.
2023-12-07 21:41:27 -07:00
Mike Frysinger
ad4106f8dd sim: arm: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
c26f7543b2 sim: m32r: fix syslog call
The function returns void, not int.  We only pass one argument to
syslog (the format), so use %s as the static format instead since
the emulation layer doesn't handle passing additional arguments.
2023-12-07 21:41:27 -07:00
Mike Frysinger
9c80f001f0 sim: m32r: include more glibc headers for the funcs we use [PR sim/29752]
Not exactly portable, but doesn't make the situation worse here, and
fixes a lot of implicit function warnings.

Bug: https://sourceware.org/PR29752
2023-12-07 21:41:27 -07:00
Mike Frysinger
190fcd0d6c sim: m32r: add more cgen prototypes for traps
The traps file uses a bunch of functions directly without prototypes,
and we can't safely include the relevant cpu*.h files for them.
2023-12-07 21:41:27 -07:00
Mike Frysinger
5e43a46efc sim: m32r: add more cgen prototypes to enable -Werror in most files 2023-12-07 06:22:32 -07:00
Mike Frysinger
a729245526 sim: warnings: disable -Wenum-conversion fow now [PR sim/29752]
The cgen code mixes virtual insn enums with insn enums, and there isn't
an obvious (to me) way to unravel this atm, so disable the warning.

sim/lm32/decode.c:45:5: error:
	implicit conversion from enumeration type 'CGEN_INSN_VIRTUAL_TYPE'
	to different enumeration type 'CGEN_INSN_TYPE' (aka 'enum cgen_insn_type')
	[-Werror,-Wenum-conversion]
   45 |   { VIRTUAL_INSN_X_INVALID, LM32BF_INSN_X_INVALID, LM32BF_SFMT_EMPTY },
      |   ~ ^~~~~~~~~~~~~~~~~~~~~~

Bug: https://sourceware.org/PR29752
2023-12-07 06:00:25 -07:00
Mike Frysinger
708aee5ec6 sim: support dlopen in -lc
Stop assuming that dlopen is only available via -ldl.  Newer versions
of glibc have merged it into -lc which broke this configure test.
2023-12-06 20:56:29 -07:00
Mike Frysinger
d7befe04fa sim: cris: move generated file to right place
Not sure why this ended up in the topdir, but it belongs under cris/.
2023-12-06 20:11:05 -07:00
Mike Frysinger
b0c06375e1 sim: warnings: add more flags
Sync with the list of flags from gdbsupport, and add a few more of
our own to catch recent issues.  Comment out the C++-specific flags
as we don't build with C++.
2023-12-06 20:11:05 -07:00
Mike Frysinger
3c7666dca5 sim: warnings: sync some build logic from gdbsupport
This fixes testing of -Wno flags, and adds some more portable ones.
2023-12-05 23:12:16 -07:00
Mike Frysinger
de501587c2 sim: mips: fix sim_fpu usage
Fix some of the sim_fpu calls to use the right types.  While I'm
not familiar with the MIPS ISA in these cases, these look like
simple oversights due to the name/type mismatches.  This at least
fixes compiling with -Wenum-conversion.
2023-12-05 06:12:02 -07:00
Mike Frysinger
682ff29bfc sim: sh: trim trailing whitespace in generated code
No functional change here, but makes it a little easier to read the
generated code when editors aren't highlighting all the spurious
trailing whitespace on lines.
2023-12-05 06:05:19 -07:00
Mike Frysinger
cd1c74bec6 sim: mn10300: fix sim_engine_halt call
The sim_stop argument is an enum and should only be one of those
values, not a signal constant.  Fix the logic to pass the right
sim_xxx & SIM_xxx values in the right arguments.
2023-12-05 07:56:52 -05:00
Mike Frysinger
9d4a8c0a2e sim: m32c: use UTF-8 encoding
We only support UTF-8 nowadays, so stop using ISO-8859-1.

Maybe we should delete this logic entirely, but for now,
do the bare min conversion to keep it compiling.
2023-12-05 07:50:56 -05:00
Mike Frysinger
02b8b049a4 sim: rx: mark unused static var as unused
This seems like a useful utility func that mirrors the int2float
helper, so mark it as unused rather than delete.
2023-12-04 23:49:48 -05:00
Mike Frysinger
be3701ba8c sim: rx: constify some read-only global vars 2023-12-04 23:49:35 -05:00
Mike Frysinger
ab18008ed1 sim: warnings: enable only for development builds
Reuse the bfd/development.sh script like most other project to
determine whether the current source tree is a dev build (e.g.
git) or a release build, and disable the warnings for releases.
2023-12-04 23:45:27 -05:00
Mike Frysinger
9a9205a0c7 sim: ppc: fix implicit enum conversion
This code tries to use attach_type enums as hw_phb_decode, and while
they're setup to have compatible values, the compiler doesn't like it
when the cast is missing.  So cast it explicitly and then use that.

sim/ppc/hw_phb.c:322:28: error:
	implicit conversion from enumeration type 'attach_type'
	(aka 'enum _attach_type') to different enumeration type
	'hw_phb_decode' [-Werror,-Wenum-conversion]
2023-12-04 23:41:31 -05:00
Mike Frysinger
c96b63a2e9 sim: ppc: fix -Wmisleading-indentation warnings
Fix building with -Wmisleading-indentation.
2023-12-04 23:38:55 -05:00
Mike Frysinger
a3d3d9a7d9 sim: ppc: cleanup getrusage decls
Don't conflate HAVE_GETRUSAGE & HAVE_SYS_RESOURCE_H.  Use the latter
to include the header and nothing else.  Use the former to determine
whether to use the function and nothing else.  If we find a system
that doesn't follow POSIX and provides only one of these, we can
figure out how to support it then.  The manual local definition is
clashing with the system ones and leading to build failures with
newer C standards.

sim/ppc/emul_netbsd.c:51:5: error: a function declaration without a
	prototype is deprecated in all versions of C and is treated as a
	zero-parameter prototype in C2x, conflicting with a previous
	declaration [-Werror,-Wdeprecated-non-prototype]
2023-12-04 23:36:20 -05:00
Jeff Law
37d6ee9350 Fix right shifts in mcore simulator on 64 bit hosts.
If the value to be shifted has the sign bit set, the sign
bit would get copied into bits 32..63 of the temporary.  Those
would then be right shifted into the final value giving an
incorrect final result.

This was observed with upcoming GCC improvements which eliminate
unnecessary extensions.
2023-12-01 07:19:50 -07:00
Jose E. Marchesi
9d4db627b2 sim: bpf: do not use semicolon to begin comments
The BPF assembler has been updated to follow the clang convention in
the interpretation of semicolons: they separate statements and
directives, and do not start line comments.
2023-11-28 15:01:18 +01:00
Ying Huang
27c22a4c76 sim: mips: Change E_MIPS_* to EF_MIPS_*
According to we have changed all E_MIPS_* to EF_MIPS_* in binutils
and glibc, we also need to change it here to keep same style.
We can refer to this commit record:
https://sourceware.org/pipermail/binutils/2023-October/129904.html

Approved-By: Pedro Alves <pedro@palves.net>
2023-11-16 10:21:55 +08:00
Jaydeep Patil
1c37b30945 sim/riscv: fix JALR instruction simulation
Fix 32bit 'jalr rd,ra,imm' integer instruction, where RD was written
before using it to calculate destination address.

This commit also improves testutils.inc for riscv; make use of
pushsection and popsection when adding things to .data, and setup the
%gp global pointer register within the 'start' macro.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2023-10-18 17:55:31 +01:00
Mike Frysinger
30ebc4310b sim: mips: fix printf string 2023-10-15 16:25:13 +05:45
Jeff Law
c524b5f2f6 [RFA] Fix for mcore simulator
I was looking for cases where a GCC patch under evaluation would cause test
results to change.  Quite surprisingly the mcore-elf port showed test
differences.   After a fair amount of digging my conclusion was the sequences
before/after the patch should have been semantically the same.

Of course if the code is supposed to behave the same, then that points to
problems elsewhere (assembler, linker, simulator).  Sure enough the mcore
simulator was mis-handling the sign extension instructions.  The simulator
implementation of sextb is via paired shift-by-24 operations. Similarly the
simulator implements sexth via paired shift-by-16 operations.

The temporary holding the value was declared as a "long" thus this approach
worked fine for hosts with a 32 bit wide long and failed miserably for hosts
with a 64 bit wide long.

This patch makes the shift count automatically adjust based on the size of the
temporary.  It includes a simple test for sextb and sexth.  I have _not_ done a
full audit of the mcore simulator for more 32->64 bit issues.

This also fixes 443 execution tests in the GCC testsuite
2023-10-11 16:31:11 -06:00
Tom Tromey
fd669f71ea Simplify definition of GUILE
This patch sets GUILE to just plain 'guile'.

In the distant ("devo") past, the top-level build did support building
Guile in-tree.  However, I don't think this really works any more.
For one thing, there are no build dependencies on it, so there's no
guarantee it would actually be built before the uses.

This patch also removes the use of "-s" as an option to cgen scheme
scripts.  With my latest patch upstream, this is no longer needed.

After the upstream changes, either Guile 2 or Guile 3 will work, with
or without the compiler enabled.

2023-08-24  Tom Tromey  <tom@tromey.com>

	* cgen.sh: Don't pass "-s" to cgen.
	* Makefile.in: Rebuild.
	* Makefile.am (GUILE): Simplify.
2023-08-26 13:09:38 -06:00
Stafford Horne
8eb7b3a7db sim: or1k: Eliminate dangerous RWX load segments
This fixes test failures caused by the new linker warning which report:

  ./ld/ld-new: warning: load.S.x has a LOAD segment with RWX permissions

Fix this by splitting the linker MEMORY into ram and rom to avoid
generating RWX sections.  This required tests to be adjusted to fix
issues with the move.  Namely:

  - fpu tests: were incorrectly using l.ori with ha(anchor) which now
    that we pushed the anchor up in memory it exposes the bug.  Update
    to used the correct l.movhi instruction instead.
  - adrp test: the test reports ram offset addresses, now that we have
    moved memory layout around a bit I adjusted the test output.  Some
    padding is added before pi to show that the actual address of pi and
    the adrp page offset are not the same.

Bug: https://sourceware.org/PR29957
2023-08-24 07:03:48 +01:00
David Faust
3f3175554f sim: bpf: remove negi, neg32i insns
The BPF virtual machine does not support neg instructions operating on
immediates, and these erroneous instructions were recently removed from
gas.  Remove them from the simulator as well.
2023-08-21 10:07:25 -07:00
Tom Tromey
887f85fb62 Placate -Wmissing-declarations in sim/cris
I get a couple of -Wmissing-declarations errors when building the sim.
This happens because an earlier patch added the declarations to a
cgen-generated header, but the recent re-generation then removed them.

This patch fixes the build by adding declarations just before the
definition.  This is normally not best practice, but in this
particular situation it at leat un-breaks the build.
2023-08-19 12:26:21 -06:00
Tom Tromey
f03d5c972e Remove extraneous '%' from sim/cris/local.mk
I saw this warning from make:

Makefile:5043: *** mixed implicit and normal rules: deprecated syntax

I believe this snuck in by error with the recent cgen-related changes.

This patch removes the stray '%' and rebuilds the Makefile.in.  I'm
checking this in.
2023-08-19 10:53:53 -06:00
Alan Modra
9d4f36166d sim regen
This regenerates sim files.

Tested with the following tools from a recent binutils build in
sim-site-config.exp, plus a few cross compilers.

set AS_FOR_TARGET_AARCH64 "/home/alan/build/gas/aarch64-linux-gnu/gas/as-new"
set LD_FOR_TARGET_AARCH64 "/home/alan/build/gas/aarch64-linux-gnu/ld/ld-new"
set CC_FOR_TARGET_AARCH64 "aarch64-linux-gnu-gcc"
set AS_FOR_TARGET_ARM "/home/alan/build/gas/arm-linux-gnueabi/gas/as-new"
set LD_FOR_TARGET_ARM "/home/alan/build/gas/arm-linux-gnueabi/ld/ld-new"
set CC_FOR_TARGET_ARM "arm-linux-gnueabi-gcc"
set AS_FOR_TARGET_AVR "/home/alan/build/gas/avr-elf/gas/as-new"
set LD_FOR_TARGET_AVR "/home/alan/build/gas/avr-elf/ld/ld-new"
set CC_FOR_TARGET_AVR ""
set AS_FOR_TARGET_BFIN "/home/alan/build/gas/bfin-elf/gas/as-new"
set LD_FOR_TARGET_BFIN "/home/alan/build/gas/bfin-elf/ld/ld-new"
set CC_FOR_TARGET_BFIN ""
set AS_FOR_TARGET_BPF "/home/alan/build/gas/bpf-none/gas/as-new"
set LD_FOR_TARGET_BPF "/home/alan/build/gas/bpf-none/ld/ld-new"
set CC_FOR_TARGET_BPF ""
set AS_FOR_TARGET_CR16 "/home/alan/build/gas/cr16-elf/gas/as-new"
set LD_FOR_TARGET_CR16 "/home/alan/build/gas/cr16-elf/ld/ld-new"
set CC_FOR_TARGET_CR16 ""
set AS_FOR_TARGET_CRIS "/home/alan/build/gas/cris-elf/gas/as-new"
set LD_FOR_TARGET_CRIS "/home/alan/build/gas/cris-elf/ld/ld-new"
set CC_FOR_TARGET_CRIS ""
set AS_FOR_TARGET_D10V "/home/alan/build/gas/d10v-elf/gas/as-new"
set LD_FOR_TARGET_D10V "/home/alan/build/gas/d10v-elf/ld/ld-new"
set CC_FOR_TARGET_D10V ""
set AS_FOR_TARGET_FRV "/home/alan/build/gas/frv-elf/gas/as-new"
set LD_FOR_TARGET_FRV "/home/alan/build/gas/frv-elf/ld/ld-new"
set CC_FOR_TARGET_FRV ""
set AS_FOR_TARGET_FT32 "/home/alan/build/gas/ft32-elf/gas/as-new"
set LD_FOR_TARGET_FT32 "/home/alan/build/gas/ft32-elf/ld/ld-new"
set CC_FOR_TARGET_FT32 ""
set AS_FOR_TARGET_H8300 "/home/alan/build/gas/h8300-elf/gas/as-new"
set LD_FOR_TARGET_H8300 "/home/alan/build/gas/h8300-elf/ld/ld-new"
set CC_FOR_TARGET_H8300 ""
set AS_FOR_TARGET_IQ2000 "/home/alan/build/gas/iq2000-elf/gas/as-new"
set LD_FOR_TARGET_IQ2000 "/home/alan/build/gas/iq2000-elf/ld/ld-new"
set CC_FOR_TARGET_IQ2000 ""
set AS_FOR_TARGET_LM32 "/home/alan/build/gas/lm32-linux-gnu/gas/as-new"
set LD_FOR_TARGET_LM32 "/home/alan/build/gas/lm32-linux-gnu/ld/ld-new"
set CC_FOR_TARGET_LM32 ""
set AS_FOR_TARGET_M32C "/home/alan/build/gas/m32c-elf/gas/as-new"
set LD_FOR_TARGET_M32C "/home/alan/build/gas/m32c-elf/ld/ld-new"
set CC_FOR_TARGET_M32C ""
set AS_FOR_TARGET_M32R "/home/alan/build/gas/m32r-elf/gas/as-new"
set LD_FOR_TARGET_M32R "/home/alan/build/gas/m32r-elf/ld/ld-new"
set CC_FOR_TARGET_M32R ""
set AS_FOR_TARGET_M68HC11 "/home/alan/build/gas/m68hc11-elf/gas/as-new"
set LD_FOR_TARGET_M68HC11 "/home/alan/build/gas/m68hc11-elf/ld/ld-new"
set CC_FOR_TARGET_M68HC11 ""
set AS_FOR_TARGET_MCORE "/home/alan/build/gas/mcore-elf/gas/as-new"
set LD_FOR_TARGET_MCORE "/home/alan/build/gas/mcore-elf/ld/ld-new"
set CC_FOR_TARGET_MCORE ""
set AS_FOR_TARGET_MICROBLAZE "/home/alan/build/gas/microblaze-linux-gnu/gas/as-new"
set LD_FOR_TARGET_MICROBLAZE "/home/alan/build/gas/microblaze-linux-gnu/ld/ld-new"
set CC_FOR_TARGET_MICROBLAZE "microblaze-linux-gnu-gcc"
set AS_FOR_TARGET_MIPS "/home/alan/build/gas/mips-linux-gnu/gas/as-new"
set LD_FOR_TARGET_MIPS "/home/alan/build/gas/mips-linux-gnu/ld/ld-new"
set CC_FOR_TARGET_MIPS "mips-linux-gnu-gcc"
set AS_FOR_TARGET_MN10300 "/home/alan/build/gas/mn10300-elf/gas/as-new"
set LD_FOR_TARGET_MN10300 "/home/alan/build/gas/mn10300-elf/ld/ld-new"
set CC_FOR_TARGET_MN10300 ""
set AS_FOR_TARGET_MOXIE "/home/alan/build/gas/moxie-elf/gas/as-new"
set LD_FOR_TARGET_MOXIE "/home/alan/build/gas/moxie-elf/ld/ld-new"
set CC_FOR_TARGET_MOXIE ""
set AS_FOR_TARGET_MSP430 "/home/alan/build/gas/msp430-elf/gas/as-new"
set LD_FOR_TARGET_MSP430 "/home/alan/build/gas/msp430-elf/ld/ld-new"
set CC_FOR_TARGET_MSP430 ""
set AS_FOR_TARGET_OR1K "/home/alan/build/gas/or1k-linux-gnu/gas/as-new"
set LD_FOR_TARGET_OR1K "/home/alan/build/gas/or1k-linux-gnu/ld/ld-new"
set CC_FOR_TARGET_OR1K ""
set AS_FOR_TARGET_PPC "/home/alan/build/gas/powerpc-linux-gnu/gas/as-new"
set LD_FOR_TARGET_PPC "/home/alan/build/gas/powerpc-linux-gnu/ld/ld-new"
set CC_FOR_TARGET_PPC "powerpc-linux-gnu-gcc"
set AS_FOR_TARGET_PRU "/home/alan/build/gas/pru-elf/gas/as-new"
set LD_FOR_TARGET_PRU "/home/alan/build/gas/pru-elf/ld/ld-new"
set CC_FOR_TARGET_PRU ""
set AS_FOR_TARGET_RISCV "/home/alan/build/gas/riscv32-elf/gas/as-new"
set LD_FOR_TARGET_RISCV "/home/alan/build/gas/riscv32-elf/ld/ld-new"
set CC_FOR_TARGET_RISCV ""
set AS_FOR_TARGET_RL78 "/home/alan/build/gas/rl78-elf/gas/as-new"
set LD_FOR_TARGET_RL78 "/home/alan/build/gas/rl78-elf/ld/ld-new"
set CC_FOR_TARGET_RL78 ""
set AS_FOR_TARGET_RX "/home/alan/build/gas/rx-elf/gas/as-new"
set LD_FOR_TARGET_RX "/home/alan/build/gas/rx-elf/ld/ld-new"
set CC_FOR_TARGET_RX ""
set AS_FOR_TARGET_SH "/home/alan/build/gas/sh-rtems/gas/as-new"
set LD_FOR_TARGET_SH "/home/alan/build/gas/sh-rtems/ld/ld-new"
set CC_FOR_TARGET_SH ""
set AS_FOR_TARGET_ERC32 ""
set LD_FOR_TARGET_ERC32 ""
set CC_FOR_TARGET_ERC32 ""
set AS_FOR_TARGET_V850 "/home/alan/build/gas/v850-elf/gas/as-new"
set LD_FOR_TARGET_V850 "/home/alan/build/gas/v850-elf/ld/ld-new"
set CC_FOR_TARGET_V850 ""

Results both before and after were:
FAIL: crisv10 mem1.ms (execution)
FAIL: crisv10 mem2.ms (execution)
FAIL: crisv32 mem1.ms (execution)
FAIL: crisv32 mem2.ms (execution)
FAIL: microblaze fail.s (execution)
FAIL: microblaze pass.s (execution)
expected passes            5288
unexpected failures        6
expected failures          3
untested testcases         373
unsupported tests          14
2023-08-19 12:41:32 +09:30
Alan Modra
c7631501b2 sim regen preparation
Regerating sim loses commit 1be79b1ebf from sim/lm32/cpu.h, a
generated file, so this patch move those declarations to
sim/lm32/sim-main.h.
2023-08-19 12:41:32 +09:30
Alan Modra
e7ad52cde6 sim --enable-cgen-maint
I had reason yesterday to want to regenerate configury files which I
do with --enable-maintainer-mode, and added --enable-cgen-maint
accidentally.  The first problem I hit is that sim looks for cgen in a
different directory by default than opcodes, and I had my source
layout set up for opcodes rather than sim.  Fix that by making both
use ../cgen first, then ../../cgen relative to sim/ and opcodes/.  The
next problem was that various sim local.mk files expected generated
sources in the build dir rather than the source dir.  Fix that by
adding $(srcdir) to paths.  Finally, the generated iq2000 files had a
compile error, fixed by the cpu/iq2000.cpu patch.

cpu/
	* iq2000.cpu (syscall): Add pc arg.
opcodes/
	* configure.ac (cgendir): Default to ../../cgen, but use ../cgen
	if found there.
	* configure: Regenerate.
sim/m4/
	* sim_ac_option_cgen_maint.m4 (cgendir): Look in ../cgen too.
sim/
	* cris/local.mk: Add $(srcdir) to paths for regenerated source.
	* frv/local.mk: Likewise.
	* iq2000/local.mk: Likewise.
	* lm32/local.mk: Likewise.
	* m32r/local.mk: Likewise.
	* or1k/local.mk: Likewise.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
2023-08-19 12:41:32 +09:30
Alan Modra
0e1b3420fb sim prune_warnings
Remove some of the warnings generated by newer versions of ld.

	* testsuite/lib/sim-defs.exp (prune_warnings_extra): New.
	Arrange to run it from prune_warnings.
2023-08-19 12:41:32 +09:30
Alan Modra
880802688c Re: sim frv: Add a missing return value for frvbf_check_acc_range.
Commit f00b50d057 went the wrong way.  As the comment says this
function is only applicable to fr550.  If not fr550 return 1,
meaning we don't have acc restrictions.
2023-08-17 21:44:04 +09:30
Alan Modra
6a6859cbff regen config
This regenerates config files changed by the previous 44 commits.
Note that subject lines in these commits mostly match the gcc git
originating commit.
2023-08-12 10:27:57 +09:30
Alan Modra
226f9f4fad Rename bfd_bread and bfd_bwrite
These were renamed from bfd_read and bfd_write back in 2001 when they
lost an unnecessary parameter.  Rename them back, and get rid of a few
casts that are only needed without prototyped functions (K&R C).
2023-08-09 08:48:09 +09:30
Jose E. Marchesi
3b2ffd32d2 bpf: sim: do not overflow instruction immediates in tests
This patch fixes some instructions in the BPF tests that overflow the
signed immediates.  Note that this happened to work before by chance,
as GAS would silently truncate.

Tested in bpf-unknown-none.

Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
2023-07-31 11:09:47 +02:00
Jose E. Marchesi
4200337219 bpf: fix neg and neg32 BPF instructions in simulator
This patch fixes the semantics of the neg and neg32 BPF instructions
in the simulator, and also updates the corresponding tests
accordingly.

Tested in target bpf-unknown-none.
2023-07-26 11:44:20 +02:00
Jose E. Marchesi
7bb9f0c2be sim/bpf: desCGENization of the BPF simulator
The BPF port in binutils has been rewritten (commit
d218e7fedc) in order to not be longer
based on CGEN.  Please see that commit log for more information.

This patch updates the BPF simulator accordingly.  The new
implementation is much simpler and it is based on the new BPF opcodes.

Tested with target bpf-unknown-none with both 64-bit little-endian
host and 32-bit little-endian host.

Note that I have not tested in a big-endian host yet.  I will do so
once this lands upstream so I can use the GCC compiler farm.
2023-07-21 12:40:50 +02:00
Jose E. Marchesi
873a1ec405 sim: bpf: update to new BPF relocations
This patch updates the BPF GNU sim testsuite in order to match the new
BPF relocations introduced in binutils in a recent patch [1].

[1] https://sourceware.org/pipermail/binutils/2023-March/126429.html
2023-04-26 19:22:14 +02:00
Mike Frysinger
cc67f780ec sim: info: convert verbose field to a bool
The verbose argument has always been an int treated as a bool, so
convert it to an explicit bool.  Further, update the API docs to
match the reality that the verbose value is actually used by some
of the internal modules.
2023-01-18 20:47:55 -05:00
Mike Frysinger
7fd14d6f58 sim: unify sim-signal.o building
Now that sim-main.h has been reduced significantly, we can remove it
from sim-signal.c and unify it across all boards since it compiles to
the same code.
2023-01-18 19:26:58 -05:00
Mike Frysinger
c743e42e22 sim: v850: reduce extra header inclusion to igen files
Limit these extra header includes to only when specific igen files
include us until we can move the includes to the igen fils directly.
2023-01-18 19:13:04 -05:00
Mike Frysinger
e560389783 sim: v850: drop redundant define
This is already in v850/local.mk, so we can drop it from sim-main.h.
2023-01-18 19:13:04 -05:00
Mark Wielaard
c064fab247 sim: mn10300: minimize mn10300-sim.h include in sim-main.h
sim-main.h is special since it is one of the files automatically
included in igen generated files. But this means anything including
sim-main.h might get everything included just for the igen files.

To prevent clashing symbols/defines only include sim-fpu.h,
sim-signal.h, mn10300-sim.h from sim-main.h if it is included
from one of the generated igen C files. Add explicit includes
of mn10300-sim.h, sim-fpu.h and/or sim-signal.h to dv-mn103cpu.c,
interp.c and op_utils.c.
2023-01-19 01:05:00 +01:00
Mike Frysinger
1b1be68b9b sim: ppc: drop local psim link
This has never been installed, and it's not clear anyone cares about
it in the local build dir (when the main program is sim/ppc/run), so
drop all the logic to simplify.
2023-01-17 23:29:23 -05:00
Mike Frysinger
da8c966399 sim: assume sys/stat.h always exists (via gnulib)
We have many uses of sys/stat.h that are unprotected by HAVE_SYS_STAT_H,
so this is more formalizing the reality that we require this header.
Since we switched to gnulib, it guarantees that a sys/stat.h exists
for us to include, so we're doubly OK.
2023-01-16 04:42:47 -05:00
Mike Frysinger
4cd7de783b sim: formally assume unistd.h always exists (via gnulib)
We have many uses of unistd.h that are unprotected by HAVE_UNISTD_H,
so this is more formalizing the reality that we require this header.
Since we switched to gnulib, it guarantees that a unistd.h exists
for us to include, so we're doubly OK.
2023-01-16 04:35:48 -05:00
Mike Frysinger
e9bf6a4a20 sim: build: stop probing system extensions (ourselves)
This logic was added in order to expose the strsignal prototype for
nrun.c.  Since then, we've migrated to gnulib as our portability layer,
and it takes care of probing system extensions for us, so there's no
need to duplicate the work.
2023-01-16 04:22:10 -05:00
Mike Frysinger
109a0a7e90 sim: modules.c: fix generation after recent refactors
Add explicit arch-specific modules.c rules to keep the build from
generating an incorrect common/modules.c.  Otherwise the pattern
rules would cascade such that it'd look for $arch/modules.o which
turned into common/modules.c which triggered the gen rule.

My local testing of this code didn't catch this bug because of how
Automake manages .Po (dependency files) in incremental builds -- it
was adding extra rules that override the pattern rules which caused
the build to generate correct modules.c files.  But when building
from a cold cache, the pattern rules would force common/modules.c to
be used leading to crashes at runtime.
2023-01-15 20:55:48 -05:00
Mark Wielaard
ad6adc6657 sim: microblaze, mn10300: remove signal.h include in interp.c
signal.h isn't needed in microblaze and mn10300 interp.c
so don't include it.
2023-01-15 18:45:07 +01:00
Mike Frysinger
2025c82b95 sim: m32r: fix typos in stamp depends
Copying & pasting the first rule missed updating the dep to the right
stamp file.
2023-01-15 02:07:44 -05:00
Mike Frysinger
9a7472d7c5 sim: igen: simplify build logic a little
Now that all ports (that use igen) build in the top-level and depend
on igen, we can move the conditional logic out of configure.  We also
switch from noinst_LIBRARIES to EXTRA_LIBRARIES so that the library
is only built when needed (i.e. the igen tool is used).
2023-01-15 02:07:43 -05:00
Mike Frysinger
eaa13962f2 sim: build: drop depdir subdir hack
Now that all the ports compile some C files in their arch dirs, Automake
guarantees creating the depdir for us, so we can drop our configure hack.
2023-01-14 21:02:12 -05:00
Mike Frysinger
1b907fc09f sim: common: simplify modules.c deps
Now that all ports (other than ppc) build in the top-level, we don't
need to expand all the modules.c targets as a recursive dep.  Each
port depends on their respective file now, and the ppc port doesn't
use it at all.
2023-01-14 21:01:33 -05:00
Mike Frysinger
72be276fff sim: common: move modules.c to source tracking
This makes sure the arch-specific modules.c wildcard is matched and
not the common/%.c so that we compile it correctly.  It also makes
sure each subdir has depdir logic enabled.
2023-01-14 20:53:13 -05:00
Mike Frysinger
4df7470704 sim: common: move libcommon.a dep to ppc code
Rather than force this to be built ahead of time for all targets,
move the dep to the ppc code since it's the only user of it now.
2023-01-14 20:51:53 -05:00
Mike Frysinger
ee3134d028 sim: build: drop most recursive build deps
Now that we build these objects in the top dir & generate modules.c
there, we don't need to generate them all first -- we can let the
normal dependency graph take care of building things in parallel.
2023-01-14 20:50:36 -05:00
Mike Frysinger
eac2fbdc4b sim: common: move libcommon.a objects to sources
This simplifies the build logic and avoids an Automake bug where the
common_libcommon_a_OBJECTS variable isn't set in the arch libsim.a
DEPENDENCIES for targets that, alphabetically, come before "common".
We aren't affected by that bug with the current code, but as we move
things out of SIM_ALL_RECURSIVE_DEPS and rely on finer dependencies,
we will trip over it.
2023-01-14 20:48:49 -05:00
Mike Frysinger
0e7c397dbf sim: igen: simplify build dep
Now that all ports (other than ppc) build in the top-level, we don't
need to mark the igen tool as a recursive dep.  Each port depends on
the tool if it actually uses it, and ppc doesn't use it at all.
2023-01-14 20:46:00 -05:00
Mike Frysinger
49444feaef sim: common: simplify hw-config.h deps
Now that all ports (other than ppc) build in the top-level, we don't
need to expand all the hw-config.h targets as a recursive dep.  Each
port depends on their respective header now, and the ppc port doesn't
use it at all.
2023-01-14 20:44:40 -05:00
Mike Frysinger
068b723abc sim: build: drop AM_MAKEFLAGS settings
We don't have any recursive builds anymore, so we can drop this logic.
2023-01-14 20:41:24 -05:00
Mike Frysinger
fe0adb538f sim: build: delete Make-common.in logic
Now that all (other than ppc) build in the top-level, this logic is
unused, so punt it all.
2023-01-13 17:34:53 -05:00
Mike Frysinger
6baf06097b sim: build: drop subdir Makefile.in files
These aren't used anymore, so punt them all.
2023-01-11 22:49:28 -05:00
Mike Frysinger
fd95c73ef5 sim: disable recursive make in (most) subdirs
Now that all (other than ppc) build in the top-level, we can disable
the recursive make calls to them.  This speeds things up nicely.
2023-01-10 01:22:00 -05:00
Mike Frysinger
b014c9b087 sim: common: move test-hw-events to top-level build
This is an internal developer target that isn't normally compiled,
but it can still be occasionally useful.  Move it to the top-level
build so we can kill off common/Make-common.in.
2023-01-10 01:15:29 -05:00
Mike Frysinger
b36a89d135 sim: move arch-specific file compilation of common/ files to top-level 2023-01-10 01:15:29 -05:00
Mike Frysinger
8f5fc30fcf sim: v850: move arch-specific file compilation to top-level
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
2023-01-10 01:15:29 -05:00
Mike Frysinger
d667f7b30a sim: sh: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
3e3e7217b0 sim: rx: move arch-specific file compilation to top-level
The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
2023-01-10 01:15:28 -05:00
Mike Frysinger
0db0b664a6 sim: rl78: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
e7699de502 sim: riscv: move arch-specific file compilation to top-level
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
2023-01-10 01:15:28 -05:00
Mike Frysinger
51bc8f3a16 sim: pru: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
b7bd5fe99b sim: or1k: move arch-specific file compilation to top-level
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
2023-01-10 01:15:28 -05:00
Mike Frysinger
4fff443a11 sim: msp430: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
ae0411a485 sim: moxie: move arch-specific file compilation to top-level
The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
2023-01-10 01:15:28 -05:00
Mike Frysinger
63a9d59e88 sim: mn10300: move arch-specific file compilation to top-level
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
2023-01-10 01:15:28 -05:00
Mike Frysinger
1546cb4540 sim: mips: move arch-specific file compilation to top-level
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
2023-01-10 01:15:28 -05:00
Mike Frysinger
b7375a2dda sim: microblaze: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
28ae9bed3d sim: mcore: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
5a71cd470f sim: m68hc11: move arch-specific file compilation to top-level
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
2023-01-10 01:15:28 -05:00
Mike Frysinger
9b5a17d2be sim: m32r: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
cd7aa21771 sim: m32c: move arch-specific file compilation to top-level
The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
2023-01-10 01:15:28 -05:00
Mike Frysinger
2d3b0c959d sim: lm32: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
d2c06f6bcd sim: iq2000: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
dced2faff5 sim: h8300: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
abc4c2173c sim: ft32: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
5ea1eaea7a sim: frv: move arch-specific file compilation to top-level
The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
2023-01-10 01:15:28 -05:00
Mike Frysinger
8ba643c31e sim: example-synacor: move arch-specific file compilation to top-level 2023-01-10 01:15:28 -05:00
Mike Frysinger
304195bcf8 sim: erc32: move arch-specific file compilation to top-level
The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
2023-01-10 01:15:28 -05:00
Mike Frysinger
2206990476 sim: d10v: move arch-specific file compilation to top-level 2023-01-10 01:15:27 -05:00
Mike Frysinger
71fa869293 sim: cris: move arch-specific file compilation to top-level 2023-01-10 01:15:27 -05:00
Mike Frysinger
df4b07f4b7 sim: cr16: move arch-specific file compilation to top-level 2023-01-10 01:15:27 -05:00
Mike Frysinger
a8e175e578 sim: bfin: move arch-specific file compilation to top-level
The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
2023-01-10 01:15:27 -05:00
Mike Frysinger
75015a129f sim: bpf: move arch-specific file compilation to top-level
We can drop the arch-specific rules from the subdir as they're no
longer used.
2023-01-10 01:15:27 -05:00
Mike Frysinger
98331de786 sim: avr: move arch-specific file compilation to top-level 2023-01-10 01:15:27 -05:00
Mike Frysinger
688fba23d2 sim: arm: move arch-specific file compilation to top-level
The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
2023-01-10 01:15:27 -05:00
Mike Frysinger
b3e1c5d43d sim: aarch64: move arch-specific file compilation to top-level 2023-01-10 01:15:27 -05:00
Mike Frysinger
bc438b3e59 sim: build: add basic framework for compiling arch objects in top-level
The code so far has been assuming that we only compile common/ objects.
Now that we're ready to compile arch-specific objects, refactor some of
the flags & checks a bit to support both.
2023-01-10 01:15:26 -05:00
Mike Frysinger
54e26255ca sim: modules.c: move generation to top-level
Now that all arches create libsim.a from the top-level, we have full
access to their inputs, and can move the actual generation from the
subdir up to the top-level.  This avoids recursive makes and will
help simplify state passing between the two.
2023-01-10 01:15:26 -05:00
Mike Frysinger
638a9300b5 sim: build: drop common/nrun.o subdir hack
Now that all the subdirs handle their own builds, we can drop this
common rule as it's unused, and we don't want to use it anymore.
2023-01-10 01:15:26 -05:00
Mike Frysinger
e732fe9b4f sim: build: drop support for creating libsim.a in subdirs
Now that all ports have moved to creating libsim.a in the top-level,
drop all the support code to create it in a subdir.
2023-01-10 01:15:26 -05:00
Mike Frysinger
7a59a0b92c sim: v850: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:26 -05:00
Mike Frysinger
dd719fa642 sim: sh: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:26 -05:00
Mike Frysinger
15538f6511 sim: rx: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:26 -05:00
Mike Frysinger
91a335f9fd sim: rl78: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
91344291e0 sim: riscv: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
3373e27fe1 sim: pru: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
4d998e1559 sim: or1k: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
bff048f587 sim: msp430: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
0754b62591 sim: moxie: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
4c54f341f0 sim: mn10300: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
1f1afa43f5 sim: mips: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.

The mips code is a little more tricky than others because, for multi-run
targets, it generates the list of sources & objects on the fly in the
configure script.
2023-01-10 01:15:25 -05:00
Mike Frysinger
a6ead8401a sim: microblaze: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
dfceaa0dc3 sim: mcore: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
ccb680718a sim: m68hc11: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:25 -05:00
Mike Frysinger
8136f0578d sim: m32r: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
ba3a849899 sim: m32c: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
000f7bee9a sim: lm32: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
1486f22b13 sim: iq2000: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
3e9c9407ff sim: h8300: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
6fe4bd8ced sim: ft32: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
c26946a4aa sim: frv: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
16a6d5420b sim: example-synacor: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
3f6c63ac49 sim: erc32: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
faf177dff0 sim: d10v: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
eaa678ecc3 sim: cris: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
2cbdcc340a sim: cr16: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:24 -05:00
Mike Frysinger
cdbb77e4dc sim: bpf: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:23 -05:00
Mike Frysinger
bc1dd618ac sim: bfin: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:23 -05:00
Mike Frysinger
c65b31b868 sim: avr: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:23 -05:00
Mike Frysinger
6a8e18f038 sim: arm: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:23 -05:00
Mike Frysinger
c58353b786 sim: aarch64: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
2023-01-10 01:15:23 -05:00
Mike Frysinger
7a1e1f9463 sim: build: drop support for subdir extra deps
Nothing uses this hook anymore, so punt it.  It was largely used to
track generated files (which we do in the top-level now) and extra
header files (which we use automake depgen for now).
2023-01-10 01:15:23 -05:00
Mike Frysinger
437eeee95c sim: modules: trigger generation from top-level
Add rules for tracking generated subdir modules.c files.  This doesn't
actually generate the file from the top-level, but allows us to add
rules that need to be ordered wrt it.  Once those changes land, we can
rework this to actually generate from the top-level.

This currently builds off of the objects that go into the libsim.a as
we don't build those from the top-level either.  Once we migrate that
up, we can switch this to the source files directly.  It's a bit hacky
overall, but makes it easier to migrate things in smaller chunks, and
we aren't going to keep this logic long term.
2023-01-10 01:15:23 -05:00
Mike Frysinger
ddfc4317d5 sim: mips: add multi source to built sources
The multirun generation mode is a bit of a mess as generated run files
depend on generate igen files, all with unknown names ahead of time.
In the multirun mode, be lazy and declare all of these generated source
files as built sources so they'll be created early on.
2023-01-04 22:51:07 -05:00
Tsukasa OI
9f046489d0 sim: Move getopt checking inside SIM_AC_PLATFORM
This commit moves getopt declaration checker originally in sim/
configure.ac; added in commit 340aa4f687 ("sim: Check known getopt
definition existence") to sim/m4/sim_ac_platform.m4 (inside the
SIM_AC_PLATFORM macro).

It also regenerates configuration files using the maintainer mode.
2023-01-05 03:31:42 +00:00
Guillermo E. Martinez
7cbf35923d sim: bpf: fix testsuite due to linker warnings [PR sim/29954]
On a bpf-*-* testsuite fails:
	./ld/ld-new: warning: test has a LOAD segment with RWX permissions

Adjusting `--memory-size=10Mb' to the simulator bpf testsuite passes.

Tested on bpf-*-*:

Bug: https://sourceware.org/PR29954

sim/testsuite:
	* bpf/allinsn.exp (SIMFLAGS_FOR_TARGET): Adjust sim flags.
2023-01-04 20:54:14 -05:00
Tsukasa OI
bd87d4ef88 sim: Regenerate using the maintainer mode
Those files have changed by regenerating using the maintainer mode.
The first line of sim/ppc/pk.h have changed by an effect of the commit
319e41e83a ("sim: ppc: inline the sim-packages option").
2023-01-04 02:14:51 +00:00
Mike Frysinger
fdbd297027 sim: sh: move some generated source files to built sources
This should have been part of the previous commit 80636a54bc
("sim: build: move generated headers to built sources"), but they were
missed because they're .c files effectively treated as .h files.
2023-01-02 22:48:13 -05:00
Mike Frysinger
7c9a934c4d sim: build: add var for tracking sim enable directly
Rather than rely on SIM_SUBDIRS being set, add a dedicated variable
to track whether to enable the sim.  While the current code works
fine, it won't work as we remove the recursive make logic (i.e. the
SIM_SUBDIRS variable).
2023-01-02 22:40:49 -05:00
Mike Frysinger
127d167a98 sim: common: drop libcommon.a linkage
All of these objects should be in libsim.a already, so don't link to
it too.  In practice it never gets used, but no point in listing it.
2023-01-02 22:21:01 -05:00
Mike Frysinger
80636a54bc sim: build: move generated headers to built sources
Automake's automatic header deptracking has a bootstrap problem where
it can't detect generated headers when compiling.  We've been handling
that by adding a custom SIM_ALL_RECURSIVE_DEPS variable, but that only
works when building objects recursively in subdirs.  As we move those
out to the top-level, we don't have any recursive steps anymore.  The
Automake approach is to declare those headers in BUILT_SOURCES.

This isn't completely foolproof as the Automake manual documents: it
only activates for `make all`, not `make foo.o`, but that shouldn't be
a huge limitation as it only affects the initial compile.  After that,
rebuilds should work fine.
2023-01-02 21:16:19 -05:00
Mike Frysinger
3b89a7b8ce sim: cgen: drop common subdir build rules
Now that everything has been hoisted to the top-level, we can delete
this unused logic.
2023-01-02 20:31:56 -05:00
Mike Frysinger
f1a0a99c04 sim: or1k: hoist cgen rules to top-level 2023-01-02 20:31:54 -05:00
Mike Frysinger
cf764309dc sim: m32r: hoist cgen rules to top-level 2023-01-02 20:31:29 -05:00
Mike Frysinger
869585833a sim: lm32: hoist cgen rules to top-level 2023-01-02 20:30:54 -05:00
Mike Frysinger
d5dd8f5d16 sim: iq2000: hoist cgen rules to top-level 2023-01-02 20:30:20 -05:00
Mike Frysinger
cd313814aa sim: frv: hoist cgen rules to top-level 2023-01-02 20:29:52 -05:00
Mike Frysinger
3298ee7a2c sim: cris: hoist cgen rules to top-level 2023-01-02 20:29:21 -05:00
Mike Frysinger
3abb19ad7e sim: bpf: hoist cgen rules to top-level 2023-01-02 20:28:08 -05:00
Mike Frysinger
93b937c903 sim: cgen: hoist rules to the top-level build
The rules seem to generate the same output as existing subdir cgen
rules with cgen ports, so hopefully this should be correct.  These
are the last set of codegen rules that we run in subdirs, so this
will help unblock killing off subdir builds entirely.
2023-01-02 20:26:27 -05:00
Mike Frysinger
4d4996a55e sim: build: use Automake include vars
Rather than define our own hack for emitting an include statement,
use the existing Automake include variables.  These have the nice
side-effect of being more portable.
2023-01-02 19:30:22 -05:00
Mike Frysinger
c217e3d54e sim: replace -I$srcroot/bfd include with -I$srcroot
Clean up includes a bit by making ports include bfd/ headers
explicitly.  This matches other projects, and makes it more clear
where these headers are coming from.
2023-01-01 23:17:07 -05:00
Mike Frysinger
60a1031181 sim: replace -I$srcroot/opcodes include with -I$srcroot
Clean up includes a bit by making ports include opcodes/ headers
explicitly.  This matches other projects, and makes it more clear
where these headers are coming from.
2023-01-01 23:14:19 -05:00
Mike Frysinger
33383d1674 sim: build: drop unused SIM_EXTRA_LIBS
Now that all run binaries are linked in the topdir, this subdir libs
variable isn't used anywhere, so punt it.
2023-01-01 17:46:15 -05:00
Mike Frysinger
2a1b3235f2 sim: erc32: drop -I$(srcroot)
Since the port doesn't actually use this include, drop it.
No other port is doing this either.
2023-01-01 17:43:25 -05:00
Mike Frysinger
508de64120 sim: drop mention of & support for subdir configure
Now that no ports use these common configure APIs, delete the logic
and remove it from the documentation.
2023-01-01 17:35:16 -05:00
Mike Frysinger
0d9d77e506 sim: refresh copyright dates a bit
Update a few files that were missed, and revert the generated Automake
output that uses dates from Automake itself.
2023-01-01 15:09:19 -05:00
Mike Frysinger
c536b4f527 sim: or1k: drop unused rules
These rules are the same as the common ones, so drop them to simplify.
2023-01-01 14:40:03 -05:00
Mike Frysinger
701ea7a256 sim: iq2000: drop unused cpu define logic
These defines seem to have been added in anticipation of adding another
cpu port (IQ10BF?), but that was over 20 years ago, and that port has
yet to materialize.  So drop these compile flags since they don't do
anything to the generated code.  If another port ever shows up, it's
easy enough to readd things as needed.
2023-01-01 14:05:57 -05:00
Joel Brobecker
213516ef31 Update copyright year range in header of all files managed by GDB
This commit is the result of running the gdb/copyright.py script,
which automated the update of the copyright year range for all
source files managed by the GDB project to be updated to include
year 2023.
2023-01-01 17:01:16 +04:00
Mike Frysinger
b19d96d139 sim: build: clean up unused codegen logic
Now that all igen ports are in the top-level makefile, we don't need
this logic in any subdirs anymore, so clean it up.
2022-12-27 00:31:34 -05:00
Mike Frysinger
f12c3c632e sim: mips: hoist "multi" igen rules up to common builds
Since these are the last mips igen rules, we can clean up a number of
bits in the local Makefile.in.
2022-12-27 00:31:34 -05:00
Mike Frysinger
f6d58d4012 sim: mips: hoist "m16" igen rules up to common builds 2022-12-27 00:31:34 -05:00
Mike Frysinger
3a31051b3a sim: mips: hoist "single" igen rules up to common builds 2022-12-27 00:31:34 -05:00
Mike Frysinger
07f60ed831 sim: mips: rename "igen" generation mode to "single"
The naming in here has grown organically and is confusing to follow.
Originally there was only one set of rules for generating code from
the igen sources, so calling it "tmp-igen" and such made sense.  But
when other multigen modes were added ("m16" & "multi") which also
used igen, it's not clear what's common igen and what's specific to
this generation  mode.  So rename the set of rules from "igen" to
"single" so it's easier to follow.
2022-12-27 00:31:34 -05:00
Mike Frysinger
49d3ce6c2e sim: mips: hoist itable igen rules up to common builds
Since this rule is pretty simple, hoist it up to the common build.
2022-12-27 00:31:33 -05:00
Mike Frysinger
67c952d109 sim: mips: unify itable generation (a bit)
The m16 & multi targets generate itable once even when all the other
modules are generated multiple times.  The default igen target will
generate itable with everything else out of convenience.  This means
flags are passed which don't affect the generated itable there.

We can unify the itable generation by making sure the right -F/-M
filter variables are passed down.  Since there's already a dedicated
rule & variable in the multi build mode, generalize that and switch
the m16 & igen builds over too.

I spent a lot of time staring at this code, building for diff mips
targets, and exploring all the shell code paths.  I think this is
safe, but only time (and users) will really tell.
2022-12-27 00:31:33 -05:00
Mike Frysinger
4c45662c0f sim: mips: rename multi_flags to igen_itable_flags
This variable is only used to generate the itable files.  In preparation
for merging the itable logic among all ports, rename "multi_flags" to a
more appropriate "igen_itable_flags" variable.  There should be no real
chagnes here otherwise.
2022-12-27 00:31:33 -05:00
Mike Frysinger
556ca380d7 sim: mips: drop unused micromips igen logic
This code appears to be unused since it was first merged.  When
micromips was enabled, it was via the "MULTI" config, not the
"MICROMIPS" config, and the multi configs have sep vars.  Since
nothing sets SIM_MIPS_GEN=MICROMIPS in the config, all of this
should be unreachable, so punt it to simplify.  Further, the
SIM_MIPS_MICROMIPS16_FLAGS & SIM_MIPS_MICROMIPS_FLAGS settings
rely on sim_mips_micromips{,16}_{filter,machine} variables that
are never set in the configure script.
2022-12-27 00:31:33 -05:00
Mike Frysinger
2a005e97c9 sim: build: drop support for subdir distclean
All ports that need to clean things up at distclean time have moved
to the top-level build, so we can drop support for this hook.
2022-12-25 14:24:05 -05:00
Mike Frysinger
edda128da7 sim: mips: move distclean settings to common build
This was missed when mips/configure was merged into the top-level.
2022-12-25 10:05:39 -05:00
Mike Frysinger
111b1cf97e sim: smp: plumb igen flag down to all users
While mips has respected sim_igen_smp at configure time (which was
always empty since it defaulted smp to off), no other igen port did.
Move this to a makefile variable and plumb it through the common
IGEN_RUN variable instead so everyone gets it by default.  We also
clean up some redundant -N0 setting with multirun mips.
2022-12-25 02:13:32 -05:00
Mike Frysinger
20b579bac5 sim: smp: make option available again
At some point we want this to work, but it's not easy to test if
the configure option isn't available.  Restore it, but keep the
default off.
2022-12-25 02:13:30 -05:00
Mike Frysinger
883be19774 sim: cpu: change default init to handle all cpus
All the runtimes were only initializing a single CPU.  When SMP is
enabled, things quickly crash as none of the other CPU structs are
setup.  Change the default from 0 to the compile time value.
2022-12-25 02:10:46 -05:00
Mike Frysinger
fc9b044582 sim: msp430: add basic SMP cpu init
There's no need to assert there's only 1 CPU when setting them all
up here is trivial.
2022-12-25 02:10:46 -05:00
Mike Frysinger
21a0fa89d2 sim: m32r: fix iterator typo when setting up cpus
This code loops over available cpus with "c", but then looks up the
cpu with "i".  Fix the typo so the code works correctly with smp.
2022-12-25 02:10:46 -05:00
Mike Frysinger
8290c8b5dd sim: v850: fix SMP compile
The igen tool sets up the SD & CPU defines for code fragments to use,
but v850 was expecting "sd".  Change all the igen related code to use
SD so it actually compiles, and fix a few places to use "CPU" instead
of hardcoding cpu0.
2022-12-25 02:10:22 -05:00
Mike Frysinger
46ebce9b9c sim: or1k: fix iterator typo when setting up cpus
This code loops over available cpus with "c", but then looks up the
cpu with "i".  Fix the typo so the code works correctly with smp.
2022-12-25 02:09:18 -05:00
Mike Frysinger
70b920ed09 sim: mn10300: fix SMP compile
The igen tool sets up the SD define for code fragments to use, but
mn10300 was expecting "sd".  Change all the igen related code to use
SD so it actually compiles.
2022-12-25 02:09:18 -05:00
Mike Frysinger
fb74976044 sim: cpu: fix SMP msg prefix helper
This code fails to compile when SMP is enabled due to some obvious
errors.  Fix those and change the logic to avoid CPP to prevent any
future rot from creeping back in.
2022-12-25 02:09:17 -05:00
Mike Frysinger
23ddbd2f2b sim: mips: clean up a bit after mips/configure removal
Now that there is no subdir configure script, we can clean up some
logic that was spread between the files.
2022-12-24 22:13:56 -05:00
Mike Frysinger
abc494c65d sim: mips: move igen settings to top-level configure
This is the last bit of logic that exists in the mips configure
script, so move it to the top-level configure to kill it off.
We still have to move the Makefile.in igen logic to local.mk,
but this is a required first step for that.
2022-12-24 22:13:13 -05:00
Mike Frysinger
fec5386aef sim: mips: namespace igen configure vars
To prepare moving this logic to the top-level configure, the vars
need to be namespaced.  Do that here to make it easier to review.
Basically sim_xxx -> SIM_MIPS_XXX when a var is exported from the
configure script to the Makefile, and sim_xxx -> sim_mips_xxx when
the var is internal in the configure script.
2022-12-24 21:41:22 -05:00
Mike Frysinger
a449d2c294 sim: mips: add igen recursive dep
Make sure the igen tool exists before trying to compile the mips
subdir.  This happens to work when mips has a subconfigure, but
hits a race condition when that is removed.
2022-12-24 21:39:09 -05:00
Mike Frysinger
d093438bdc sim: mips: drop unused ENGINE_ISSUE_POSTFIX_HOOK
Nothing defines this, and it isn't called in all the engine runtimes,
so drop it entirely to avoid confusion.
2022-12-24 21:37:59 -05:00
Mike Frysinger
3bef0f032c sim: igen: drop move-if-changed usage
Now that igen itself has this logic, drop these custom build rules
to greatly simplify.
2022-12-24 21:35:54 -05:00
Mike Frysinger
a5f08108c1 sim: igen: support in-place updates ourself
Every file that igen outputs is then processed with the move-if-changed
shell script.  This creates a lot of boilerplate in the build and not an
insignificant amount of build-time overhead.  Move the simple "is the file
changed" logic into igen itself.
2022-12-24 21:33:24 -05:00
Mike Frysinger
5d3539bd6b sim: igen: constify itable data structures
These are const data arrays of strings and numbers.  We don't want
or need them to be writable, so mark them all const.
2022-12-24 21:30:33 -05:00
Mike Frysinger
f5e82fac07 sim: or1k: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to the existing or1k-sim.h.
Unfortunately, we can't yet drop the or1k-sim.h include from sim-main.h
as many of the generated CGEN files refer only to sim-main.h.  We'll
have to improve the CGEN interface before we can make more progress,
but this is at least a minor improvement.
2022-12-23 20:55:55 -05:00
Mike Frysinger
f51d9c6a77 sim: m32r: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to the existing m32r-sim.h.
Unfortunately, we can't yet drop the m32r-sim.h include from sim-main.h
as many of the generated CGEN files refer only to sim-main.h.  We'll
have to improve the CGEN interface before we can make more progress,
but this is at least a minor improvement.
2022-12-23 08:32:59 -05:00
Mike Frysinger
218366690f sim: bfin: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the bfin.h include and move the remaining
bfin-specific settings into it.
2022-12-23 08:32:58 -05:00
Mike Frysinger
600ddfd55a sim: m68hc11: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
12d563bbf7 sim: sh: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
7e9c749ccc sim: mcore: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
758f5a9875 sim: h8300: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
2a91447ab8 sim: pru: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the pru.h include and move the remaining
pru-specific settings into it.
2022-12-23 08:32:58 -05:00
Mike Frysinger
627bdb6394 sim: mn10300: standardize the arch-specific settings a little
Rename mn10300_sim.h to mn10300-sim.h to match other ports, and move most
of the arch-specific content out of sim-main.h to it.  This isn't a big
win though as we still have to include the header in sim-main.h due to the
igen interface: it hardcodes including sim-main.h in its files.  So until
we can fix that, we have to keep bleeding these settings into the common
codes.

Also take the opportunity to purge a lot of unused headers from these.
The local modules should already include the right headers, so there's
no need to force everyone to pull them in.  A lot of this is a hold over
from the pre-igen days of this port.
2022-12-23 08:32:58 -05:00
Mike Frysinger
7790fabeb7 sim: microblaze: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
ca6fd35084 sim: example-synacor: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
9da0101a1f sim: moxie: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
f3e1a3e6fa sim: riscv: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.

We can also move the machs.h include out since the model logic was all
generalized from compile-time to runtime last year.
2022-12-23 08:32:58 -05:00
Mike Frysinger
f625c714c2 sim: v850: standardize the arch-specific settings a little
Rename v850_sim.h to v850-sim.h to match other ports, and move most
of the arch-specific content out of sim-main.h to it.  This isn't a
big win though as we still have to include the header in sim-main.h
due to the igen interface: it hardcodes including sim-main.h in its
files.  So until we can fix that, we have to keep bleeding these
settings into the common codes.
2022-12-23 08:32:58 -05:00
Mike Frysinger
dcd1a4d15a sim: msp430: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the msp430-sim.h include and move it to
the few files that actually need it.

While we're here, drop redundant includes from sim-main.h:
* sim-config.h & sim-types.h included by sim-basics.h already
* sim-engine.h included by sim-base.h already
And move sim-options.h to the one file that needs it.
2022-12-23 08:32:58 -05:00
Mike Frysinger
84bc490d58 sim: ft32: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the ft32-sim.h include and move it to
the few files that actually need it.
2022-12-23 08:32:58 -05:00
Mike Frysinger
6960600787 sim: d10v: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the d10v_sim.h include and move it to
the few files that actually need it.

Also rename the file to standardize it a bit better with other ports.
2022-12-23 08:32:58 -05:00
Mike Frysinger
e79b75a3cf sim: cr16: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the cr16_sim.h include and move it to
the few files that actually need it.

Also rename the file to standardize it a bit better with other ports.
2022-12-23 08:32:58 -05:00
Mike Frysinger
e50840893d sim: arm: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.

The BIT override would be better in the place where it's redefined, so
move it to armdefs.h instead.
2022-12-23 08:32:58 -05:00
Mike Frysinger
e24a921d40 sim: aarch64: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.

While we're here, drop redundant includes from sim-main.h:
* sim-types.h is included by sim-base.h already
* sim-base.h is included twice
* sim-io.h is included by sim-base.h already
2022-12-23 08:32:57 -05:00
Mike Frysinger
42b68db170 sim: avr: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:57 -05:00
Mike Frysinger
110028744c sim: lm32/m32r: drop redundant opcode/cgen.h include
The xxx-desc.h header file already includes this, and it's how the
other cgen ports are getting it, so drop it from these two.
2022-12-23 00:58:40 -05:00
Mike Frysinger
10861ec94f sim: ppc: drop unused types from sim-main.h
The common sim headers should define these for us already, so there's
no need for the ppc header to set them up.
2022-12-23 00:57:32 -05:00
Mike Frysinger
3eaecff513 sim: cgen: move symcat.h include to where it's used
Move this out of the global sim-main.h and to the few files that
actually use functions from it.  Only the cgen ports were pulling
this, so this makes cgen & non-cgen behave more the same.
2022-12-23 00:52:04 -05:00
Mike Frysinger
d9e217e950 sim: cgen: move cgen-types.h include to cgen-defs.h
The cgen-types.h header sets up types that are needed by cgen-defs.h,
so move the include out of sim-main.h and to that header.  It might
be needed in other specific modules, but for now let's kick it out of
sim-main.h to make some progress.  Things still build with just this.
2022-12-23 00:51:14 -05:00
Mike Frysinger
a4c4d804d6 Revert "sim: mn10300: drop unused sim-main.c"
This reverts commit 681a422b85.

I missed that this was included via common/sim-inline.c.  I thought
I had grepped the top of the tree, but I must have only done mn10300.

Add a comment to make it clear where/how this file is used.
2022-12-23 00:22:53 -05:00
Mike Frysinger
681a422b85 sim: mn10300: drop unused sim-main.c
Nothing compiles or references this, so punt it.
2022-12-22 23:39:35 -05:00
Mike Frysinger
b15fa15bc4 sim: endian: move bfd.h from header to source
The bfd APIs are used only by sim-n-endian.h which is only included by
sim-endian.c, so move the bfd.h include there and out of sim-endian.h
which is included by many other modules.
2022-12-22 22:06:52 -05:00
Mike Frysinger
6cf3ddd23e sim: move bfd.h include out of sim-main.h
Not all arches include this in sim-main.h, and the ones that do don't
actually use bfd defines in the sim-main.h header.  Prune it to make
sim-main.h simpler so we can kill it off entirely in the future.

We add the include to the files that utilize e.g. bfd_vma though.
2022-12-22 22:06:12 -05:00
Mike Frysinger
4c337f2dd3 sim: mcore: replace custom "word" type with int32_t
This is a 32-bit architecture with 32-bit registers, so replace the
custom "word" long int typedef with an explicit int32_t.  This is
a correctness fix since long will be 64-bits on most 64-bit hosts.
2022-12-22 21:55:47 -05:00
Mike Frysinger
be2e4e6538 sim: moxie: replace custom "word" type with int32_t
This is a 32-bit architecture with 32-bit registers, so replace the
custom "word" int typedef with an explicit int32_t.  Practically
speaking, this produces the same code, but it should hopefully make
it easier to merge common code in the future.
2022-12-22 21:55:47 -05:00
Mike Frysinger
547eedc132 sim: cr16/d10v/mcore/moxie: clean up unused word & uword types
Nothing actually uses these, so punt them.  Some of the ports are
using local "word" types, but we'll clean those up in a follow up.
2022-12-22 21:55:47 -05:00