URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 349 |
Rev 393 |
Line 1... |
Line 1... |
|
#ifndef _OR1200_UTILS_H_
|
|
#define _OR1200_UTILS_H_
|
|
|
|
/* Register access macros */
|
|
#define REG8(add) *((volatile unsigned char *)(add))
|
|
#define REG16(add) *((volatile unsigned short *)(add))
|
|
#define REG32(add) *((volatile unsigned long *)(add))
|
|
|
|
/*
|
|
* l.nop constants
|
|
*
|
|
*/
|
|
#define NOP_NOP 0x0000 /* Normal nop instruction */
|
|
#define NOP_EXIT 0x0001 /* End of simulation */
|
|
#define NOP_REPORT 0x0002 /* Simple report */
|
|
#define NOP_PRINTF 0x0003 /* Simprintf instruction */
|
|
#define NOP_PUTC 0x0004 /* Simulation putc instruction */
|
|
#define NOP_REPORT_FIRST 0x0400 /* Report with number */
|
|
#define NOP_REPORT_LAST 0x03ff /* Report with number */
|
|
|
|
/* For writing into SPR. */
|
|
void mtspr(unsigned long spr, unsigned long value);
|
|
|
|
/* For reading SPR. */
|
|
unsigned long mfspr(unsigned long spr);
|
|
|
|
/* Print out a character via simulator */
|
|
void sim_putc(unsigned char c);
|
|
|
|
/* Prints out a value */
|
|
void report(unsigned long value);
|
|
|
|
/* Loops/exits simulation */
|
|
void exit(int i);
|
|
|
|
/* Variable keeping track of timer ticks */
|
|
extern unsigned long timer_ticks;
|
|
/* Enable tick timer and interrupt generation */
|
|
void enable_timer(void);
|
|
/* Disable tick timer and interrupt generation */
|
|
void disable_timer(void);
|
|
/* Timer increment - called by interrupt routine */
|
|
void timer_tick(void);
|
|
/* Reset tick counter */
|
|
void clear_timer_ticks(void);
|
|
/* Get tick counter */
|
|
unsigned long get_timer_ticks(void);
|
|
/* Wait for 10ms */
|
|
void wait_10ms(void);
|
|
|
|
#endif
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.