This is the mail archive of the sid@sources.redhat.com mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[jjohnstn@cygnus.com: Alignment checking]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]