Commit Graph

3490 Commits

Author SHA1 Message Date
Mike Frysinger
5fa71a1b13 sim: sh: clean up some warnings
Mostly converting old style prototypes.  Also include a few missing
headers, and add static/casts where appropriate.
2015-03-28 17:45:31 -04:00
Mike Frysinger
02131c7ff6 sim: sh: fix broken handling in DSR reg
A missing */ caused a case statement to be incorrect masked out which
also hide an error where the wrong value was being checked.  Fix both.
2015-03-28 17:45:30 -04:00
Mike Frysinger
ed4d32c28a sim: sh: clean up gencode
The build line was missing the normal BUILD_xxx flags.  Once we added
that, we get warnings that weren't shown before.  As we fix those, we
notice that the -d option segfaults because it tries to write readonly
memory.  Fix that too as part of the const/prototype clean up.
2015-03-28 17:45:30 -04:00
Mike Frysinger
6d89786cb3 sim: sh: use common configure options
In preparation for converting to nrun, call the common functions that
are needed.  This also produces a bunch of warnings, but one thing at
a time.
2015-03-28 17:45:30 -04:00
Mike Frysinger
9943d3185a sim: avr: convert to nrun.o
Looks like a lot more work than actually was -- the main decode loop
was de-indented by dropping the loop as a step-once function.
2015-03-28 05:35:29 -04:00
Mike Frysinger
eca5fe422e sim: avr: start a basic testsuite
Just enough to know the sim isn't totally broken.
2015-03-28 04:28:46 -04:00
Jiri Gaisler
510d27512c sim/erc32: Fix a few compiler warnings 2015-03-28 03:05:35 -04:00
Jiri Gaisler
102b920e11 sim/erc32: Use memory_iread() function for instruction fetching.
Use separate memory_iread() function for instruction fetching.
Speeds up execution and allows addition of an MMU at a later stage.
2015-03-28 03:00:19 -04:00
Mike Frysinger
5831e29bc1 sim: erc32: strip paren from return statements 2015-03-28 02:57:08 -04:00
James Bowman
f46e4eb78b sim: ft32: new port
FT32 is a new high performance 32-bit RISC core developed by FTDI for
embedded applications.
2015-03-28 02:12:33 -04:00
Mike Frysinger
05f53ed611 sim: m68hc11/mips/mn10300/v850: add basic sim_pc_get
The previous profile change broke these sims that use sim-profile but
not sim-cpu (due to missing model support).  Add simple funcs until we
can convert these over properly.
2015-03-24 02:43:42 -04:00
Mike Frysinger
596f88276c sim: profile: disconnect from watchpoint core
The profile code was using STATE_WATCHPOINTS to get access to the PC, but
we already have a standard method for getting the pc, so switch to that.

This assumes that sizeof_pc is the same size as sim_cia, but we already
assume this in places by way of sim_pc_{get,set}, and this is how it's
documented in the sim-base.h API.
2015-03-24 01:24:10 -04:00
Mike Frysinger
1bf57e9a2e sim: moxie: clean up build time warnings 2015-03-24 01:14:28 -04:00
Mike Frysinger
cc8ab1ded5 sim: moxie: convert to nrun.o
This port already used a lot of common/ files, so cutting it over to
nrun.o and using a few more common objects is pretty straight forward.
2015-03-24 01:08:56 -04:00
Mike Frysinger
523ba8f92e sim: erc32/h8300/m68hc11: trim unused functions
These funcs are only used with the old run.o, and these sims use nrun.o,
so drop these stub funcs.
2015-03-24 00:48:40 -04:00
Mike Frysinger
c4a6006b2e sim: moxie: switch to common sim-command.o 2015-03-24 00:42:37 -04:00
Mike Frysinger
c0931f26e3 sim: clean up SIM_HAVE_BIENDIAN
This define only applies when using the old run.o main.  Document it as
such, and delete it from mips/sh64 since both use nrun.o now.
2015-03-24 00:39:00 -04:00
Mike Frysinger
fe83b8a8d3 sim: m32r: drop duplicate dv_sockser_install call
Since sim_module_install takes care of this for us, there's no need
to initialize the module twice.
2015-03-24 00:26:31 -04:00
Mike Frysinger
97f478c5a4 sim: Revert "Fix frv/iq2000/m32r/sh64 sim, default hardware to off."
This partially reverts commits:
	105dd264de
	3df3af7c3f
	c4892a6b37
	9e3042ec07

