Commit Graph

3340 Commits

Author SHA1 Message Date
Nick Clifton a6ff997ce8 PR 14072
* wrapper.c: Include config.h before system header files.

	* callback.c: Include config.h before system header files.
	* cgen-trace.c: Likewise.
	* cgen-utils.c: Likewise.
	* gentmap.c: Likewise.

	* sim-if.c: Include config.h before system header files.

	* compile.c: Include config.h before system header files.
	* sim-main.h: Likewise.

	* gdb-if.c: Include config.h before system header files.
	* load.c: Likewise.
	* syscalls.c: Likewise.
	* trace.c: Likewise.

	* interp.c: Include config.h before system header files.
2012-05-19 16:46:16 +00:00
Mike Frysinger 050396e533 sim: bfin: new PINT model
Newer BF54x parts feature an updated GPIO block where all the interrupt
handling is split off, so create a new model for the pin interrupts.

This is missing the port forwarding aspects, but at least the register
interface should be there.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 06:13:06 +00:00
Mike Frysinger 07c5891d6c sim: bfin: new GPIO model
Newer BF54x parts feature an updated GPIO block, so create a new
model for it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 06:11:41 +00:00
Mike Frysinger 740d60f83d sim: bfin: add shift astat tests
These are randomly generated tests to track down issues in ASTAT
handling with shift insns.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 05:59:55 +00:00
Mike Frysinger c0c463826f sim: bfin: fix ASTAT issues in immediate shifts
More ASTAT directed fixes, but this time at the dsp32shift insns.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 05:56:32 +00:00
Mike Frysinger ef0b041e05 sim: bfin: fix ASTAT/correctness issues with arithmetic shifts
This improves some of the arithmetic shifts to better match the
hardware (especially wrt ASTAT behavior).  We hit areas where
the published documentation is thin so we have to rely on tests
run on the hardware to figure out how things should behave.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 05:52:38 +00:00
Mike Frysinger e0dc84cdd4 sim: bfin: more astat tests
These are the randomly generated tests that directed some of the recent
astat related fixes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 05:24:57 +00:00
Mike Frysinger e8c9a03df0 sim: bfin: enable some parallel tests
Now that we check for valid sub-insns in parallel insns, we can
enable the tests that explicitly validate those code paths.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 04:18:56 +00:00
Mike Frysinger ab04c00066 sim: bfin: more parallel insn checks
Now that we keep track of the exact parallel insn slot we're in, we can
make sure that the current insn being decoded is valid for that slot.
This brings us much closer to the hardware in flagging invalid parallel
insn combinations.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 03:59:10 +00:00
Mike Frysinger 99265d6b00 sim: bfin: keep track of the exact position of parallel insns
Some insns need to know which slot they're in to determine whether they
are valid.  So add an enum for each slot, and check that rather than the
overall insn len.  This makes tracking things in the code much clearer.
However, this code is functionally the same, so a follow up patch will
leverage this more to properly flag invalid parallel insn combos.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 03:49:30 +00:00
Mike Frysinger 8faad9bd0f sim: bfin: unify se_all helpers more
Now that we have the se_all helpers together and working, we can see
what pieces are duplicated in each test and unify them in the common
header file.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-09 03:42:43 +00:00
Mike Frysinger a8a0e37c8b sim: bfin: drop excess space in negation insn
The amod1 helper includes a leading space so it can expand into the empty
string when need be, which means the caller need not add spacing itself.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-08 20:48:20 +00:00
Mike Frysinger ffbc20d913 sim: fix spelling typo 2012-04-02 05:21:59 +00:00
Mike Frysinger 1d18e9892e sim: bfin: throw VEC_ILGAL_I with 32bit insn in group1/group2 slots
Parallel insns can only do one 32bit, then two 16bits.  So if we see
a 2nd 32bit insn after the first 32bit in a parallel insn, abort.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-01 04:31:46 +00:00
Mike Frysinger 2fa7a0570b sim: bfin: simplify field width processing and fix build warnings
This fix the build time warning:
warning: format not a string literal, argument types not checked [-Wformat-nonliteral]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-01 04:23:40 +00:00
Mike Frysinger 02bb38cc80 sim: bfin: fix unused bfrom handling for BF535
machs.c: In function 'bfin_model_cpu_init':
machs.c:1657:1: warning: 'bfrom' may be used uninitialized
	in this function [-Wuninitialized]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-01 04:21:03 +00:00
