aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
AgeCommit message (Collapse)AuthorFilesLines
2023-10-15sim: mips: fix printf stringMike Frysinger1-1/+1
2023-01-15sim: modules.c: fix generation after recent refactorsMike Frysinger1-0/+3
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-14sim: common: move modules.c to source trackingMike Frysinger1-1/+2
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: build: drop most recursive build depsMike Frysinger1-2/+1
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-2/+2
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: build: drop AM_MAKEFLAGS settingsMike Frysinger1-1/+0
We don't have any recursive builds anymore, so we can drop this logic.
2023-01-11sim: build: drop subdir Makefile.in filesMike Frysinger1-14/+0
These aren't used anymore, so punt them all.
2023-01-10sim: move arch-specific file compilation of common/ files to top-levelMike Frysinger1-2/+2
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: build: drop support for creating libsim.a in subdirsMike Frysinger1-2/+0
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-10sim: mips: move libsim.a creation to top-levelMike Frysinger3-53/+70
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-10sim: modules: trigger generation from top-levelMike Frysinger1-0/+1
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-04sim: mips: add multi source to built sourcesMike Frysinger1-0/+4
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-02sim: build: move generated headers to built sourcesMike Frysinger1-0/+2
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-01sim: replace -I$srcroot/bfd include with -I$srcrootMike Frysinger3-4/+4
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-01sim: refresh copyright dates a bitMike Frysinger1-1/+1
Update a few files that were missed, and revert the generated Automake output that uses dates from Automake itself.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker22-22/+22
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.
2022-12-27sim: mips: hoist "multi" igen rules up to common buildsMike Frysinger3-124/+103
Since these are the last mips igen rules, we can clean up a number of bits in the local Makefile.in.
2022-12-27sim: mips: hoist "m16" igen rules up to common buildsMike Frysinger3-82/+88
2022-12-27sim: mips: hoist "single" igen rules up to common buildsMike Frysinger3-48/+52
2022-12-27sim: mips: rename "igen" generation mode to "single"Mike Frysinger2-34/+34
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-27sim: mips: hoist itable igen rules up to common buildsMike Frysinger2-35/+50
Since this rule is pretty simple, hoist it up to the common build.
2022-12-27sim: mips: unify itable generation (a bit)Mike Frysinger2-34/+22
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-27sim: mips: rename multi_flags to igen_itable_flagsMike Frysinger2-9/+9
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-27sim: mips: drop unused micromips igen logicMike Frysinger2-155/+0
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-25sim: mips: move distclean settings to common buildMike Frysinger2-4/+3
This was missed when mips/configure was merged into the top-level.
2022-12-25sim: smp: plumb igen flag down to all usersMike Frysinger2-6/+4
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-25sim: cpu: change default init to handle all cpusMike Frysinger1-1/+1
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-24sim: mips: clean up a bit after mips/configure removalMike Frysinger2-5/+3
Now that there is no subdir configure script, we can clean up some logic that was spread between the files.
2022-12-24sim: mips: move igen settings to top-level configureMike Frysinger4-3634/+278
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-24sim: mips: namespace igen configure varsMike Frysinger3-209/+218
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-24sim: mips: add igen recursive depMike Frysinger1-0/+3
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-24sim: mips: drop unused ENGINE_ISSUE_POSTFIX_HOOKMike Frysinger2-8/+0
Nothing defines this, and it isn't called in all the engine runtimes, so drop it entirely to avoid confusion.
2022-12-24sim: igen: drop move-if-changed usageMike Frysinger1-178/+83
Now that igen itself has this logic, drop these custom build rules to greatly simplify.
2022-12-22sim: move bfd.h include out of sim-main.hMike Frysinger1-1/+0
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-22sim: mips: trim redundant igen settingsMike Frysinger2-18/+0
These variables are setting the same value as the defaults. Trim this redundant logic to make it easier to see the real differences so we can try to keep unifying cases.
2022-12-22sim: mips: merge mips64* with existing multi-run buildMike Frysinger2-10/+4
Change the default (unhandled) mips64* targets to use the existing mips64 multi-run build. It already handles the formats, we just have to list the mips8000 bfd for it.
2022-12-22sim: mips: merge mips64vr5000 with existing multi-run buildMike Frysinger2-8/+2
The existing mips64vr-* multi-run build already handles mips5000 targets, so reuse that for mips64vr5* targets too. This moves more logic from build-time to runtime so we can have a single binary that supports many targets.
2022-12-22sim: mips: switch from SIM_ADDR to address_wordMike Frysinger2-31/+13
The latter type matches the address size configured for this sim. Also take the opportunity to simplify printf logic by leveraging PRI* macros.
2022-12-22sim: mips: merge mips64vr4300 with existing multi-run buildMike Frysinger2-8/+2
The existing mips64vr-* multi-run build already handles mips4300 targets, so reuse that for mips64vr43* targets too. This moves more logic from build-time to runtime so we can have a single binary that supports many targets.
2022-12-21sim: mips: match target on cpu settingsMike Frysinger2-26/+26
We don't need to enforce larger target settings when the only thing the sim should care about is the CPU target. So reduce most of the target matches to only check the CPU.
2022-12-21sim: mips: move fpu bitsize defines to top-level configureMike Frysinger5-69/+16
This drops support for the --enable-sim-float configure option, but it's not clear anyone ever actually used that. Eventually we'll want this to be a runtime option anyways.
2022-12-21sim: mips: move bitsize defines to top-level configureMike Frysinger5-97/+18
Since the msb value is always defined as the wordsize-1, stop hardcoding that value directly, and use a CPP value instead.
2022-12-21sim: mips: move subtarget defines to top-level configureMike Frysinger4-41/+35
We want to kill off mips/configure entirely. Move this small part out now to get started.
2022-12-21sim: mips: always resolve active bfd mach dynamicallyMike Frysinger3-106/+3
Don't assume that the default bfd that we configured for is the one that is always active when running a program. We already have access to the real runtime value, so use it directly. This simplifies the code quite a bit, and will make it easier to support multiple mach's in a single binary.
2022-12-21sim: build: hoist lists of hw devices upMike Frysinger2-2/+5
We need these in the top-level to generate libsim.a, but also in the subdirs to generate hw-config.h. Move it to the local.mk, and pass it down when running recursive make. This avoids duplication, and makes it available to both. We can simplify this once we move the various steps up to the top-level too.
2022-12-21sim: enable common sim_cpu usage everywhereMike Frysinger1-2/+0
All ports should be migrated now. Drop the SIM_HAVE_COMMON_SIM_CPU knob and require it be used everywhere now.
2022-12-21sim: mips: invert sim_cpu storageMike Frysinger2-73/+90
2022-11-08sim: mips: call Unpredictable instead of setting bogus values [PR sim/29276]Mike Frysinger1-2/+2
The intention of this code seems to be to indicate that this insn should not be used and produces undefined behavior, so instead of setting registers to bogus values, call Unpredictable. This fixes build warnings due to 32-bit/64-bit type conversions, and outputs a log message for users at runtime instead of silent corruption. Bug: https://sourceware.org/PR29276
2022-11-05sim: run: move linking into top-levelMike Frysinger1-0/+25
Automake will run each subdir individually before moving on to the next one. This means that the linking phase, a single threaded process, will not run in parallel with anything else. When we have to link ~32 ports, that's 32 link steps that don't take advantage of parallel systems. On my really old 4-core system, this cuts a multi-target build from ~60 sec to ~30 sec. We eventually want to move all compile+link steps to this common dir anyways, so might as well move linking now for a nice speedup. We use noinst_PROGRAMS instead of bin_PROGRAMS because we're taking care of the install ourselves rather than letting automake process it.