This is the mail archive of the
sid@sources.redhat.com
mailing list for the SID project.
[jjohnstn@cygnus.com: Alignment checking]
- To: sid at sources dot redhat dot com
- Subject: [jjohnstn@cygnus.com: Alignment checking]
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- Date: Fri, 2 Feb 2001 14:52:59 -0500
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
PGP signature