summaryrefslogtreecommitdiff
path: root/sim/rx
Commit message (Collapse)AuthorAgeFilesLines
* sim: info: convert verbose field to a boolMike Frysinger2023-01-181-1/+1
| | | | | | | 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.
* sim: formally assume unistd.h always exists (via gnulib)Mike Frysinger2023-01-161-2/+0
| | | | | | | 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.
* sim: modules.c: fix generation after recent refactorsMike Frysinger2023-01-151-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.
* sim: common: move modules.c to source trackingMike Frysinger2023-01-141-2/+3
| | | | | | 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.
* sim: common: move libcommon.a objects to sourcesMike Frysinger2023-01-141-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.
* sim: build: drop subdir Makefile.in filesMike Frysinger2023-01-111-22/+0
| | | | These aren't used anymore, so punt them all.
* sim: move arch-specific file compilation of common/ files to top-levelMike Frysinger2023-01-101-2/+2
|
* sim: rx: move arch-specific file compilation to top-levelMike Frysinger2023-01-102-6/+2
| | | | | The arch-specific flags are only used by the arch-specific modules, not the common/ files, so we can delete them too.
* sim: build: drop support for creating libsim.a in subdirsMike Frysinger2023-01-101-3/+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.
* sim: rx: move libsim.a creation to top-levelMike Frysinger2023-01-102-17/+26
| | | | | | | | | | | 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.
* sim: replace -I$srcroot/bfd include with -I$srcrootMike Frysinger2023-01-011-1/+1
| | | | | | 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.
* Update copyright year range in header of all files managed by GDBJoel Brobecker2023-01-0122-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.
* sim: move bfd.h include out of sim-main.hMike Frysinger2022-12-221-0/+1
| | | | | | | | 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.
* sim: switch sim_{read,write} APIs to 64-bit all the time [PR sim/7504]Mike Frysinger2022-12-221-4/+4
| | | | | | | | | | | | | | We've been using SIM_ADDR which has always been 32-bit. This means the upper 32-bit address range in 64-bit sims is inaccessible. Use 64-bit addresses all the time since we want the APIs to be stable regardless of the active arch backend (which can be 32 or 64-bit). The length is also 64-bit because it's completely feasible to have a program that is larger than 4 GiB in size/image/runtime. Forcing the caller to manually chunk those accesses up into 4 GiB at a time doesn't seem useful to anyone. Bug: https://sourceware.org/PR7504
* sim: move register headers into sim/ namespace [PR sim/29869]Mike Frysinger2022-12-201-1/+1
| | | | | | | These headers define the register numbers for each port to implement the sim_fetch_register & sim_store_register interfaces. While gdb uses these, the APIs are part of the sim, not gdb. Move the headers out of the gdb/ include namespace and into sim/ instead.
* sim: build: respect AM_MAKEFLAGS when entering subdirsMike Frysinger2022-11-061-1/+1
| | | | | This doesn't matter right now, but it will as we add more flags to the recursive make step to pass state down.
* sim: run: move linking into top-levelMike Frysinger2022-11-051-0/+13
| | | | | | | | | | | | | 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.
* sim: rx: drop unused $arch settingMike Frysinger2022-11-041-2/+0
| | | | This is only needed for CGEN ports which RX isn't, so drop it.
* sim: m32c/rx: drop useless $(ENDLIST)Mike Frysinger2022-11-041-5/+2
| | | | | | This is used to allow for dangling \ in object lists, but these are the only ports that do it, and it isn't really necessary. Punt it to keep the various makefiles harmonized.
* sim: common: change sim_{fetch,store}_register helpers to use void* buffersMike Frysinger2022-11-021-2/+2
| | | | | | | When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
* sim: reg: constify store helperMike Frysinger2022-10-311-1/+1
| | | | These functions only read from memory, so mark the pointer as const.
* sim: constify various integer readersMike Frysinger2022-10-311-2/+2
| | | | These functions only read from memory, so mark the pointer as const.
* sim: common: change sim_read & sim_write to use void* buffersMike Frysinger2022-10-311-4/+6
| | | | | | | When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
* Don't use BFD_VMA_FMT in gdb and simAlan Modra2022-08-061-6/+8
| | | | | | | Like commit b82817674f, this replaces BFD_VMA_FMT "x" in sim/ with PRIx64 and casts to promote bfd_vma to uint64_t. The one file using BFD_VMA_FMT in gdb/ instead now uses hex_string, and a typo in the warning message is fixed.
* sim: fix BFD_VMA format arguments on 32-bit hosts [PR gdb/29184]Sergei Trofimovich2022-06-151-2/+2
| | | | | | | | | | | | | | | | | Noticed format mismatch when attempted to build gdb on i686-linux-gnu in --enable-64-bit-bfd mode: sim/../../sim/cris/sim-if.c:576:28: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'bfd_size_type' {aka 'long long unsigned int'} [-Werror=format=] 576 | sim_do_commandf (sd, "memory region 0x%" BFD_VMA_FMT "x,0x%lx", | ^~~~~~~~~~~~~~~~~~~ 577 | interp_load_addr, interpsiz); | ~~~~~~~~~ | | | bfd_size_type {aka long long unsigned int} While at it fixed format string for time-related types.
* sim: remove use of PTRAlan Modra2022-05-131-1/+1
| | | | | | | PTR will soon disappear from ansidecl.h. Remove uses in sim. Where a PTR cast is used in assignment or function args to a void* I've simply removed the unnecessary (in C) cast rather than replacing with (void *).
* sim: fixes for libopcodes styled disassemblerAndrew Burgess2022-04-041-1/+13
| | | | | | | | | | | | | | | | | | In commit: commit 60a3da00bd5407f07d64dff82a4dae98230dfaac Date: Sat Jan 22 11:38:18 2022 +0000 objdump/opcodes: add syntax highlighting to disassembler output I broke several sim/ targets by forgetting to update their uses of the libopcodes disassembler to take account of the new styled printing. These should all be fixed by this commit. I've not tried to add actual styled output to the simulator traces, instead, the styled print routines just ignore the style and print the output unstyled.
* sim: tweak copyright lines for gnulib update-copyrightMike Frysinger2022-01-011-1/+1
| | | | | | The regex it uses does not like so many leading spaces which causes it to think the files lack copyright. Trim them down so the script can find & update them accordingly.
* Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker2022-01-0121-21/+21
| | | | | | | | This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
* sim: use ## for automake commentsMike Frysinger2021-12-091-16/+16
| | | | | | The ## marker tells automake to not include the comment in its generated output, so use that in most places where the comment only makes sense in the inputs.
* sim: iq2000/lm32/m32c/moxie/rx: switch to new target-newlib-syscall.hMike Frysinger2021-11-281-10/+10
| | | | | | | | | Use the new target-newlib-syscall.h to provide the target syscall defines. These code paths are written specifically for the newlib ABI rather than being generalized, so switching them to the defines rather than trying to go through the dynamic callback conversion seems like the best trade-off for now. Might have to reconsider this in the future.
* sim: install various doc filesMike Frysinger2021-11-191-0/+19
|
* sim: arm/bfin/rx: undefine page size from system headersMike Frysinger2021-11-061-0/+2
| | | | | | Some targets (like cygwin) will export page size defines that clash with our local usage here. Undefine the system one to fix building for these targets.
* sim: rename ChangeLog files to ChangeLog-2021Mike Frysinger2021-08-171-0/+0
| | | | | | | | | | | | | | Now that ChangeLog entries are no longer used for sim patches, this commit renames all relevant sim ChangeLog to ChangeLog-2021, similar to what we would do in the context of the "Start of New Year" procedure. The purpose of this change is to avoid people merging ChangeLog entries by mistake when applying existing commits that they are currently working on. Also throw in a .gitignore entry to keep people from adding new ChangeLog files anywhere in the sim tree.
* sim: rx: merge with common configure scriptMike Frysinger2021-06-225-2939/+16
| | | | | Move the unique configure flag to acinclude.m4 so the common code can include it, then delete the rx configure logic entirely.
* sim: drop configure scripts for simple portsMike Frysinger2021-06-222-0/+11
| | | | | | | | | These ports only use the pieces that have been unified, so we can merge them into the common configure script and get rid of their unique one entirely. We still compile & link separate run programs, and have dedicated subdir Makefiles, but the configure script portion is merged.
* sim: unify hardware settingsMike Frysinger2021-06-213-49/+5
| | | | | Move these options up to the common dir so we only test & export them once across all ports.
* sim: hw: rework configure option & device selectionMike Frysinger2021-06-212-38/+30
| | | | | | | | | | | | | | | | The sim-hardware configure option allows builders to select a set of device models to enable. But this seems like unnecessary overkill: the existence of individual device models doesn't affect performance at all as they are only enabled at runtime if the config uses them, and individually these are all <5KB a piece. Stripping off a total of ~50KB from a ~1MB binary doesn't seem useful, and it's extremely unlikely anyone will ever bother. So let's simplify the configure/make logic by turning sim-hardware into a boolean option like many of the other sim options. Any ports that have unique device models will declare them in their Makefile instead of at configure time. This will allow us to (eventually) unify the setting into the common dir.
* sim: rx: scope the unique configure flagMike Frysinger2021-06-204-22/+34
| | | | | This will make it possible to merge into the common configure by making sure we never collide with other arches.
* sim: delete SIM_AC_COMMON macroMike Frysinger2021-06-204-5/+5
| | | | | Now that we've moved all content out to the common file, this is empty and can be deleted it entirely.
* sim: unify general maintainer settingsMike Frysinger2021-06-202-124/+0
| | | | | | | Move these options up to the common dir so we only test & export them once across all ports. This takes a page from the cgen maint logic to make $(MAINT) work for non-automake Makefiles which will allow us to merge it together.
* sim: move sim-inline to the common codeMike Frysinger2021-06-203-36/+5
| | | | | This will allow us to build the common code with the same inline settings as the arch subdirs, and only do the test once.
* sim: unify gettext/intl probing logicMike Frysinger2021-06-192-85/+0
| | | | | Move these options up to the common dir so we only test & export them once across all ports.
* sim: unify toolchain dependency logicMike Frysinger2021-06-192-1109/+1
| | | | | The common dir is already probing this info since it's using automake, so pass it down to the subdirs so they don't have to probe it at all.
* sim: unify toolchain probing logicMike Frysinger2021-06-192-1360/+26
| | | | | Move these options up to the common dir so we only test & export them once across all ports.
* sim: unify bfd library dependency testing logicMike Frysinger2021-06-193-7691/+6
| | | | | Move these options up to the common dir so we only test & export them once across all ports.
* sim: unify various library testing logicMike Frysinger2021-06-192-141/+6
| | | | | Move these options up to the common dir so we only test & export them once across all ports.
* sim: unify -Werror build settingsMike Frysinger2021-06-183-112/+6
| | | | | | Move these options up to the common dir so we only test & export them once across all ports. It also enables -Werror usage on the common files we've been pulling out of arch subdirs.
* sim: move -Werror disabling to MakefileMike Frysinger2021-06-182-5/+8
| | | | | | For the ports that still don't build with -Werror, rather than disable the flag at configure time, do it at make time. This will allow us to unify these tests in the common sim configure script.
* sim: overhaul & unify endian settings managementMike Frysinger2021-06-172-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, the arch is expected to support both, and the value will be probed based on the user runtime options or the input program. Only two arches today set the default value (bpf & mips). We can probably let this go as it only shows up in one scenario: the sim is invoked, but with no inputs, and no user endian selection. This means bpf will not behave like the other arches: an error is shown and forces the user to make a choice. If an input program is used though, we'll still switch the default to that. This allows us to remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting. For the ports that set a "wire" endian, move it to the runtime init of the respective sim_open calls. This allows us to change the WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting if they want to force a specific endianness. With all the endian logic moved to runtime selection, we can move the configure call up to the common dir so we only process it once across all ports. The ppc arch was picking the wire endian based on the target used, but since we weren't doing that for other biendian arches, we can let this go too. We'll rely on the input selecting the endian, or make the user decide.