From: Mike Frysinger <vapier@gentoo.org>
To: gdb@sourceware.org
Cc: ysato@users.sourceforge.jp
Subject: h8300 sim: what is "eightbit" memory ?
Date: Wed, 17 Aug 2016 02:27:00 -0000 [thread overview]
Message-ID: <20160817022656.GG30544@vapier.lan> (raw)
[-- Attachment #1: Type: text/plain, Size: 2469 bytes --]
the h8300 sim has its own implementation for memory handling that i'd
like to replace with the common sim memory code. however, it's got a
weird bit of code it calls "eightbit mem" that makes this not as easy
as it would otherwise be. the code has this comment:
/* These define the size of main memory for the simulator.
Note the size of main memory for the H8/300H is only 256k. Keeping it
small makes the simulator run much faster and consume less memory.
The linker knows about the limited size of the simulator's main memory
on the H8/300H (via the h8300h.sc linker script). So if you change
H8300H_MSIZE, be sure to fix the linker script too.
Also note that there's a separate "eightbit" area aside from main
memory. For simplicity, the simulator assumes any data memory reference
outside of main memory refers to the eightbit area (in theory, this
can only happen when simulating H8/300H programs). We make no attempt
to catch overlapping addresses, wrapped addresses, etc etc. */
i've read the H8/300 Programming Manual and the H8/300H Software Manual
and can't find documentation on it. the closest i can find is the bits
about the exception vectors, but that sounds like a convention where the
first 256 bytes of memory are used for a special purpose. the sim will
actually allocate a sep memory buffer of 256 bytes and you address it by
accessing anywhere outside of main memory. e.g. i would expect code to
access it like:
uint32_t *data = (void *)0;
data[0] = reset_exception_vector;
not like the sim expects like:
uint8_t *data = (void *)0x1000000;
data[0] = ...;
the gcc manual doesn't have a lot to say:
Use this attribute on the H8/300, H8/300H, and H8S to indicate that the
specified variable should be placed into the eight-bit data section. The
compiler generates more efficient code for certain operations on data in
the eight-bit data area. Note the eight-bit data area is limited to 256
bytes of data.
and the gcc code implies that it's accessed via special addressing:
eightbit_data: This variable lives in the 8-bit data area and can
be referenced with 8-bit absolute memory addresses.
but the sim doesn't access its eightbit memory based on specific insns,
it does it purely on the addresses requested.
unfortunately, much of this code was authored by Michael Snyder, so i
can't ask him :(. does anyone familiar with the H8/300 have a clue as
to what's going on with this code ?
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next reply other threads:[~2016-08-17 2:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-17 2:27 Mike Frysinger [this message]
2016-08-17 5:18 ` ISHIKAWA,chiaki
2016-08-17 18:07 ` Mike Frysinger
2016-08-17 18:35 ` duane
2016-08-17 18:53 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160817022656.GG30544@vapier.lan \
--to=vapier@gentoo.org \
--cc=gdb@sourceware.org \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox