sim: always enable modulo memory
Having this be a config option doesn't make sense: the code size is pretty much the same (as all the logic is still active), and if it's disabled, the sim throws an error if you try to use it. That means we can't break sims that weren't using it before by enabling it all the time.
This commit is contained in:
parent
8fd3fe9331
commit
cdf850e9d9
|
@ -1,3 +1,7 @@
|
||||||
|
2015-11-17 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* tconfig.h (WITH_MODULO_MEMORY): Delete.
|
||||||
|
|
||||||
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* Makefile.in (SIM_OBJS): Delete sim-reason.o, sim-reg.o, and
|
* Makefile.in (SIM_OBJS): Delete sim-reason.o, sim-reg.o, and
|
||||||
|
|
|
@ -9,7 +9,3 @@
|
||||||
|
|
||||||
/* ??? Temporary hack until model support unified. */
|
/* ??? Temporary hack until model support unified. */
|
||||||
#define SIM_HAVE_MODEL
|
#define SIM_HAVE_MODEL
|
||||||
|
|
||||||
/* Allows us to do the memory aliasing that some bfroms have:
|
|
||||||
{0xef000000 - 0xef100000} => {0xef000000 - 0xef000800} */
|
|
||||||
#define WITH_MODULO_MEMORY 1
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
2015-11-17 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* sim-main.h (WITH_MODULO_MEMORY): Delete.
|
||||||
|
* sim-core.c (new_sim_core_mapping): Always assign mask to modulo-1.
|
||||||
|
(sim_core_attach): Delete WITH_MODULO_MEMORY == 0 logic.
|
||||||
|
(sim_core_translate): Likewise.
|
||||||
|
* sim-core.h: Delete mention of WITH_MODULO_MEMORY.
|
||||||
|
|
||||||
2015-11-16 Mike Frysinger <vapier@gentoo.org>
|
2015-11-16 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* sim-close.c (__cgen_cpu_close, _cgen_cpu_close): Delete.
|
* sim-close.c (__cgen_cpu_close, _cgen_cpu_close): Delete.
|
||||||
|
|
|
@ -398,10 +398,6 @@ extern char *simulator_sysroot;
|
||||||
#define WITH_CALLBACK_MEMORY 1
|
#define WITH_CALLBACK_MEMORY 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WITH_MODULO_MEMORY
|
|
||||||
#define WITH_MODULO_MEMORY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Alignment:
|
/* Alignment:
|
||||||
|
|
|
@ -157,10 +157,7 @@ new_sim_core_mapping (SIM_DESC sd,
|
||||||
new_mapping->base = addr;
|
new_mapping->base = addr;
|
||||||
new_mapping->nr_bytes = nr_bytes;
|
new_mapping->nr_bytes = nr_bytes;
|
||||||
new_mapping->bound = addr + (nr_bytes - 1);
|
new_mapping->bound = addr + (nr_bytes - 1);
|
||||||
if (modulo == 0)
|
new_mapping->mask = modulo - 1;
|
||||||
new_mapping->mask = (unsigned) 0 - 1;
|
|
||||||
else
|
|
||||||
new_mapping->mask = modulo - 1;
|
|
||||||
new_mapping->buffer = buffer;
|
new_mapping->buffer = buffer;
|
||||||
new_mapping->free_buffer = free_buffer;
|
new_mapping->free_buffer = free_buffer;
|
||||||
new_mapping->device = device;
|
new_mapping->device = device;
|
||||||
|
@ -298,17 +295,6 @@ sim_core_attach (SIM_DESC sd,
|
||||||
if (cpu != NULL)
|
if (cpu != NULL)
|
||||||
sim_io_error (sd, "sim_core_map_attach - processor specific memory map not yet supported");
|
sim_io_error (sd, "sim_core_map_attach - processor specific memory map not yet supported");
|
||||||
|
|
||||||
/* verify modulo memory */
|
|
||||||
if (!WITH_MODULO_MEMORY && modulo != 0)
|
|
||||||
{
|
|
||||||
#if (WITH_DEVICES)
|
|
||||||
device_error (client, "sim_core_attach - internal error - modulo memory disabled");
|
|
||||||
#endif
|
|
||||||
#if (WITH_HW)
|
|
||||||
sim_hw_abort (sd, client, "sim_core_attach - internal error - modulo memory disabled");
|
|
||||||
#endif
|
|
||||||
sim_io_error (sd, "sim_core_attach - internal error - modulo memory disabled");
|
|
||||||
}
|
|
||||||
if (client != NULL && modulo != 0)
|
if (client != NULL && modulo != 0)
|
||||||
{
|
{
|
||||||
#if (WITH_DEVICES)
|
#if (WITH_DEVICES)
|
||||||
|
@ -497,12 +483,8 @@ STATIC_INLINE_SIM_CORE\
|
||||||
sim_core_translate (sim_core_mapping *mapping,
|
sim_core_translate (sim_core_mapping *mapping,
|
||||||
address_word addr)
|
address_word addr)
|
||||||
{
|
{
|
||||||
if (WITH_MODULO_MEMORY)
|
return (void *)((unsigned8 *) mapping->buffer
|
||||||
return (void *)((unsigned8 *) mapping->buffer
|
+ ((addr - mapping->base) & mapping->mask));
|
||||||
+ ((addr - mapping->base) & mapping->mask));
|
|
||||||
else
|
|
||||||
return (void *)((unsigned8 *) mapping->buffer
|
|
||||||
+ addr - mapping->base);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,10 +119,9 @@ extern SIM_RC sim_core_install (SIM_DESC sd);
|
||||||
translated into ADDRESS_SPACE:OFFSET before being passed to the
|
translated into ADDRESS_SPACE:OFFSET before being passed to the
|
||||||
client device.
|
client device.
|
||||||
|
|
||||||
MODULO - when the simulator has been configured WITH_MODULO support
|
MODULO - Specifies that accesses to the region [ADDR .. ADDR+NR_BYTES)
|
||||||
and is greater than zero, specifies that accesses to the region
|
should be mapped onto the sub region [ADDR .. ADDR+MODULO). The modulo
|
||||||
[ADDR .. ADDR+NR_BYTES) should be mapped onto the sub region [ADDR
|
value must be a power of two.
|
||||||
.. ADDR+MODULO). The modulo value must be a power of two.
|
|
||||||
|
|
||||||
DEVICE - When non NULL, indicates that this is a callback memory
|
DEVICE - When non NULL, indicates that this is a callback memory
|
||||||
space and specified device's memory callback handler should be
|
space and specified device's memory callback handler should be
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2015-11-17 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* sim-main.h (WITH_MODULO_MEMORY): Delete.
|
||||||
|
|
||||||
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
|
* Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
|
||||||
|
|
|
@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
#ifndef _SIM_MAIN_H
|
#ifndef _SIM_MAIN_H
|
||||||
#define _SIM_MAIN_H
|
#define _SIM_MAIN_H
|
||||||
|
|
||||||
#define WITH_MODULO_MEMORY 1
|
|
||||||
#define WITH_WATCHPOINTS 1
|
#define WITH_WATCHPOINTS 1
|
||||||
#define SIM_HANDLES_LMA 1
|
#define SIM_HANDLES_LMA 1
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2015-11-17 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* sim-main.h (WITH_MODULO_MEMORY): Delete.
|
||||||
|
|
||||||
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
|
* Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
|
||||||
|
|
|
@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* hobble some common features for moment */
|
/* hobble some common features for moment */
|
||||||
#define WITH_WATCHPOINTS 1
|
#define WITH_WATCHPOINTS 1
|
||||||
#define WITH_MODULO_MEMORY 1
|
|
||||||
|
|
||||||
|
|
||||||
#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
|
#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2015-11-17 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* sim-main.h (WITH_MODULO_MEMORY): Delete.
|
||||||
|
|
||||||
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
2015-11-15 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
|
* Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
/* General config options */
|
/* General config options */
|
||||||
|
|
||||||
#define WITH_CORE
|
#define WITH_CORE
|
||||||
#define WITH_MODULO_MEMORY 1
|
|
||||||
#define WITH_WATCHPOINTS 1
|
#define WITH_WATCHPOINTS 1
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue