[net.micro.amiga] Perry's memtest results on my aMEGA

vanam@pttesac.UUCP (Marnix van Ammers) (09/02/86)

I have the aMEGA board by CardCo (they have a new name now --
don't know what it is).  It is a 1 Megabyte board.

I finally ran Perry's memtest program.  I ran it 4 times
with the following results:

CHIP		FAST		DIFFERENCE
35383655	44900431	9516776	(26.89%)
35400321	44833767	9433446	(26.64%)
35400321	45000428	9600107	(27.11%)
35416986	45117109	9700123	(27.38%)

Unless I'm doing something wrong, it looks like
I'm loosing a lot more than the advertised 4% loss.
Does this mean I have one of the earlier boards which
had some kind of problem?

I ran each test by booting up and typing ^D as soon as the first
echo message appeared on the screen.  Then I'd type the program
name.  The test could only be run once after each boot.  If I tried
to run it again, the system would crash.

Has anyone had similar results?  Has anyone tried to get their
aMEGA board exchanged?

Marnix

perry@well.UUCP (Perry S. Kivolowitz) (09/02/86)

In article <274@pttesac.UUCP>, vanam@pttesac.UUCP (Marnix van Ammers) writes:
> I ran each test by booting up and typing ^D as soon as the first
> echo message appeared on the screen.  Then I'd type the program
> name.  The test could only be run once after each boot.  If I tried
> to run it again, the system would crash.


I apologize. After uploading the source to the memory speed metric, I made
some cosmetic  changes  which introduced a bug. Namely, at the exit of the
program, I free some memory which had just been free'd. 

Perry

--------------------------------------------------------------------------
#include <exec/types.h>
#include <intuition/intuition.h>
#include <exec/memory.h>

/*
**	ram-speed
**
**	Times memory performance. To be compiled under MANX.
**
**	Author:	Perry S. Kivolowitz
**
*/

extern  char			*AllocMem();
extern  struct IntuitionBase	*OpenLibrary();

struct  IntuitionBase		*IntuitionBase;

static  char *Author = "Perry S. Kivolowitz";
char    *source , *destination;
long    EndingSeconds , EndingMicroSeconds;
long    StartingSeconds , StartingMicroSeconds;

#define	BSIZE			(1L << 17)

/*
**	FreeAll
**
**	Return any allocated memory back to the system for reuse.
**
*/

FreeAll()
{
	if (source) FreeMem(source , BSIZE);
	if (destination) FreeMem(destination , BSIZE);
	/* THIS IS A NEW LINE */
	source = destination = NULL; 
}

/*
**	AllocAll
**
**	Given a type of memory specified by ``bits'' allocate BSIZE
**	bytes for a source area and a destination area.
**
*/

AllocAll(bits)
long bits;
{
	destination = AllocMem(BSIZE , bits);
	source      = AllocMem(BSIZE , bits);
	if (!source || !destination) {
		printf("Allocation of Memory Failed\n");
		Leave();
	}
}

/*
**	Leave
**
**	Clean up routine. Release memory and close Intuition.
**
*/

Leave()
{
	FreeAll();
	CloseLibrary(IntuitionBase);
	exit(0);
}

OpenIntuition()
{
	IntuitionBase = OpenLibrary("intuition.library" , 0L);
	if (!IntuitionBase) {
		printf("Could Not Open Intuition\n");
		exit(0);
	}
}

long PrintTime()
{
	long temp1 , temp2;

	temp2 = 1000000 * EndingSeconds + EndingMicroSeconds;
	temp1 = 1000000 * StartingSeconds + StartingMicroSeconds;
	temp2 = temp2 - temp1;
	printf("Elapsed Time (microseconds): %ld\n" , temp2);
	return(temp2);
}

long TimeRam(bits)
long bits;
{
	AllocAll(bits);
	CurrentTime(&StartingSeconds , &StartingMicroSeconds);
	CopyRam();
	CurrentTime(&EndingSeconds , &EndingMicroSeconds);
	FreeAll();
	return(PrintTime());
}

main()
{
	int i;
	long fast , chip;

	OpenIntuition();
	printf("Timing CHIP Memory\n");
	chip = TimeRam(MEMF_CHIP);
	printf("Timing FAST Memory\n");
	fast = TimeRam(MEMF_FAST);
	printf("Difference (microseconds): %ld\n" , fast - chip);
	Leave();
}

CopyRam()
{
	register long *src , *dst;
	register short i , j;

	for (j = 0; j < 256; j++) {
		src = (long *) source;
		dst = (long *) destination;
		i = BSIZE / 32;
		while (--i) {
#asm
			move.l	(a2)+,(a3)+
			move.l	(a2)+,(a3)+
			move.l	(a2)+,(a3)+
			move.l	(a2)+,(a3)+
			move.l	(a2)+,(a3)+
			move.l	(a2)+,(a3)+
			move.l	(a2)+,(a3)+
			move.l	(a2)+,(a3)+
#endasm
		}
	}
}