Mike Frysinger e4967d72f9 sim: bfin: fix build warning/style with auxvt_size
Fix warning about mixing decls and code by moving auxvt_size decl
down to the scope where it is used.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-01 02:39:12 +00:00
Mike Frysinger 8d72c97073 sim: bfin: fix typo in BF54x SIC init
The current code triggers a warning:
dv-bfin_sic.c: In function 'bfin_sic_finish':
dv-bfin_sic.c:930:41: warning: operation on 'sic-><U78e8>.bf54x.iwr1'
	may be undefined [-Wsequence-point]

This points out the IWR2 register was not being setup because of a typo.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-31 18:48:20 +00:00
Mike Frysinger a4a66f7132 sim: bfin: include devices.h to fix build warnings
The place where these funcs get defined do not include the header that
declares their prototypes.  Add that to fix -Wmissing-prototypes:

devices.c:59:1: warning: no previous prototype for 'dv_bfin_mmr_invalid'
devices.c:66:1: warning: no previous prototype for 'dv_bfin_mmr_require'
devices.c:99:1: warning: no previous prototype for 'dv_bfin_mmr_check'
devices.c:159:14: warning: no previous prototype for 'dv_get_bus_num'

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-31 18:44:43 +00:00
Kevin Buettner 2aaed97917 Commit gdb and sim support for v850e2 and v850e2v3 on behalf of
Rathish C <Rathish.C@kpitcummins.com>.
2012-03-29 00:57:19 +00:00
Mike Frysinger e6ab98cd1c sim: add bugzilla marking 2012-03-27 04:18:05 +00:00
Mike Frysinger a35a332283 sim: add a proper sim_core_trans_addr prototype
The common code has a sim_core_trans_addr() helper that only the m32r code
uses.  Move the inline extern in the m32r code to the proper common header.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-26 02:18:43 +00:00
Mike Frysinger 44ac5dbe32 sim: bfin: skip .c/.S tests if no compiler is available
Similar to logic in the cris exp, attempt a simple compile and if it fails
(presumably due to the compiler being broken), skip all the related tests.
Fortunately, most tests (~600 out of ~800) are pure assembly, so people should
still get pretty good coverage.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-25 16:51:46 +00:00
Mike Frysinger 45e4eeb430 sim: bfin: disable redundant test that makes 32bit gas angry 2012-03-25 07:56:12 +00:00
Mike Frysinger 8f784a0e6a sim: bfin: fix typos in large constants in tests
Truncate constants that are larger than 32bits but get loaded into 32bit
registers.  These high bits don't get used and don't really make sense.
2012-03-25 06:43:43 +00:00
Hans-Peter Nilsson f914e38494 * nrun.c: Add #ifdef HAVE_CONFIG_H and associated includes stanza
missing in last change.
2012-03-24 09:31:09 +00:00
Mike Frysinger 2232061b1c [PATCH] sim: make sure to include strsignal prototype
Before POSIX standardized strsignal(), old systems would hide the
prototype unless the normal extension defines were enabled.  So use
the AC_USE_SYSTEM_EXTENSIONS helper for that.

Then make sure we include string.h ourselves in nrun.c rather than
relying on implicit includes via other sim headers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-24 05:38:43 +00:00
Mike Frysinger ad03ad841d sim: testsuite: regen configure after rl78 addition 2012-03-24 05:37:10 +00:00
Mike Frysinger a9c90fc78f sim: cris: update testsuite output after strsignal change 2012-03-24 05:33:42 +00:00
Mike Frysinger 8fe8b60120 sim: testsuite: regen configure after rl78 addition 2012-03-23 04:30:55 +00:00
Mike Frysinger abcee8fd25 sim: rx: fix warnings with AC_DEFINE
This lets `autoheader` work again.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-23 04:00:59 +00:00
Mike Frysinger ac0aacdffa sim: sync build_warnings handling with gdb
The sim code gets the logic for SIM_AC_OPTION_WARNINGS from gdb, but
it hasn't been updated in a good long while.  Sync with the latest
gdb code.

