public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed] MSP430: sim: Increase main memory region size
@ 2020-08-07 10:06 Jozef Lawrynowicz
  2020-08-07 12:32 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Jozef Lawrynowicz @ 2020-08-07 10:06 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

The area between 0xFF00 and 0xFFC0 is unallocated in the simulator
memory map, so extend the main memory region up to 0xFFC0 to allow the
simulator to make use of the extra 192 bytes of space.

Successfully regtested with the GCC DejaGNU C and C++ testsuites.

Committed as obvious.

[-- Attachment #2: 0001-MSP430-sim-Increase-main-memory-region-size.patch --]
[-- Type: text/plain, Size: 1953 bytes --]

From 4b48e6d46d7b5cf8758001aded9e74b1eca42c7d Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Mon, 3 Aug 2020 19:58:33 +0100
Subject: [PATCH] MSP430: sim: Increase main memory region size

The area between 0xFF00 and 0xFFC0 is unallocated in the simulator
memory map, so extend the main memory region up to 0xFFC0 to allow the
simulator to make use of the extra 192 bytes of space.

sim/msp430/ChangeLog:

	* msp430-sim.c (sim_open): Increase the size of the main memory region
	to 0xFAC0.
---
 sim/msp430/ChangeLog    | 5 +++++
 sim/msp430/msp430-sim.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/sim/msp430/ChangeLog b/sim/msp430/ChangeLog
index 41da2a734bd..345c804306b 100644
--- a/sim/msp430/ChangeLog
+++ b/sim/msp430/ChangeLog
@@ -1,3 +1,8 @@
+2020-08-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
+
+	* msp430-sim.c (sim_open): Increase the size of the main memory region
+	to 0xFAC0.
+
 2020-08-05  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
 
 	* msp430-sim.c (put_op): For unsigned multiplication, explicitly cast
diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c
index a330c6caf5d..7be32cb62e9 100644
--- a/sim/msp430/msp430-sim.c
+++ b/sim/msp430/msp430-sim.c
@@ -138,7 +138,7 @@ sim_open (SIM_OPEN_KIND kind,
   if (sim_core_read_buffer (sd, MSP430_CPU (sd), read_map, &c, 0x2, 1) == 0)
     sim_do_commandf (sd, "memory-region 0,0x20"); /* Needed by the GDB testsuite.  */
   if (sim_core_read_buffer (sd, MSP430_CPU (sd), read_map, &c, 0x500, 1) == 0)
-    sim_do_commandf (sd, "memory-region 0x500,0xfa00");  /* RAM and/or ROM */
+    sim_do_commandf (sd, "memory-region 0x500,0xfac0");  /* RAM and/or ROM */
   if (sim_core_read_buffer (sd, MSP430_CPU (sd), read_map, &c, 0xfffe, 1) == 0)
     sim_do_commandf (sd, "memory-region 0xffc0,0x40"); /* VECTORS.  */
   if (sim_core_read_buffer (sd, MSP430_CPU (sd), read_map, &c, 0x10000, 1) == 0)
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [committed] MSP430: sim: Increase main memory region size
  2020-08-07 10:06 [committed] MSP430: sim: Increase main memory region size Jozef Lawrynowicz
@ 2020-08-07 12:32 ` Tom Tromey
  2020-08-07 12:36   ` Jozef Lawrynowicz
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2020-08-07 12:32 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: gdb-patches

>>>>> "Jozef" == Jozef Lawrynowicz <jozef.l@mittosystems.com> writes:

I don't know much about MSP430 or the sim, but I noticed a little
oddity:

Jozef> The area between 0xFF00 and 0xFFC0 is unallocated in the simulator
Jozef> memory map, so extend the main memory region up to 0xFFC0 to allow the
Jozef> simulator to make use of the extra 192 bytes of space.

The intro text says 0xFFC0...

Jozef> +    sim_do_commandf (sd, "memory-region 0x500,0xfac0");  /* RAM and/or ROM */

... but the patch says 0xfac0.  I think one or the other should be
changed.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [committed] MSP430: sim: Increase main memory region size
  2020-08-07 12:32 ` Tom Tromey
@ 2020-08-07 12:36   ` Jozef Lawrynowicz
  2020-08-07 12:54     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Jozef Lawrynowicz @ 2020-08-07 12:36 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Hi,

On Fri, Aug 07, 2020 at 06:32:29AM -0600, Tom Tromey wrote:
> >>>>> "Jozef" == Jozef Lawrynowicz <jozef.l@mittosystems.com> writes:
> 
> I don't know much about MSP430 or the sim, but I noticed a little
> oddity:
> 
> Jozef> The area between 0xFF00 and 0xFFC0 is unallocated in the simulator
> Jozef> memory map, so extend the main memory region up to 0xFFC0 to allow the
> Jozef> simulator to make use of the extra 192 bytes of space.
> 
> The intro text says 0xFFC0...
> 
> Jozef> +    sim_do_commandf (sd, "memory-region 0x500,0xfac0");  /* RAM and/or ROM */
> 
> ... but the patch says 0xfac0.  I think one or the other should be
> changed.

The memory-region command takes an origin address and size as arguments,
in the same way a linker script memory map does.

So 0xfac0 is not the end of the region, but the size of the region, and
of course 0x500 + 0xfac0 = 0xffc0.

Thanks,
Jozef
> 
> Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [committed] MSP430: sim: Increase main memory region size
  2020-08-07 12:36   ` Jozef Lawrynowicz
@ 2020-08-07 12:54     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2020-08-07 12:54 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: Tom Tromey, gdb-patches

Jozef> The memory-region command takes an origin address and size as arguments,
Jozef> in the same way a linker script memory map does.

Jozef> So 0xfac0 is not the end of the region, but the size of the region, and
Jozef> of course 0x500 + 0xfac0 = 0xffc0.

Thanks for the explanation!  I did not know this.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-07 12:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 10:06 [committed] MSP430: sim: Increase main memory region size Jozef Lawrynowicz
2020-08-07 12:32 ` Tom Tromey
2020-08-07 12:36   ` Jozef Lawrynowicz
2020-08-07 12:54     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).