aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2023-08-26Simplify definition of GUILETom Tromey3-6/+2
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-24sim: or1k: Eliminate dangerous RWX load segmentsStafford Horne5-8/+10
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-21sim: bpf: remove negi, neg32i insnsDavid Faust1-8/+0
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-19Placate -Wmissing-declarations in sim/crisTom Tromey1-0/+10
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-19Remove extraneous '%' from sim/cris/local.mkTom Tromey2-2/+2
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-19sim regenAlan Modra70-357/+14594
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-19sim regen preparationAlan Modra2-11/+11
Regerating sim loses commit 1be79b1ebfad from sim/lm32/cpu.h, a generated file, so this patch move those declarations to sim/lm32/sim-main.h.
2023-08-19sim --enable-cgen-maintAlan Modra9-30/+36
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-19sim prune_warningsAlan Modra1-0/+19
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-17Re: sim frv: Add a missing return value for frvbf_check_acc_range.Alan Modra1-1/+1
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-12regen configAlan Modra1-21/+52
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-09Rename bfd_bread and bfd_bwriteAlan Modra4-8/+8
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-07-31bpf: sim: do not overflow instruction immediates in testsJose E. Marchesi5-11/+11
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-26bpf: fix neg and neg32 BPF instructions in simulatorJose E. Marchesi3-7/+7
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-21sim/bpf: desCGENization of the BPF simulatorJose E. Marchesi28-11474/+1608
The BPF port in binutils has been rewritten (commit d218e7fedc74d67837d2134120917f4ac877454c) 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-04-26sim: bpf: update to new BPF relocationsJose E. Marchesi1-1/+1
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-01-18sim: info: convert verbose field to a boolMike Frysinger20-28/+28
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-18sim: unify sim-signal.o buildingMike Frysinger3-8/+14
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-18sim: v850: reduce extra header inclusion to igen filesMike Frysinger1-0/+4
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-18sim: v850: drop redundant defineMike Frysinger1-4/+0
This is already in v850/local.mk, so we can drop it from sim-main.h.
2023-01-19sim: mn10300: minimize mn10300-sim.h include in sim-main.hMark Wielaard4-0/+17
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-17sim: ppc: drop local psim linkMike Frysinger2-34/+12
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-16sim: assume sys/stat.h always exists (via gnulib)Mike Frysinger7-46/+4
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-16sim: formally assume unistd.h always exists (via gnulib)Mike Frysinger31-67/+4
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-16sim: build: stop probing system extensions (ourselves)Mike Frysinger3-189/+3
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-15sim: modules.c: fix generation after recent refactorsMike Frysinger32-0/+155
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-15sim: microblaze, mn10300: remove signal.h include in interp.cMark Wielaard2-3/+0
signal.h isn't needed in microblaze and mn10300 interp.c so don't include it.
2023-01-15sim: m32r: fix typos in stamp dependsMike Frysinger2-4/+4
Copying & pasting the first rule missed updating the dep to the right stamp file.
2023-01-15sim: igen: simplify build logic a littleMike Frysinger5-354/+275
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-14sim: build: drop depdir subdir hackMike Frysinger2-164/+0
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-14sim: common: simplify modules.c depsMike Frysinger2-9/+4
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-14sim: common: move modules.c to source trackingMike Frysinger32-195/+584
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-14sim: common: move libcommon.a dep to ppc codeMike Frysinger3-30/+34
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-14sim: build: drop most recursive build depsMike Frysinger16-173/+153
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-14sim: common: move libcommon.a objects to sourcesMike Frysinger33-251/+275
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-14sim: igen: simplify build depMike Frysinger2-156/+151
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-14sim: common: simplify hw-config.h depsMike Frysinger2-13/+9
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-14sim: build: drop AM_MAKEFLAGS settingsMike Frysinger10-185/+161
We don't have any recursive builds anymore, so we can drop this logic.
2023-01-13sim: build: delete Make-common.in logicMike Frysinger6-286/+3
Now that all (other than ppc) build in the top-level, this logic is unused, so punt it all.
2023-01-11sim: build: drop subdir Makefile.in filesMike Frysinger31-645/+0
These aren't used anymore, so punt them all.
2023-01-10sim: disable recursive make in (most) subdirsMike Frysinger4-707/+13
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-10sim: common: move test-hw-events to top-level buildMike Frysinger4-5/+17
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-10sim: move arch-specific file compilation of common/ files to top-levelMike Frysinger33-124/+137
2023-01-10sim: v850: move arch-specific file compilation to top-levelMike Frysinger2-6/+3
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-10sim: sh: move arch-specific file compilation to top-levelMike Frysinger2-6/+0
2023-01-10sim: rx: move arch-specific file compilation to top-levelMike Frysinger3-9/+3
The arch-specific flags are only used by the arch-specific modules, not the common/ files, so we can delete them too.
2023-01-10sim: rl78: move arch-specific file compilation to top-levelMike Frysinger2-6/+0
2023-01-10sim: riscv: move arch-specific file compilation to top-levelMike Frysinger2-6/+3
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-10sim: pru: move arch-specific file compilation to top-levelMike Frysinger2-6/+0
2023-01-10sim: or1k: move arch-specific file compilation to top-levelMike Frysinger2-6/+3
The arch-specific compiler flags are duplicated, but they'll be cleaned up once we move all subdir compiles to the top-level.