Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
Make it easy to load the common gdbinit script even when running in
the arch/ subdir instead of the top-level sim dir.
|
|
Fix a typo where the documentation refers to a function parameter by the
wrong name.
Change-Id: I99494efe62cd4aa76fb78a0bd5da438d35740ebe
|
|
Change-Id: Ifd574e38524dd4f1cf0fc003e0c5c7499abc84a0
|
|
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.
|
|
As requested by Mike.
* sim-memopt.c: Improve head comment.
|
|
Intended to be called from the debugger tool.
sim/common:
* sim-memopt.c (sim_dump_memory): New function.
|
|
2022-02-01 Ali Lown <ali.lown@imgtec.com>
Andrew Bennett <andrew.bennett@imgtec.com>
Dragan Mladjenovic <dragan.mladjenovic@rt-rk.com>
Faraz Shahbazker <fshahbazker@wavecomp.com>
sim/common/ChangeLog:
* sim-bits.h (EXTEND9, EXTEND18 ,EXTEND19, EXTEND21,
EXTEND26): New macros.
sim/mips/ChangeLog:
* Makefile.in (IGEN_INCLUDE): Add mips3264r6.igen.
* configure: Regenerate.
* configure.ac: Support mipsisa32r6 and mipsisa64r6.
(sim_engine_run): Pick simulator model from processor specified
in e_flags.
* cp1.c (value_fpr): Handle fmt_dc32.
(fp_unary, fp_binary): Zero initialize locals.
(update_fcsr, fp_classify, fp_rint, fp_r6_cmp, inner_fmac,
fp_fmac, fp_min, fp_max, fp_mina, fp_maxa, fp_fmadd, fp_fmsub):
New functions.
(sim_fpu_class_mips_mapping): New.
* cp1.h (fcsr_ABS2008_mask, fcsr_ABS2008_shift): New define.
* interp.c (MIPSR6_P): New.
(load_word): Allow unaligned memory access for MIPSR6.
* micromips.igen (sc, scd): Adapt to new do_sc* helper signature.
* mips.igen: Add *r6 models.
(signal_if_cti, forbiddenslot32): New helpers.
(delayslot32): Use signal_if_cti.
(do_sc, do_scd); Add store_ll_bit parameter.
(sc, scd): Adapt to previous change.
(nal, beq, bal): New definitions for *r6.
(sll): Split nop and ssnop cases into ...
(nop, ssnop): New definitions.
(loadstore_ea): Use the 32-bit compatibility adressing.
(cache): Split logic into ...
(do_cache): New helper.
(check_fpu): Select IEEE 754-2008 mode for R6.
(not_word_value, unpredictable, check_mt_hilo, check_mf_hilo,
check_multi_hilo, check_div_hilo, check_u64, do_dmfc1b, add,
li, addu, and, andi, bgez, bgtz, blez, bltz, bne, break, dadd,
daddiu, daddu, dror, dror32, drorv, dsll, dsll32, dsllv, dsra,
dsra32, dsrav, dsrl, dsrl32, dsub, dsubu, j, jal, jalr,
jalr.hb, lb, lbu, ld, lh, lhu, lui, lw, lwu, nor, or, ori, ror,
rorv, sb, sd, sh, sll, sllv, slt, slti, sltiu, sltu, sra, srav,
srl, srlv, sub, subu, sw, sync, syscall, teq, tge, tgeu, tlt,
tltu, tne, xor, xori, check_fmt_p, do_load_double,
do_store_double, abs.FMT, add.FMT, ceil.l.FMT, ceil.w.FMT,
cfc1, ctc1, cvt.d.FMT, cvt.l.FMT, cvt.w.FMT, div.FMT, dfmc1,
dmtc1, floor.l.FMT, floor.w.FMT, ldc1, lwc1, mfc1, mov.FMT,
mtc1, mul.FMT, recip.FMT, round.l.FMT, round.w.FMT, rsqrt.FMT,
sdc1, sqrt.FMT, sub.FMT, swc1, trunc.l.FMT, trunc.w.FMT, bc0f,
bc0fl, bc0t, bc0tl, dmfc0, dmtc0, eret, mfc0, mtc0, cop, tlbp,
tlbr, tlbwi, tlbwr): Enable on *r6 models.
* mips3264r2.igen (dext, dextm, dextu, di, dins, dinsm, dinsu,
dsbh, dshd, ei, ext, mfhc1, mthc1, ins, seb, seh, synci, rdhwr,
wsbh): Likewise.
* mips3264r6.igen: New file.
* sim-main.h (FP_formats): Add fmt_dc32.
(FORBIDDEN_SLOT): New macros.
(simFORBIDDENSLOT, FP_R6CMP_*, FP_R6CLASS_*): New defines.
(fp_r6_cmp, fp_classify, fp_rint, fp_min, fp_max, fp_mina,
fp_maxa, fp_fmadd, fp_fmsub): New declarations.
(R6Compare, Classify, RoundToIntegralExact, Min, Max, MinA,
MaxA, FusedMultiplyAdd, FusedMultiplySub): New macros. Wrapping
previous declarations.
sim/testsuite/mips/ChangeLog:
* basic.exp: Add r6-*.s tests.
(run_r6_removed_test): New function.
(run_endian_tests): New function.
* hilo-hazard-3.s: Skip for mips*r6.
* r2-fpu.s: New test.
* r6-64.s: New test.
* r6-branch.s: New test.
* r6-forbidden.s: New test.
* r6-fpu.s: New test.
* r6-llsc-dp.s: New test.
* r6-llsc-wp.s: New test.
* r6-removed.csv: New test.
* r6-removed.s: New test.
* r6.s: New test.
* utils-r6.inc: New inc.
|
|
2022-02-01 Faraz Shahbazker <fshahbazker@wavecomp.com>
sim/common/ChangeLog:
* sim-fpu.c (sim_fpu_minmax_nan): New.
(sim_fpu_max): Add variant behaviour for IEEE 754-2008.
(sim_fpu_min): Likewise.
(sim_fpu_is_un, sim_fpu_is_or): New.
(sim_fpu_un, sim_fpu_or): New.
(sim_fpu_is_ieee754_2008, sim_fpu_is_ieee754_1985): New.
(sim_fpu_set_mode): New.
(sim_fpu_classify): New.
* sim-fpu.h (sim_fpu_minmax_nan): New declaration.
(sim_fpu_un, sim_fpu_or): New declarations.
(sim_fpu_is_un, sim_fpu_is_or): New declarations.
(sim_fpu_mode): New enum.
[sim_fpu_state](current_mode): New field.
(sim_fpu_current_mode): New define.
(sim_fpu_is_ieee754_2008): New declaration.
(sim_fpu_is_ieee754_1985): New declaration.
(sim_fpu_set_mode): New declaration.
(sim_fpu_classify): New declaration.
|
|
2022-02-01 Faraz Shahbazker <fshahbazker@wavecomp.com>
sim/common/ChangeLog:
* sim-fpu.c (sim_fpu_op_nan): New.
(sim_fpu_add): Factor out NaN operand handling with
a call to sim_fpu_op_nan.
(sim_fpu_sub, sim_fpu_mul, sim_fpu_div): Likewise.
(sim_fpu_rem, sim_fpu_max, sim_fpu_min): Likewise.
* sim-fpu.h (sim_fpu_op_nan): New declaration.
|
|
IEEE754-1985 specifies the top bit of the mantissa as an indicator
of signalling vs. quiet NaN, but does not define the precise semantics.
Most architectures treat this bit as indicating quiet NaN, but legacy
(pre-R6) MIPS goes the other way and treats it as signalling NaN.
This used to be controlled by a macro that was only defined for MIPS.
This patch replaces the macro with a variable to track the current
semantics of the NaN bit and allows differentiation between older
(pre-R6) and and newer MIPS cores.
2022-02-01 Faraz Shahbazker <fshahbazker@wavecomp.com>
sim/common/ChangeLog:
* sim-fpu.c (_sim_fpu): New.
(pack_fpu, unpack_fpu): Allow reversal of quiet NaN semantics.
* sim-fpu.h (sim_fpu_state): New struct.
(_sim_fpu): New extern.
(sim_fpu_quiet_nan_inverted): New define.
sim/mips/ChangeLog:
* cp1.h (fcsr_NAN2008_mask, fcsr_NAN2008_shift): New.
* mips.igen (check_fpu): Select default quiet NaN mode
for legacy MIPS.
* sim-main.h (SIM_QUIET_NAN_NEGATED): Remove.
|
|
Drop the sim-specific unsignedXX types and move to the standard uintXX_t
types that C11 provides.
|
|
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 header shuffling in here broke the workaround for gnulib defining
"open". Move it back before the sim-specific includes to fix. This
is because the callback struct in the headers has an "open" member and
this file tries to call that.
|
|
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 implicit include deps with this to help untangle sim headers
so we can get rid of arch-specific sim-main.h.
|
|
Avoid implicit include deps with this to help untangle sim headers
so we can get rid of arch-specific sim-main.h.
|
|
Avoid implicit include deps with this to help untangle sim headers
so we can get rid of arch-specific sim-main.h.
|
|
We're including system headers after local headers in a bunch of
places, but this leads to conflicts when our local headers happen
to define symbols that show up in the system headers.
Use the more standard order of:
* config.h (via defs.h)
* system headers
* local library headers (e.g. bfd & libiberty)
* sim specific headers
|
|
Some of the core sim headers rely on the SIM_AC_OPTION_BITSIZE macro
which can change the size of core types. Since these haven't been
unified across ports, add checks to make sure they aren't accidentally
included when building for all ports. This caught the sim-load file
using poisoned headers that it didn't actually need.
|
|
Now that we've unified all the syscall tables, this file does not rely
on any port-specific settings, so move it up to building as part of the
common step so we only do it once in a multibuild.
|
|
Now that all ports have switched to target-newlib-* files, there's
no need for these files & generating things at build time. So punt
the logic and make target-newlib-syscall a hard requirement.
|
|
Like we just did for pulling out the errno map, pull out the syscall
maps into a dedicated common file. Most newlib ports are using the
same syscall map, but not all, which means we have to do a bit more
work to migrate.
This commit adds the maps and switches the ports using the common
default syscall table over to it. Ports using unique syscall tables
are still using the old targ-map.c logic.
Switching common ports over is easy by checking NL_TARGET, but the
ppc code needs a bit more cleanup here hence its larger diff.
|
|
This port was dropped from gdb/bfd/sim years ago, so stop including
its syscall constants too.
|
|
|
|
Instead of always using target_alias as a prefix on the name, use
program_transform_name instead so that the library is scoped in the
same way as the run program.
|
|
Support the same syntax as other common utilities where env vars can
be specified before the program to be run without an explicit option.
This behavior can be suppressed by using the -- marker.
|
|
Provide explicit control over the program's environment with the
basic set/unset/clear options. These are a bit clunky to use,
but they're functional.
The env set operation is split out into a separate function as it'll
be used in the next commit.
With these in place, we can adjust the custom cris testsuite to use
the now standard options and not its one-off hack.
|
|
Now that the callback framework supports argv & envp, we can move
the Blackfin implementation of these syscalls to the common code.
|
|
Now that we have access to the argv & envp strings, finish implementing
these syscalls. Delete unused variables, fix tbuf by incrementing the
pointer instead of setting to the length, and make sure we don't write
more data than the bufsize says is available.
|
|
Pass the existing strings data to the callbacks so that common
libgloss syscalls can be implemented (which we'll do shortly).
|
|
We've been passing the environment strings to sim_create_inferior,
but most ports don't do anything with them. A few will use ad-hoc
logic to stuff the stack for user-mode programs, but that's it.
Let's formalize this across the board by storing the strings in the
normal sim state. This will allow (in future commits) supporting
more functionality in the run interface, and to unify some of the
libgloss syscalls.
|
|
The new argv processing code assumed that we were always passed a
command line. If we weren't, make sure we don't crash before we
get a chance to output an error message about incorrect usage.
|
|
We default argv[0] to the program we run which is a standard *NIX
convention, but sometimes we want to be able to control the argv[0]
setting independently (especially for programs that inspect argv[0]
to change their behavior or output). Add an option to control it.
|
|
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.
|
|
Outputting an extra space broke a cris test. Change the workaround
to use %s with an empty string to avoid the compiler warning but not
output an extra space.
|
|
These are marked inline, so building w/gcc at higher optimization
levels will automatically discard them. But building with -O0 will
trigger unused function warnings, so fix that.
The common before/after cover functions in the common mloop generator
are not used by all architecture ports. Doesn't seem to be a hard
requirement, so marking them optional (i.e. unused) is fine.
The cris execute function is conditionally used depending on the
fast-build mode settings, so mark it unused too.
|
|
These rules don't depend on the target compiler settings, so hoist
the build logic up to the common builds for better parallelization.
We have to extend the genmloop.sh logic a bit to allow outputting
to a subdir since it always assumed cwd was the right place.
We leave the cgen maintainer rules in the subdirs for now as they
aren't normally run, and they rely on cgen logic that has not yet
been generalized.
|
|
The custom echo was off by one space relative to all the others.
|
|
Don't blindly cast every possible type to (long). Change to the right
printf format specifier whether it be a 64-bit type or a pointer.
|
|
This is used in a few places where it's not needed. Drop the include
to avoid the build-time generated header file as we move to drop it.
|
|
Now that the use of TARGET_xxx defines have been removed, we can move
this to the common logic so we only build it once for multi-targets.
|
|
Like we just did for pulling out the errno & signal maps, pull out the
open flag map into a dedicated common file. All newlib ports are using
the same map which makes it easy.
|
|
Code should not be using these directly, instead they should be
resolving these dynamically via the open_map. Rework the common
callback code that was using the defines to use symbolic names
instead, and localize some of the defines in the ARM code (since
it's a bit unclear how many different APIs it supports currently),
then remove the defines out of the header so no new code can rely on
them.
|
|
Like we just did for pulling out the errno map, pull out the signal
map into a dedicated common file. All newlib ports are using the
same signal map which makes it easy.
|
|
The current system maintains a list of target errno constants in the
nltvals.def file, then runs a build-time tool to turn that into a C
file. This list of errno values is the same for all arches, so we
don't need the arch-specific flexibility. Further, these are only
for newlib/libgloss environments, which makes it confusing to support
other userland runtimes (like Linux). Let's simplify to make this
easier to understand & build. We don't namespace the variables yet,
but sets up the framework for it.
Create a new target-newlib-errno.c template file. The template file
is hand written, but the inline map is still automatically generated.
This allows us to move it to the common set of objects so it's only
built once in a multi-target build.
Now we can remove the output from the gentmap build-time tool since
it's checked into the tree.
Then we stop including the errno lists in nltvals.def since nothing
uses it.
|
|
This provides a minor speedup when cleaning in a multi-target build.
|
|
Update the makefile & configure related rules to use the silent
build helpers.
|
|
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.
|
|
Add a new ECHO_STAMP helper and convert existing stamp code over
to it. This is mostly common rules and cgen mloop rules.
|