Success info

Juergen Buchmueller pullmoll at
Sat Jun 16 23:32:30 PDT 2007

On Fri, 15 Jun 2007 22:34:09 +0200
Juergen Buchmueller <pullmoll at> wrote:

Just a success info for this idea:

> It may be easier and faster to call the state machine from the CPU, than to
> always re-insert a timer event into the chain. And it may even be desirable
> to keep the events locked onto the CPU cycles to some degree. It doesn't
> work for the unload_word(), because 794ns doesn't divide well into 170ns :-P

This works fine for me and is really easier and faster than doing it with
the overhead of inserting, firing and removing a timer.

On every CPU cycle I count down a variable dsp_count, and when becomes
less than zero, I call a slightly modified:
	int display_state_machine(int arg);
that returns the next instead of inserting a timer with next as arg.

if (--dsp_count < 0) {
	dsp_state = display_state_machine(dsp_state);
	dsp_count = 7;

Make sure to also do this for cycles when a memory read or write stalls.

dsp_state is initially set to 020 in the CPU reset function, dsp_count is
set to 0 (it starts on the very first cycle).

More information about the Altogether-devel mailing list