[jjohnstn@cygnus.com: Alignment checking]

Frank Ch. Eigler fche@redhat.com
Fri Feb 2 11:53:00 GMT 2001


Hi -

jjohnstn wrote, a while ago:

: Does CGEN have anything equivalent to the old sim/common way of specifying
: desired alignment (strict | nonstrict | forced).  [...]

No.  Memory address alignment has been traditionally been modelled
outside cgen (in sim & sid).


: I would like to get a memory trap when unaligned memory access occurs, but I
: would still like the memory access to go through after being fixed up.

(Isn't it self-contradictory to want *both*?  A trap by its
nature interrupts the normal flow.)

I think the simplest way to do your work would be to do
as sid's arm7f.h header does: provide a replacement
GETMEM/SETMEM* family of functions that imposes the
alignment constraints and perhaps flags violations.
If the cgen semantics for your port call only a subset
of GETMEM/SETMEM, you only need to override those.

Next time this issue comes up, we can adopt some fancy
C++-sy mixing-in scheme to reuse this code somewhat.

- FChE
-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6exAaVZbdDOm/ZT0RAlP3AJ9qsGTFB+DovXRSvjfjgg1rAf5MUACeIaI2
W4MO7h/kafBzcaeOPTVLGnw=
=bedB
-----END PGP SIGNATURE-----


More information about the Sid mailing list