Now that dv-sockser is handled entirely by the common build logic, the
failure these targets were hitting isn't really possible anymore.  Lets
reset their hardware status back to defaulting to on.  Some of these
were set to "always" previously, but we don't support that anymore.
2015-03-24 00:16:42 -04:00
Mike Frysinger
30452bbe7e sim: fix sim-hardware configure option
The current default handling for the --enable-sim-hardware option ends up
forcing the value to whatever is set as the first argument when calling
the macro (by virtue of how autoconf works).  Relocate the setup code to
the 4th parameter of the AC_ARG_ENABLE macro to fix it.

This was caused by the simplification work in 1517bd2742.

Reported-by: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
2015-03-24 00:13:57 -04:00
Mike Frysinger
64dd13dfc2 sim: drop support for requiring hw support
Since no sim is using the "always" option to SIM_AC_OPTION_HARDWARE, and
we don't want to require hw support to always be enabled, drop the option.
This leads to a slight simplification in the macro too as we can collapse
the sim_hw_p variable.
2015-03-23 23:20:09 -04:00
Mike Frysinger
7722e5b802 sim: cris: delete unused CONFIG_DEVICES
Looks like unused copy & paste from other sim ports.  Drop it.
2015-03-23 23:16:40 -04:00
Mike Frysinger
4af3e7e0d3 sim: mn10300: fix duplicated hardware option
This code was calling SIM_AC_OPTION_HARDWARE twice -- we only want and
need to do it once.
2015-03-23 22:59:16 -04:00
Mike Frysinger
66b0e85dce sim: iq2000/mn10300: drop dv-sockser.o references
The common code handles this for us now automatically.
2015-03-23 22:59:13 -04:00
Mike Frysinger
c906b4b52b sim: frv: delete UART device support
This looks like copy & paste logic from the m32r port (and history
suggests this as well).  Since building with hw & device support
enabled leads to failures:
sim/frv/devices.c: In function 'device_io_read_buffer':
sim/frv/devices.c:39:15: error: 'UART_INCHAR_ADDR' undeclared (first use in this function)

Delete it entirely.  We leave device support in place as it is used
to flush the scache.
2015-03-23 21:58:12 -04:00
Nick Clifton
99067e2973 Fix thinko with previous delta to RL78 sim, by adding code to define the G10 and G13 mode options.
* cpu.c (rl78_g10_mode): Declare.
	(g13_multiply): Declare.
	* cpu.h (rl78_g10_mode): Export.
	(g13_multiply): Export.
2015-03-23 11:40:14 +00:00
Mike Frysinger
49cd1634b2 sim: dv-sockser: move build to common dir
If dv-sockser is available, lets add it to the common SIM_HW_OBJS
variable so it is always included automatically.  Now ports do not
have to shoe horn it in directly themselves.  It does mean it will
be compiled for targets that don't explicitly use it, but that's
really what we want anyways.
2015-03-23 04:40:07 -04:00
Mike Frysinger
3649cb0656 sim: dv-sockser: add stub funcs when not available
This lets ports assume that the dv-sockser API is always available if
they want to.  This way we don't have to do an abort at configure time
and it makes the resulting code a bit simpler.
2015-03-23 04:14:27 -04:00
Mike Frysinger
80fc77e6c1 sim: bfin/msp430: drop run-sim.h include
This header is used only with run.o, and both of these use nrun.o.
2015-03-23 03:37:30 -04:00
Mike Frysinger
8a863336bb sim: sh64: delete dv-sockser references
This sim doesn't actually use dv-sockser code anywhere, so drop references
to it in its build files.
2015-03-23 03:25:01 -04:00
Nick Clifton
4819f490bd Fixes implementation of hardware multiply/divide peripheral in RL78 G13 cores.
* load.c (rl78_load): If the G10, G13 or G14 flag bits are set in
	the ELF header use them to select the proper emulation mode.
	* mem.c (mem_put_byte): Use mem_put_hi to store a value into the
	MDB register.
	(mem_get_byte): Use mem_get_hi to extract a value from the MDB
	register.