There is a sim specific change in here: we disable -Werror for now.
This is because all sim code atm contains warnings.  Will probably
have to slowly add a white list of targets which can tolerate this
until everyone is updated.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-23 03:27:44 +00:00
Mike Frysinger af209c380f sim: cris: update testsuite output after strsignal change 2012-03-21 04:50:01 +00:00
Mike Frysinger 5c73fae010 sim/testsuite/: split up arch-specific changelogs 2012-03-21 04:46:59 +00:00
Mike Frysinger 565904581b sim: bfin: add exhaustive parallel-insn tests 2012-03-19 05:39:45 +00:00
Mike Frysinger 5f2804c950 sim: bfin: unify se_all*opcodes tests
The current se_all*opcodes tests are very similar in how they work.
In preparation for adding more tests along these lines, unify the
common bits into a framework that others can include and build off
of easily.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-19 05:34:30 +00:00
Mike Frysinger 6aafca16ed sim: bfin: add tests for new shift behavior 2012-03-19 05:25:50 +00:00
Mike Frysinger dbe9145095 sim: bfin: add tests for new shift behavior 2012-03-19 05:17:50 +00:00
Mike Frysinger e62bb22a4b sim: bfin: fix corner case Logical shift issues
From: Robin Getz <robin.getz@analog.com>

