URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 970 |
Rev 1350 |
Line 1... |
Line 1... |
#include <stdio.h>
|
#include <stdio.h>
|
|
|
|
#include "config.h"
|
|
|
|
#ifdef HAVE_INTTYPES_H
|
|
#include <inttypes.h>
|
|
#endif
|
|
|
|
#include "port.h"
|
|
#include "arch.h"
|
#include "sim-config.h"
|
#include "sim-config.h"
|
#include "abstract.h"
|
#include "abstract.h"
|
#include "except.h"
|
#include "except.h"
|
|
|
unsigned long array[128];
|
uint32_t array[128];
|
|
|
/* Test write */
|
/* Test write */
|
void test_write32 (unsigned long addr, unsigned long value)
|
void test_write32 (oraddr_t addr, uint32_t value)
|
{
|
{
|
if (addr & 0x00000080)
|
if (addr & 0x00000080)
|
array[addr & 0x7f] = value;
|
array[addr & 0x7f] = value;
|
else
|
else
|
except_handle(EXCEPT_BUSERR, cur_vadd);
|
except_handle(EXCEPT_BUSERR, cur_vadd);
|
}
|
}
|
|
|
/* Test read */
|
/* Test read */
|
unsigned long test_read32 (unsigned long addr)
|
uint32_t test_read32 (oraddr_t addr)
|
{
|
{
|
if (addr & 0x00000080)
|
if (addr & 0x00000080)
|
return ~array[addr & 0x7f];
|
return ~array[addr & 0x7f];
|
else
|
else
|
except_handle(EXCEPT_BUSERR, cur_vadd);
|
except_handle(EXCEPT_BUSERR, cur_vadd);
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.