aboutsummaryrefslogtreecommitdiff
path: root/sim/Makefile.in
AgeCommit message (Collapse)AuthorFilesLines
2024-01-01sim: ppc: merge misc igen APIsMike Frysinger1-6/+9
The common igen code provides the same misc APIs as the ppc version, so delete the ppc code and pull in the common one. There is one minor difference: the ppc code has a unique dumpf function. The common code switched to lf_printf for the same functionality, but since that requires changes throughout the igen codebase, delay that cleanup for now so we can merge the rest.
2024-01-01sim: ppc: unify igen filter_filename implementationsMike Frysinger1-7/+4
Now that both igen implementations are in the top-level, we can unify the filter_filename implementation between them since they're the same (literally the same code).
2024-01-01sim: ppc: hoist igen compilation into top-levelMike Frysinger1-93/+261
This simplifies the build a bit (especially for deps in port subdirs), and avoids recursive make. This in turn speeds up the build, and lets us reuse existing build-time vs host-time logic from Makefile.am.
2024-01-01sim: igen: remove libigen.a when cleaningMike Frysinger1-6/+6
2023-12-23sim: warnings: rework individual flag disable into dedicated varsMike Frysinger1-4/+5
The -Wshadow=local is too new for some compilers, so move it to a var that we test at configure time.
2023-12-22sim: cris: disable -Wshadow=local in generated mloop filesMike Frysinger1-1/+3
The mloop files include CGEN generated switch files which have some nested assignments that expand into repeated shadowed variables. Fixing this looks fairly non-trivial as it appears to be interplay between the common CGEN code and how this particular set of cris insns are defined. Disable the warning instead. In file included from sim/cris/mloop.in:286: sim/cris/semcrisv10f-switch.c: In function ‘crisv10f_engine_run_full’: sim/cris/semcrisv10f-switch.c:12383:8: error: declaration of ‘opval’ shadows a previous local [-Werror=shadow=local] 12383 | SI opval = tmp_addr; | ^~~~~ sim/cris/semcrisv10f-switch.c:12371:9: note: shadowed declaration is here 12371 | USI opval = ({ SI tmp_addr; | ^~~~~ And the code looks like: USI opval = ({ ... { SI opval = tmp_addr; ... } ... }); Since the CGEN code treats "opval" as an internal variable that the cpu definitions don't have direct access to, the likelihood of this being a real bug is low, so leave it be. The warning is suppressed for more code that is hand written (e.g. the mloop logic), but disabling for the entire file is the easiest way to suppress while keeping it on everywhere else in the sim.
2023-12-21sim: common: add $LINENO rewriting support to genmloop scriptsMike Frysinger1-2/+4
The generated mloop files can trigger compile time warnings. It can be difficult to see/understand where the original code is coming from as all the diagnostics point to the generated output. Using #line pragmas, we can point people to the original source files. Unfortunately, this code is written in POSIX shell, and that lacks support for line number tracking. The $LINENO variable, even when available, can just be plain wrong. For example, when using dash and subshells, $LINENO can end up having negative values. Add a wrapper script that will uses awk to rewrite the $LINENO variable to the right value to avoid all that. Basically lineno.sh takes an input script, rewrites all uses of $LINENO into the actual line number (and $0 into the original file name), and then executes the temporary script. This commit doesn't actually add #line pragmas to any files. That comes next.
2023-12-20sim: cgen: unify the genmloop logic a bitMike Frysinger1-36/+32
Pull out the common parts of the genmloop invocation into the common code. This will make it easier to add more, and make the per-port differences a little more obvious.
2023-12-19sim: frv: enable warnings in memory.cMike Frysinger1-1/+0
Fix one minor pointer-sign warning to enable warnings in general for this file. Reading the data as signed and then returning it as unsigned should be functionally the same in this case.
2023-12-14sim: m32r: fix mloop.in variant stamp depsMike Frysinger1-2/+2
The migration to local.mk in commit 0a129eb19a773d930d60b084209570f663db2053 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-07sim: cris: fix -Wunused-but-set-variable warningsMike Frysinger1-0/+2
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-07sim: m32r: add more cgen prototypes to enable -Werror in most filesMike Frysinger1-11/+0
2023-12-04sim: warnings: enable only for development buildsMike Frysinger1-0/+1
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-08-26Simplify definition of GUILETom Tromey1-1/+1
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-19Remove extraneous '%' from sim/cris/local.mkTom Tromey1-1/+1
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 --enable-cgen-maintAlan Modra1-15/+15
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-07-21sim/bpf: desCGENization of the BPF simulatorJose E. Marchesi1-220/+129
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-01-18sim: unify sim-signal.o buildingMike Frysinger1-6/+11
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-17sim: ppc: drop local psim linkMike Frysinger1-30/+11
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-15sim: modules.c: fix generation after recent refactorsMike Frysinger1-0/+62
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: m32r: fix typos in stamp dependsMike Frysinger1-2/+2
Copying & pasting the first rule missed updating the dep to the right stamp file.
2023-01-15sim: igen: simplify build logic a littleMike Frysinger1-296/+268
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: common: simplify modules.c depsMike Frysinger1-5/+3
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 Frysinger1-161/+519
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 Frysinger1-25/+28
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 Frysinger1-143/+138
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 Frysinger1-189/+212
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 Frysinger1-152/+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 Frysinger1-10/+8
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 Frysinger1-173/+161
We don't have any recursive builds anymore, so we can drop this logic.
2023-01-13sim: build: delete Make-common.in logicMike Frysinger1-4/+0
Now that all (other than ppc) build in the top-level, this logic is unused, so punt it all.
2023-01-10sim: disable recursive make in (most) subdirsMike Frysinger1-87/+10
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 Frysinger1-0/+6
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 Frysinger1-62/+67
2023-01-10sim: v850: move arch-specific file compilation to top-levelMike Frysinger1-3/+1
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 Frysinger1-3/+0
2023-01-10sim: rx: move arch-specific file compilation to top-levelMike Frysinger1-3/+1
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 Frysinger1-3/+0
2023-01-10sim: riscv: move arch-specific file compilation to top-levelMike Frysinger1-3/+1
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 Frysinger1-3/+0
2023-01-10sim: or1k: move arch-specific file compilation to top-levelMike Frysinger1-3/+1
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: msp430: move arch-specific file compilation to top-levelMike Frysinger1-3/+0
2023-01-10sim: moxie: move arch-specific file compilation to top-levelMike Frysinger1-3/+1
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: mn10300: move arch-specific file compilation to top-levelMike Frysinger1-3/+4
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: mips: move arch-specific file compilation to top-levelMike Frysinger1-3/+5
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: microblaze: move arch-specific file compilation to top-levelMike Frysinger1-3/+0
2023-01-10sim: mcore: move arch-specific file compilation to top-levelMike Frysinger1-3/+0
2023-01-10sim: m68hc11: move arch-specific file compilation to top-levelMike Frysinger1-3/+6
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: m32r: move arch-specific file compilation to top-levelMike Frysinger1-3/+12
2023-01-10sim: m32c: move arch-specific file compilation to top-levelMike Frysinger1-3/+1
The arch-specific flags are only used by the arch-specific modules, not the common/ files, so we can delete them too.