URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 425 |
Rev 439 |
Line 12... |
Line 12... |
#include "spr-defs.h"
|
#include "spr-defs.h"
|
|
|
#define LOOPS 64
|
#define LOOPS 64
|
#define WORD_STRIDE 8
|
#define WORD_STRIDE 8
|
|
|
|
// Memory area to test at
|
|
#define TEST_BASE 0x600000 /* 6MB */
|
|
|
unsigned long int my_lfsr;
|
unsigned long int my_lfsr;
|
|
|
unsigned long int next_rand()
|
unsigned long int next_rand()
|
{
|
{
|
Line 34... |
Line 35... |
// Not really a pass, but not really a fail, either.
|
// Not really a pass, but not really a fail, either.
|
report(0x8000000d);
|
report(0x8000000d);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
volatile char* ptr = (volatile char*) 0xe00000;
|
volatile char* ptr = (volatile char*) TEST_BASE;
|
int i;
|
int i;
|
|
|
ptr[0] = 0xab;
|
ptr[0] = 0xab;
|
|
|
ptr[4096] = 0xcd;
|
ptr[4096] = 0xcd;
|
Line 96... |
Line 97... |
// Now generate some random numbers, write them in in strides that should
|
// Now generate some random numbers, write them in in strides that should
|
// execercise the cache's line reloading/storing mechanism.
|
// execercise the cache's line reloading/storing mechanism.
|
|
|
// init LFSR
|
// init LFSR
|
my_lfsr = RAND_LFSR_SEED;
|
my_lfsr = RAND_LFSR_SEED;
|
volatile unsigned long int *lptr = (volatile unsigned long int*) 0xa00000;
|
volatile unsigned long int *lptr = (volatile unsigned long int*) TEST_BASE;
|
for(i=0;i<LOOPS;i++)
|
for(i=0;i<LOOPS;i++)
|
{
|
{
|
lptr[(i*WORD_STRIDE)-1] = next_rand();
|
lptr[(i*WORD_STRIDE)-1] = next_rand();
|
lptr[(i*WORD_STRIDE)+0] = next_rand();
|
lptr[(i*WORD_STRIDE)+0] = next_rand();
|
lptr[(i*WORD_STRIDE)+1] = next_rand();
|
lptr[(i*WORD_STRIDE)+1] = next_rand();
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.