OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [peripheral/] [test.c] - Diff between revs 970 and 1350

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);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.