URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
#include <stdio.h>
|
#include <stdio.h>
|
|
|
#ifdef DEBUG
|
#ifdef DEBUG
|
#define abort() printf ("error, line %d\n", __LINE__)
|
#define abort() printf ("error, line %d\n", __LINE__)
|
#endif
|
#endif
|
|
|
int count;
|
int count;
|
|
|
void a1() { ++count; }
|
void a1() { ++count; }
|
|
|
void
|
void
|
b (unsigned short data)
|
b (unsigned short data)
|
{
|
{
|
if (data & 0x8000) a1();
|
if (data & 0x8000) a1();
|
data <<= 1;
|
data <<= 1;
|
|
|
if (data & 0x8000) a1();
|
if (data & 0x8000) a1();
|
data <<= 1;
|
data <<= 1;
|
|
|
if (data & 0x8000) a1();
|
if (data & 0x8000) a1();
|
}
|
}
|
|
|
main ()
|
main ()
|
{
|
{
|
count = 0;
|
count = 0;
|
b (0);
|
b (0);
|
if (count != 0)
|
if (count != 0)
|
abort ();
|
abort ();
|
|
|
count = 0;
|
count = 0;
|
b (0x8000);
|
b (0x8000);
|
if (count != 1)
|
if (count != 1)
|
abort ();
|
abort ();
|
|
|
count = 0;
|
count = 0;
|
b (0x4000);
|
b (0x4000);
|
if (count != 1)
|
if (count != 1)
|
abort ();
|
abort ();
|
|
|
count = 0;
|
count = 0;
|
b (0x2000);
|
b (0x2000);
|
if (count != 1)
|
if (count != 1)
|
abort ();
|
abort ();
|
|
|
count = 0;
|
count = 0;
|
b (0xc000);
|
b (0xc000);
|
if (count != 2)
|
if (count != 2)
|
abort ();
|
abort ();
|
|
|
count = 0;
|
count = 0;
|
b (0xa000);
|
b (0xa000);
|
if (count != 2)
|
if (count != 2)
|
abort ();
|
abort ();
|
|
|
count = 0;
|
count = 0;
|
b (0x6000);
|
b (0x6000);
|
if (count != 2)
|
if (count != 2)
|
abort ();
|
abort ();
|
|
|
count = 0;
|
count = 0;
|
b (0xe000);
|
b (0xe000);
|
if (count != 3)
|
if (count != 3)
|
abort ();
|
abort ();
|
|
|
#ifdef DEBUG
|
#ifdef DEBUG
|
printf ("Done.\n");
|
printf ("Done.\n");
|
#endif
|
#endif
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.