2015-03-20 10:30:53 +00:00
Jiri Gaisler
b9f9ea2f5d sim/erc32: Removed type mismatch compiler warnings 2015-03-17 18:58:14 -04:00
Jiri Gaisler
638fcdad6a sim/erc32: Added -v command line switch for verbose output 2015-03-17 18:51:44 -04:00
Mike Frysinger
ba14f9419d sim: mcore/microblaze: strip trailing whitespace
No functional changes here.
2015-03-16 03:16:59 -04:00
Mike Frysinger
feb703b3f4 sim: mcore/microblaze: clean up a bit
Fix some various warnings and enable the extra warnings options.
2015-03-16 03:15:31 -04:00
Mike Frysinger
6cd5ace4db sim: convert some old prototypes 2015-03-16 03:01:09 -04:00
Mike Frysinger
ae7d0cac8c sim: rename tconfig.in to tconfig.h
Rather than manually include tconfig.h when we think we'll need it (which
is error prone as it can define symbols we expect from config.h), have it
be included directly by config.h.  Since we know we have to include that
header everywhere already, this will make sure tconfig.h isn't missed.

It should also be fine as tconfig.h is supposed to be simple and only set
up a few core defines for the target.

This allows us to stop symlinking it in place all the time and just use
it straight out of the respective source directory.
2015-03-16 01:23:52 -04:00
Jiri Gaisler
9c5f41df36 sim/erc32: use SIM_AC_OPTION_HOSTENDIAN to probe for host endianess 2015-03-16 01:16:35 -04:00
Mike Frysinger
8406bb5944 sim: dv-sockser: push module init prototype down
Pull out the duplicated dv_sockser_install prototype from the tconfig.in
files and put it in the one place it gets used -- sim-module.c.  This is
still arguably incorrect, but it's better than the status quo where the
tconfig.in has to include header files and duplicate the dv-sockser func.
The tconfig header is meant to be simple and contain a target defines.
2015-03-15 03:05:05 -04:00
Mike Frysinger
b19839da38 sim: bfin: fix signed warning
Fix the type of the local var to match the function it is passed to.
2015-03-14 20:56:39 -04:00
Mike Frysinger
1303206d7f sim: delete unused sim-inline.c rule
This dates back to the start of the repo, but has never really been used.
The sim-inline.c file has been checked in to the source, and attempts to
build it in the build tree leads to a circular dep warning from make.  It
also doesn't produce a file that is usable -- it can't be compiled.  Punt!
2015-03-14 20:56:04 -04:00
Mike Frysinger
41cc895fc8 sim: mcore/moxie: clean up makefiles a bit
Clean out stub targets and rules that get autogenerated.
2015-03-14 07:46:54 -04:00
Mike Frysinger
c1e768db52 sim: msp430: use common warnings options
This triggers a bunch of new warnings, so fix some of them.
2015-03-14 07:28:26 -04:00
Mike Frysinger
465fb143c8 sim: make nrun the default run program
We want people to stop using the run.c frontend, but it's hard to notice
when it's still set as the default.  Lets flip things so nrun.c is the
default, and users of run.c will get an error by default.  We turn that
error into a warning for existing sims so we don't break them -- this is
mostly meant for people starting new ports.
2015-03-14 07:02:58 -04:00
Mike Frysinger
5cddc23a3a sim: drop duplicate header checks
The SIM_AC_COMMON macro already checks for a bunch of headers, so specific
sim ports need not do it themselves.
2015-03-14 06:04:29 -04:00
Mike Frysinger
9312936603 sim: move sim-io.h to sim-assert.h
Since sim-endian.c doesn't actually use sim_io funcs, it's weird to
include the sim-io.h header here.  It's doing so only for the assert
header.  So lets relocate the include to the right place.
2015-03-14 03:44:58 -04:00
Mike Frysinger
6defcd57e9 sim: bfin: fix up linux-fixed-code.h generation more [PR sim/13160]
Add a trailing semi-colon to the sed print command as the BSD sed
implementation wants it.  It's a nop otherwise and works fine on
GNU/etc... implementations too.
2015-03-10 01:43:31 -04:00
Mike Frysinger
411b642274 sim: bfin: fix bug reference 2015-03-09 13:26:51 -04:00
Mike Frysinger
43fa85d9a8 sim: bfin: fix up linux-fixed-code.h generation [PR sim/10143]
The use of $< ends up picking the wrong object out of the depend
list.  Specify the input name directly to avoid fragility.

On BSD systems, we need to make sure all options come before the
non-options (i.e. the files).

Reported-by: Chris Johns <chrisj@rtems.org>
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=13160
2015-03-09 00:00:05 -04:00
Mike Frysinger
3e95021c77 sim: microblaze: fix printf string
Since sizeof returns a size_t, use %zu to display it.
2015-03-08 03:24:09 -04:00