gnupic: Re: [gnupic] gpsim --"invalid file register" error


Previous by date: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy
Next by date: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy
Previous in thread: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy
Next in thread: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy

Subject: Re: [gnupic] gpsim --"invalid file register" error
From: "Scott Dattalo" ####@####.####
Date: 5 Feb 2007 14:34:55 +0000
Message-Id: <61817.71.139.21.208.1170686047.squirrel@ruckus.brouhaha.com>

On Mon, 2007-02-05 at 13:22 +0000, Ralph Corderoy wrote:

> I'm happy with the existing .assert mechanism that exists.
>
> > However, it might be possible to write macros that allow one to
> > automatically check the bank selection.
> >
> > For example, it'd be cool if there was a macro:
> >
> >     mCheck_Bank MyVariable
> >
> > When placed in the assembly source, this would add simulator
> > assertions that validated the bank bits match those for the bank in
> > which MyVariable resides.
>
> If it did this on every MyVariable access then that would be handy,
> otherwise it's just a macro short-hand that I need to sprinkle
> throughout the source, cluttering it up.

Hi Ralph,

The only problem with having the simulator insert automatic bank checking
assertions on every register is that you'll need a mechanism to inhibit
it. For example, a few PIC families have registers that are aliased in
multiple banks. Interrupt routines or utility functions often use this
area for their variables so that the banking can be ignored. Or in some
cases, programmers will intentionally declare variables in multiple banks
such that they're effectively aliased. For these cases it will be
necessary to either put more logic into the automatic bank checking code.
For the hardware aliased registers, one could argue that the simulator
already has the information it needs.

Another argument is efficiency. I know this is a weak argument, but the
assertion checking stuff takes simulation time. gpsim is really efficient
right now in accessing registers from the simulated ram. Introducing
assertions will easily make the access an order of magnitude slower.
Depending on code being simulated, the overall simulation time could be
affected by as much as a factor of 2!

I'm sure we could debate the relative merits of implicit versus explicit
bank checking. I tend to prefer explicit because it emphasizes intent.
However, if implicit bank checking is not too obtrusive, or at least can
be easily inhibited, then I'd accept that.

Scott

Previous by date: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy
Next by date: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy
Previous in thread: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy
Next in thread: 5 Feb 2007 14:34:55 +0000 Re: [gnupic] gpsim --"invalid file register" error, Ralph Corderoy


Powered by ezmlm-browse 0.20.