Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
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.
|
|
signal.h isn't needed in microblaze and mn10300 interp.c
so don't include it.
|
|
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.
|
|
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.
|
|
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.
|
|
We don't have any recursive builds anymore, so we can drop this logic.
|
|
These aren't used anymore, so punt them all.
|
|
|
|
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Now that igen itself has this logic, drop these custom build rules
to greatly simplify.
|
|
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.
|
|
This reverts commit 681a422b855e4b20086554b170dae051361f00c7.
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.
|
|
Nothing compiles or references this, so punt it.
|
|
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.
|
|
All ports should be migrated now. Drop the SIM_HAVE_COMMON_SIM_CPU
knob and require it be used everywhere now.
|
|
Currently all ports have to declare sim_cpu themselves in their
sim-main.h and then embed the common sim_cpu_base in it. This
dynamic makes it impossible to share common object code among
multiple ports because the core data structure is always different.
Let's invert this relationship: common code declares sim_cpu, and
the port uses the new arch_data field for its per-cpu state.
This is the first in a series of changes: it adds a define to select
between the old & new layouts, then converts all the ports that don't
need custom state over to the new layout. This includes mn10300 that,
while it defines custom fields in its cpu struct, never uses them.
|
|
We've been using this only to set the default word size to 32. We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
|
|
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.
|
|
These manual settings were necessary when we weren't doing automatic
header dependency tracking. That was changed a while ago, and we use
automake now to do it all for us. As a result, many of these vars
aren't even referenced anymore.
Further, some of the source file generation (e.g. .c files, or igen,
or cgen outputs) were moved to the common automake build, and it takes
care of dependency tracking for us with the object files.
|
|
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.
|
|
These functions only read from memory, so mark the pointer as const.
|
|
This was left in subdirs because of the dynamic cgen usage. However,
we can move this breakpoint call to runtime and let gdb detect whether
the symbol exists.
|
|
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.
|
|
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.
|
|
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.
|
|
Avoid use of TARGET_<syscall> defines and rely on the callback layers
to resolve these dynamically so we can support multiple syscall layers
instead of assuming the newlib/libgloss numbers all the time.
|
|
We use the program argv to both find the program to run (argv[0]) and
to hold the arguments to the program. Most of the time this is fine,
but if we want to let programs specify argv[0] independently (which is
possible in standard *NIX programs), this double duty doesn't work.
So let's split the path to the program to run out into a separate
field by itself. This simplifies the various sim_open funcs too.
By itself, this code is more of a logical cleanup than something that
is super useful. But it will open up customization of argv[0] in a
follow up commit. Split the changes to make it easier to review.
|
|
These rules don't depend on the target compiler settings, so hoist
the build logic up to the common builds for better parallelization.
We leave the mips rules in place as they depend on complicated
arch-specific configure logic that needs to be untangled first.
|
|
The void *data field is used to past arbitrary data between event
handlers, and these are using it to pass an enum. Fix up the casts
to avoid using (long) to cast to/from pointers since there is no
guarantee that's the right size.
|
|
Add a new stamp helper for quiet builds, and don't dump the command
line options when it runs. That isn't standard tool behavior, and
doesn't really seem necessary in any way.
|
|
We pretty much never care about these stamp touches, so silence them.
Also switch to using $@ when it makes sense.
|
|
Use the srcroot path and make them all silent.
|
|
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.
|
|
Move these options up to the common dir so we only test & export
them once across all ports.
The setting only affects igen based ports, and they were turning
this on by default, so keep the default in place.
|
|
The cgen scache module is enabled by every cgen port, and with the
same default value of 16k (which matches the common default value).
Let's pull this option out of the individual ports (via CPPFLAGS)
and into the common code (via config.h).
The object itself is compiled only for cgen ports atm, so that part
doesn't change. The scache code is initialized dynamically via the
modules.c logic. That's why the profile code needs an additional
CGEN_ARCH check.
This will allow us to collapse arch configure files more. Merging
the source files will require more future work, but integrating the
cgen & non-cgen worlds itself will take a lot.
|
|
This kills off another compile-time option by moving the setting to
the individual arch runtimes. This will allow dynamic selection by
the arch when doing a single build with multiple arches.
The sim_model_init rework is a little funky. In the past it was
disabled entirely if no default model was set. We maintain the
spirit of the logic by gating the fallback logic on whether the
port has defined any models.
|
|
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.
|
|
Move these options up to the common dir so we only test & export
them once across all ports.
|
|
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.
|
|
Now that we've moved all content out to the common file, this is
empty and can be deleted it entirely.
|
|
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.
|