Overflow with shift operations happens independently of saturation, but
we have the logic merged.  Extend the lshift function so that callers
can tell it when to handle each independently, and then do so when it's
needed.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-19 05:06:23 +00:00
Mike Frysinger 509deab2dc sim: use character classes rather than ranges
A-Z ranges don't work in all locales, so use character classes instead.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-19 04:54:48 +00:00
Mike Frysinger 9a5e0c494c sim: nrun: decode signal when crashing
This isn't entirely correct in that it assumes the signal numbering of
the target and host match, but seeing as we already make that assumption
in a few places, this patch doesn't make the situation any worse.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-19 03:58:36 +00:00
Mike Frysinger 026789b1f8 sim: tests: ignore generated tests 2012-03-19 03:51:09 +00:00
Mike Frysinger 8dbfaed8e2 sim: bfin: ebiu_amc: push down hardcoded base addresses
To make it easier to support ebiu banks at other addresses, move the base to
a runtime parameter rather than structure.  Future work will make this more
dynamic, but I'm waiting for more details first.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-19 03:09:20 +00:00
Mike Frysinger 191a54be54 sim: bfin: import optimizations from 32bit test into 16bit test
The 32bit allopcodes test had quite a bit of optimization added to it
so that it ran in a reasonable amount of time out of uncached memory.
Port those changes over to the 16bit test so the two share common code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-19 02:49:18 +00:00
Mike Frysinger 410bbc9498 sim: bfin: use ARRAY_SIZE
Rather than hardcode the constant, use ARRAY_SIZE to get it.  Should be no
functional changes here.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-19 01:16:25 +00:00
Mike Frysinger 51e40b125f sim: ppc: fix compilation on AIX 7.1 due to st_pad name collisions
AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively,
breaking declaration of st_pad[123] members in struct solaris_stat.
Undefine them as this is no less terrible than other solutions (like
renaming the fields and losing the binding to Solaris' names).

From: Michael Haubenwallner <haubi@s01en24.gentoo.org>
2012-03-14 05:04:18 +00:00
Mike Frysinger 84de2f06d8 sim: bfin: drop old linux/mii.h workarounds
We had some workarounds for old linux/mii.h headers, but it breaks with
newer ones.  So tweak the checks a bit to work with newer ones.  We'll
worry about older systems once someone complains.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-04 19:56:57 +00:00
Kevin Buettner d98bfeb023 Update rx sim so that it'll print load statistics. 2012-03-03 01:23:45 +00:00
Kevin Buettner f95586a44d Update sim_fetch_register, sim_store_register for sh and mn10300.
Fix compile warnings for sh built on 64-bit hosts.
2012-02-16 23:17:27 +00:00
Kevin Buettner 9058f767a5 Add support to GDB for the Renesas rl78 architecture. 2012-02-04 06:05:50 +00:00
Mike Frysinger 96cdfef033 sim: headers: use abs_srcdir to find helper scripts
Trying to run `headers` in an out-of-tree build fails atm due to the
relative srcdir paths being used in a location other than where they
were setup to be used from.  Get abs_srcdir from configure and use
that instead where applicable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-06 06:43:48 +00:00
Joel Brobecker c5a5708100 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:28:28 +00:00
Joel Brobecker 12c3e59c33 Update the copyright header of various files...
... to follow the correct syntax (according to the gospel of
gnulib's update-copyright). In other words:
  - no comma after the last year;
  - FSF spelled exactly "Free Software Foundation, Inc.", with
    the comma and the period at the end.

sim/common/ChangeLog:

	* dv-sockser.h, sim-assert.h, sim-fpu.c: Reformat the copyright
	header.

sim/m32c/ChangeLog:

	* blinky.S, gloss.S, sample.S: Reformat copyright header.

sim/mn10300/ChangeLog:

	* sim-main.h: Reformat copyright header.

sim/ppc/ChangeLog:

	* dp-bit.c: Reformat copyright header.

gdb/ChangeLog:

        * gdb/common/gdb_thread_db.h, gdb/dbxread.c, gdb/environ.c,
        gdb/gcore.h, gdb/rs6000-tdep.h, gdb/s390-nat.c, gdb/tic6x-tdep.c:
        Reformat the copyright header.

gdb/gdbserver/ChangeLog:

	* terminal.h: Reformat copyright header.

gdb/testsuite/ChangeLog:

	* dg-extract-results.sh, gdb.arch/gcore.c, gdb.arch/gdb1558.c,
	gdb.arch/i386-gnu-cfi.c, gdb.base/complex.c, gdb.base/cvexpr.c,
	gdb.base/gcore.c, gdb.base/gdb1555-main.c, gdb.base/gdb1555.c,
	gdb.base/gdb1821.c, gdb.base/long_long.c, gdb.base/restore.c,
	gdb.base/sepdebug.c, gdb.base/type-opaque-lib.c,
	gdb.base/type-opaque-main.c, gdb.cp/maint.exp, gdb.cp/namespace1.cc,
	gdb.cp/pr9631.cc, gdb.cp/psmang1.cc, gdb.cp/psmang2.cc,
	gdb.cp/try_catch.cc, gdb.cp/virtfunc.cc, gdb.hp/gdb.base-hp/reg.exp,
	gdb.mi/basics.c, gdb.mi/mi-stack.c, gdb.mi/mi-var-child.c,
	gdb.mi/mi2-var-child.exp, gdb.mi/var-cmd.c,
	gdb.threads/thread_check.c: Reformat copyright header.
2012-01-02 15:37:37 +00:00
Mike Frysinger b909d38dfa sim: erc32: fix linking against local readline on modern (ncurses) systems
The current erc32 configure script only searches for -ltermcap to provide
any termcap funcs (which readlines needs).  When building against a local
readline (which is static), we hit link failures like so:
  gcc ...-I/-D flags... -o sis \
    sis.o exec.o erc32.o func.o help.o float.o \
    ../../bfd/libbfd.a ../../opcodes/libopcodes.a \
    ../../libiberty/libiberty.a -lz -lnsl \
    ../../readline/libreadline.a -lm
  ../../readline/libreadline.a(display.o): In function 'cr':
  .../readline/display.c:2486: undefined reference to 'tputs'
  collect2: ld returned 1 exit status
  make[2]: *** [sis] Error 1

Use AC_SEARCH_LIBS from gdb's configure.ac as suggested by Joel Brobecker
to check for additional termcap providers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-31 07:06:47 +00:00
Mike Frysinger 9220438ca5 sim: cr16: add ifdefs around undefined syscalls
The cr16 libgloss port does not define these syscall numbers, so trying
to use them results in build failures [1].  The cr16 code already uses
ifdefs around a bunch of syscalls, so extend that style to cover the
ones that are currently missing.  Now we can at least compile.

[1] http://sourceware.org/ml/gdb-patches/2011-06/msg00118.html
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-30 09:12:36 +00:00
Joel Brobecker 96987c2b7f Work around Solaris bourne shell limitation when building the sim
Building the sim on a sparc-solaris 2.8 machine fails when configured
with no extra sim hardware:

> for hw in  ; do \
>         echo "extern const struct hw_descriptor
>         dv_${hw}_descriptor[];" ; \
>       done >> tmp-hw.h
> echo 'const char version[] = "'"`sed q
> /[...]/../../gdb/version.in`"'";'
> >> version.c-tmp
> /bin/sh: -c: line 1: syntax error near unexpected token `;'
> /bin/sh: -c: line 1: `for hw in  ; do \'
> make[3]: *** [hw-config.h] Error 2

The same thing happens with the version of bash that we got from
Sun as well (which is very old: 2.03.0(1)-release).

The problems comes from the fact that both shells are buggy, and
reject the following script:

    for hw in ; do
      [...]
    done

The above is what sim/common/Makefile.in tries to execute when
generating hw-config.h.

In order to allow users to build out of the box on these machines,
this patch works around this bug.  It does rely on the fact that
none of the tokens in SIM_HW contain whitespaces.

sim/common/ChangeLog:

        * Make-common.in (hw-config.h): Work around bug in Solaris 2.8
        system bourne shell.
2011-12-19 04:33:39 +00:00
Mike Frysinger cc5add8c1c sim: bfin: lookup target strings when tracing system calls
Parsing target addresses is hard if not generally useless, so use the new
cb_get_string function to lookup the associated strings as well.  Now the
trace output is quickly useful instead of just marginally so.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-03 19:05:15 +00:00
Mike Frysinger 7171232768 sim: export cb_get_string for people to use
The common sim code provides a useful "get_string" function which reads
a C string out of the target's memory space.  So rename and export it
for other people to use.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-03 18:39:43 +00:00
Mike Frysinger db2e4d67e7 sim: generate build dependencies on the fly
Lift the code that GDB is using to generate dependencies on the fly and
port it over to the sim.  Now people shouldn't have to manually maintain
these in their Makefile's.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-03 18:23:51 +00:00
Joel Brobecker c36260c737 Record Mike Frysinger as a sim Global Maintainer.
sim/ChangeLog:

	* maintainers (global maintainers): new section.  add mike
	frysinger.
2011-11-29 06:25:05 +00:00
DJ Delorie 87326c782a [sim]
* configure.tgt: Add rl78 support.
* configure: Regenerate.
* rl78: New directory.
* MAINTAINERS: Add myself as RL78 maintainer.
[gdb]
* NEWS: Mention RL78 simulator.
2011-11-29 03:49:09 +00:00
Mike Frysinger a13852d936 sim: dv-cfi: check for posix_fallocate
Some systems (like OS X) do not have posix_fallocate.  Add a configure
check for it before we try to use it.  This is less work than trying
to support old systems.

URL: http://sourceware.org/bugzilla/show_bug.cgi?id=13161
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-07 16:28:52 +00:00
Mike Frysinger 481d79819e sim: mn10300: fix typo in if check
The code looks like it should be doing a bit check, not logical.

URL: http://sourceware.org/bugzilla/show_bug.cgi?id=9302
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-07 16:26:05 +00:00
Tom Tromey c35599f82f 2011-02-11 Ben Golding <ben_golding@yahoo.co.uk>
* events.c: add #include <stdlib.h> for free(). Fix PR build/13372.
2011-11-03 15:48:17 +00:00
Mike Frysinger 4399a56be2 sim: dv-cfi: check for log2 support in libm when enabled
The dv-cfi model uses log2() internally, so make sure we automatically
link in libm when required.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-19 21:28:27 +00:00
Joel Brobecker f1a81b376a [sim]: Only print the profile info title once.
sim/common/ChangeLog:

        From John Wehle  <john@feith.com>  (tiny patch)
	* sim-profile.c (profile_info): Only print the title once.
2011-10-19 00:54:03 +00:00
Mike Frysinger 9c082ca86e sim: rename common/aclocal.m4 to common/acinclude.m4
Automake likes to dump macros automatically used into the aclocal.m4
file, but the common/aclocal.m4 naming prevents that.  So rename it
to the more normal "acinclude.m4" so the aclocal tool can work.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-18 00:31:00 +00:00
Mike Frysinger 6ffe910a7e sim: move from common.m4 to SIM_AC_COMMON
Now that the sourceware tree generally requires autoconf-2.64, update
the sim tree to require that too.

This allows us to drop the long standing SIM_AC_COMMON/common.m4
workaround as autoconf 2.64+ seems to work for me.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-18 00:17:24 +00:00
Mike Frysinger 783981cfd6 sim: testsuite: regenerate configure
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-18 00:16:14 +00:00
Tom Tromey 59c0b43d75 2011-10-14 Alexey Makhalov <makhaloff@gmail.com>
* sim-alu.h (ALU32_AND): Clear carry flag.
	(ALU32_AND): Clear carry flag.
2011-10-14 19:31:46 +00:00
Mike Frysinger 66f8d9935e sim: dv-cfi: include stdbool.h
The dv-cfi code uses the bool type but doesn't include the stdbool.h
header.  I didn't notice for Blackfin targets as the core Blackfin
header will include stdbool.h, but most targets don't do this.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-10 02:41:54 +00:00
Mike Frysinger d56a2aaedd sim: dv-cfi: include common headers only
The "devices.h" header is Blackfin-specific, so trying to build dv-cfi
for any other target fails.  Include the specific hw headers this file
needs directly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-10 02:41:07 +00:00
Mike Frysinger 4a99173dc3 sim: merge changes from common.m4 back into SIM_AC_COMMON
Seems some fixes were added to the common.m4 file but not the
SIM_AC_COMMON macro.  Keep the two in sync since they're supposed
to be the same thing.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-05 02:32:25 +00:00
Mike Frysinger 39c1f96aef sim: bfin: use store buffer for VIT_MAX insns
The VIT_MAX insns can be used in parallel, so we need to use the store
buffer so we don't clobber the output register before we get a chance
to do a memory store with it.

Reported-by: Kai Iskratsch <kai@stella.at>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-29 03:19:47 +00:00
Mike Frysinger 10915d9a18 sim: include sim-options.h for command prototype
The sim_args_command prototype is in sim-options.h, so pull it in
directly rather than assuming a common header does it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-12 20:21:28 +00:00
Mike Frysinger 6304252490 sim: fix broken skel configure.ac example
Shell code before AC_INIT will be silently culled, and since the common
aclocal.m4 includes inline shell code, the file cannot be included before
AC_INIT.  So update the example to show people including the file after
that rather than before to avoid random breakage.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-12 20:20:32 +00:00
Mike Frysinger 24a6c33d74 sim: use AC_REQUIRE with AC_PROG_CC
The autoconf guys point out that our usage of AC_PROG_CC in the
SIM_AC_COMMON does not jive with their intended use.
	http://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required

So utilize AC_REQUIRE to make the warnings go away and generate
the correct code with different autoconf versions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-12 20:19:49 +00:00
Mike Frysinger 89ab8a15e5 sim: m32c/rx: rename configure.in to match rest of the tree
The sim dir has 30 configure.ac files and 2 configure.in files.
So rename the minority to be consistent.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-11 19:00:17 +00:00
Mike Frysinger 31a27ee801 sim: m32c/rx: fix typo in copyright updating 2011-07-11 18:45:45 +00:00
Hans-Peter Nilsson ae9cd41118 * ld-insn.c (print_insn_words): For fields, print conditionals. 2011-07-08 08:37:27 +00:00
Hans-Peter Nilsson f72344f7a1 Tweak heading of last entry 2011-07-08 06:26:14 +00:00
Hans-Peter Nilsson af34255838 Correct handling of constant fields.
* gen.c (insn_field_cmp): Tweak comment about neither field
	being an insn_field_string with a cond_eq-to-value condition.
	(insns_bit_useless) <case insn_field_string, case
	decode_find_mixed>: Handle cond_eq-to-value fields as
	insn_field_int.
	* gen-idecode.c (print_idecode_validate): Handle
	insn_field_string cond-equal-to-value fields as insn_field_int.
	* gen-icache.c (print_icache_body): Add comment why constant
	string fields are handled.
2011-07-08 06:24:11 +00:00
Hans-Peter Nilsson 3faa01e34f * Makefile.in ($(SIM_MULTI_OBJ)): Depend on sim-main.h
$(SIM_EXTRA_DEPS).
2011-07-08 03:41:13 +00:00
Hans-Peter Nilsson 31b28250dc * Makefile.in (tmp-mach-multi): Exit early when igen fails. 2011-07-08 03:18:56 +00:00
Hans-Peter Nilsson 7e60d30187 Remove all #if 0'd code.
* filter.c: Remove #if 0'd function it_is.
	(main): Remove #if 0'd code.
	* gen-engine.c: Remove #if 0'd functions print_jump,
	print_jump_insn, print_jump_definition,
	print_jump_internal_function, print_jump_body.
	(gen_engine_c): Remove #if 0'd code.
	* gen-idecode.c: Remove #if 0'd functions print_jump print_jump,
	print_jump_insn, print_jump_definition,
	print_jump_internal_function, print_jump_until_stop_body.
	* gen-model.c: Remove #if 0'd functions model_c_or_h_data,
	model_c_or_h_function, gen_model_h, model_c_insn,
	model_c_function, gen_model_c and types model_c_passed_data
	and struct _model_c_passed_data.
	* gen.c: Remove #if 0'd type constant_field_types and function
	insn_field_is_constant.
	(gen_entry_find_opcode_field): Remove #if 0'd code.
	* ld-insn.c (parse_insn_model_record): Remove #if 0'd code.
	* misc.h (STRDUP, STRNDUP): Remove #if 0'd macros.
2011-07-08 02:27:18 +00:00
Hans-Peter Nilsson 26e0f8dbd8 * MAINTAINERS: Remove Thiemo Seufer. 2011-07-08 01:43:09 +00:00
Mike Frysinger 2419798b80 sim: start a unified sim_do_command
Since sim_do_command for many people simply calls sim_args_command, start
a unified version of it.  For people who handle their own options, they
could switch to this by using sim_add_option_table instead.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-05 19:06:38 +00:00
Mike Frysinger a931db6a07 sim: bfin: implement stat_map for virtual environments (libgloss)
The stat syscalls cannot work without a stat map, so declare one that
matches libgloss for virtual environments.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-01 21:53:03 +00:00
Nick Clifton 9294f12bf1 PR sim/12737
* sim/arm/iwmmxt/wcmpgt.cgs: Remove expectation of failure.
	* sim/arm/iwmmxt/wmac.cgs: Remove expectation of failure.
	* sim/arm/iwmmxt/wsra.cgs: Remove expectation of failure.
	* sim/arm/xscale/blx.cgs: Remove expectation of failure.
2011-07-01 12:15:17 +00:00
Nick Clifton 161fc45276 PR sim/12737
* iwmmxt.c (WCMPGT): Sign extend 32-bit values before performing a
	signed compare.
	(WMAC): Extend computed result before adding to result register.
	(WRSA): Sign extend 32-bit values before shifting.
2011-07-01 12:12:16 +00:00
Mike Frysinger ce2486ab20 sim: bfin: pass up result2/errcode with libgloss syscalls
Now that the Blackfin libgloss code extracts the 2nd result and the
error code from the R1/R2 registers, have the sim fill them up.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-22 04:21:29 +00:00
Nick Clifton be07a3d39e * am33.igen (sub Rm,Rn,Rd): Fix computation of carry flag. 2011-06-20 16:50:51 +00:00
Mike Frysinger 1f20b1457b sim: bfin: set ASTAT AV/AVS when shifting accumulators overflow
The LSHIFT/ASHIFT insns that work with accumulators lacked AV/AVS
handling in the ASTAT register, so add it to match the hardware.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 22:03:10 +00:00
Mike Frysinger b4876e0485 sim: bfin: do not touch ASTAT[V] when shifting accumulators
If we're shifting accumulators, we don't want to touch the V bit in
ASTAT, so add size checks to the ashiftrt/lshiftrt helpers.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 21:59:38 +00:00
Mike Frysinger d5fcd950e4 sim: bfin: do not extend accumulator in LSHIFT insns
The logical shift insn does not sign extend before shifting, so
we shouldn't either.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 21:58:08 +00:00
Mike Frysinger a56a195412 sim: bfin: tweak saturation handling with TFU/FU modes and MM bit
This too should have been squashed into an earlier change.  It covers
a few more cases in the V/VS saturation patch when working with TFU
and FU modes of dsp insns.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 21:22:50 +00:00
Mike Frysinger 90e13d65c1 sim: bfin: handle large shift values with accumulator shift insns
When the shift magnitude exceeds 32 bits, the values rotate around (since
the hardware is actually a barrel shifter).  So handle this edge case,
update the corresponding AV bit in ASTAT which was missing previously,
and tweak the AZ setting based on how the hardware behaves.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 20:59:54 +00:00
Mike Frysinger 99dcc4dc65 sim: bfin: handle odd shift values with shift insns
The shift magnitude is a 5-bit signed value.  When it is between 0 and
15, then we do the requested shift, but when it is outside of that, we
have to do the opposite.

That means we flip between lshift and ashiftrt to match the hardware.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 20:59:24 +00:00
Mike Frysinger 4bd2c0c31c sim: bfin: add tests for recent dsp fixes
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 20:27:26 +00:00
Mike Frysinger a0a71a7f8b sim: bfin: fix M_IH saturation size
This reverts the previous commit and does it right.  This change got
lost in the shuffle of patches I have pending.

Basically the logic is to change the 32bit saturation (and then masked
to 16bits) to a proper 16bit saturation.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18 20:10:57 +00:00