Lies, Damned Lies and Benchmarks.

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
bmwtcu
Posts: 152
Joined: 01 Nov 2018, 12:02

Re: Lies, Damned Lies and Benchmarks.

Post by bmwtcu »

Nice! Where do I read about Mode 1975?
at67
Site Admin
Posts: 653
Joined: 14 May 2018, 08:29

Re: Lies, Damned Lies and Benchmarks.

Post by at67 »

bmwtcu wrote: 04 May 2022, 02:45 Nice! Where do I read about Mode 1975?
Search for 1975 in https://github.com/kervinck/gigatron-ro ... ctions.txt

And:

Line 3149: https://github.com/kervinck/gigatron-ro ... dev.asm.py

Code: Select all

xora((1975>>8)^(1975&255))      #26 Poor man\'s 1975 detection
bne(pc()+3)                     #27
bra(pc()+3)                     #28
assert videoZ == 0x0100
st([vReturn])                   #29 DISABLE video/audio/serial/etc
The code detects 1975 as the parameter to sys_SetMode and sets [vReturn] to 0; this effectively switches the bit-banger to no video, no audio, no input, etc: which allows for 521 scanlines x 200 cycles worth of uninterrupted vCPU interpretation per video frame. (which is about double the number of available vCPU cycles compared to mode3, the single scanline mode).

P.S. There are no sync signals in this mode, so your monitor loses sync until you pass -1 back to sys_SetMode.
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: Lies, Damned Lies and Benchmarks.

Post by veekoo »

Like in the OpenGL programming. You first calculate graphics in a frame and only after that you draw the frame.
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: Lies, Damned Lies and Benchmarks.

Post by veekoo »

This 1975 mode could make Mandelbrot faster. New Mandelbrot draws in 1min 17sek in fast screen mode.
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: Lies, Damned Lies and Benchmarks.

Post by veekoo »

I tested sieve 0, 1 and 2 C-programs in two screen modes. First was the videotop_v5 mode and second was zombie mode. I timed it with separate clock.
It might take time monitor to get picture after zombie mode.

sieve0 22,26sec 18,55sec
sieve1 21,22sec 17,07sec
sieve2 16,12sec 13,62sec

reference time with Z80 was 14,0sec.
lb3361
Posts: 376
Joined: 17 Feb 2021, 23:07

Re: Lies, Damned Lies and Benchmarks.

Post by lb3361 »

veekoo wrote: 27 Oct 2022, 07:34.
It might take time monitor to get picture after zombie mode.
You can instead watch the blinkenlights. When you see the pattern restart, you know that the machine has just exited zombie mode.
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: Lies, Damned Lies and Benchmarks.

Post by veekoo »

Good point. Watching the leds I counted:
sieve0 22,26sec 16,05sec -> 1,146 ratio
sieve1 21,22sec 14,55sec -> 1,039 ratio
sieve2 16,12sec 11,13sec -> 0,795 ratio
lb3361
Posts: 376
Joined: 17 Feb 2021, 23:07

Re: Lies, Damned Lies and Benchmarks.

Post by lb3361 »

The latest version of GLCC (my repo) has the standard function clock() that makes it far easier to time the code.

In fact there are several functions. The standard function clock(void) defined in <time.h> returns a clock_t which is a long. The returned value has 24 bits which wraps around after about three days. To avoid the overhead of long ints, one can use instead the function _clock(void) defined in <gigatron/libc.h> which returns an unsigned integer but wraps around after about 20 minutes. There is also a function _wait(n) that waits for n frames and returns a bit before the beginning of the vertical blank.

Anyway, timing sieve looks like:

Code: Select all

    unsigned int ticks = _clock();
    // ...compute...
    ticks = _clock() - ticks;
    printf("\n%d %d/60 seconds", ticks/60, ticks % 60);
Of course none of this works in Zombie mode.
Post Reply