gnupic: gpsim logging writes to IO ports


Previous by date: 9 Feb 2003 11:34:50 -0000 gpsim logging writes to IO ports, Alex Holden
Next by date: 9 Feb 2003 11:34:50 -0000 Re: gpsim logging writes to IO ports, Scott Dattalo
Previous in thread: 9 Feb 2003 11:34:50 -0000 gpsim logging writes to IO ports, Alex Holden
Next in thread: 9 Feb 2003 11:34:50 -0000 Re: gpsim logging writes to IO ports, Scott Dattalo

Subject: Re: gpsim logging writes to IO ports
From: Alex Holden ####@####.####
Date: 9 Feb 2003 11:34:50 -0000
Message-Id: <1044789900.18091.22.camel@hyperspace.local>

On Sat, 2003-02-08 at 22:42, Alex Holden wrote:
> I've just been messing about with the CVS version of gpsim, and I tried
> to use the log facility to log all writes to an IO port, but it didn't
> log anything at all. Telling it to log writes to an ordinary memory
> register instead worked as expected. Is this a bug, and if so how would
> I go about fixing it?

Doh, after poring over the gpsim source code for an hour I realised that
it was working all along. Two things confused me into thinking it wasn't
working when actually it was:

* There are two symbols defined for the 12c509, gpio (ioport 0) and GPIO
(constant 0x06), and only the upper case one works.
* gpsim.log is backed by quite a large buffer so it typically remains
empty until you do a "log off" or quit gpsim. It worked when I set it to
log writes to a loop counter variable because it generated so many
writes that it flushed the buffer almost straight away.

Now I'm attempting to write a module with very little experience of
coding in C++. I don't suppose anyone's written a "subtitles for the
hard of thinking" guide to writing gpsim modules have they? I want my
module to be able to:

* Watch the state of some digital input pins, and read the cycle counter
when they change.
* Get called every "n" processor simulation cycles (or getting called
once every cycle would do) to do some background simulation work, and be
able to read the processor cycle counter from here also.
* Control the state of some digital output pins from the background
simulation.
* Write data to the log (Ok, the module itself could open a file and log
to it, but it'd be nicer to use the Gpsim log facility).
* Get notified when the processor has been reset so I can also reset my
simulation.

-- 
------------ Alex Holden - http://www.linuxhacker.org ------------
If it doesn't work, you're not hitting it with a big enough hammer




Previous by date: 9 Feb 2003 11:34:50 -0000 gpsim logging writes to IO ports, Alex Holden
Next by date: 9 Feb 2003 11:34:50 -0000 Re: gpsim logging writes to IO ports, Scott Dattalo
Previous in thread: 9 Feb 2003 11:34:50 -0000 gpsim logging writes to IO ports, Alex Holden
Next in thread: 9 Feb 2003 11:34:50 -0000 Re: gpsim logging writes to IO ports, Scott Dattalo


Powered by ezmlm-browse 0.20.