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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [sim/] [cpu.h] - Blame information for rev 9

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 hellwig
/*
2
 * cpu.h -- CPU simulation
3
 */
4
 
5
 
6
#ifndef _CPU_H_
7
#define _CPU_H_
8
 
9
 
10
#define IRQ_TIMER       14              /* timer interrupt */
11
#define IRQ_DISK        8               /* disk interrupt */
12
#define IRQ_KEYBOARD    4               /* keyboard interrupt */
13
#define IRQ_TERM_1_RCVR 3               /* terminal 1 receiver interrupt */
14
#define IRQ_TERM_1_XMTR 2               /* terminal 1 transmitter interrupt */
15
#define IRQ_TERM_0_RCVR 1               /* terminal 0 receiver interrupt */
16
#define IRQ_TERM_0_XMTR 0                /* terminal 0 transmitter interrupt */
17
 
18
#define PSW_V           0x08000000      /* interrupt vector bit in PSW */
19
#define PSW_UM          0x04000000      /* user mode enable bit in PSW */
20
#define PSW_PUM         0x02000000      /* previous value of PSW_UM */
21
#define PSW_OUM         0x01000000      /* old value of PSW_UM */
22
#define PSW_IE          0x00800000      /* interrupt enable bit in PSW */
23
#define PSW_PIE         0x00400000      /* previous value of PSW_IE */
24
#define PSW_OIE         0x00200000      /* old value of PSW_IE */
25
#define PSW_PRIO_MASK   0x001F0000      /* bits to encode IRQ prio in PSW */
26
#define PSW_PRIO_SHFT   16              /* shift count to reach these bits */
27
#define PSW_IRQ_MASK    0x0000FFFF      /* IRQ mask bits */
28
 
29
 
30
Word cpuGetPC(void);
31
void cpuSetPC(Word addr);
32
 
33
Word cpuGetReg(int regnum);
34
void cpuSetReg(int regnum, Word value);
35
 
36
Word cpuGetPSW(void);
37
void cpuSetPSW(Word value);
38
 
39
Word cpuGetIRQ(void);
40
 
41
Bool cpuTestBreak(void);
42
Word cpuGetBreak(void);
43
void cpuSetBreak(Word addr);
44
void cpuResetBreak(void);
45
 
46
Word cpuGetTotal(void);
47
 
48
void cpuStep(void);
49
void cpuRun(void);
50
void cpuHalt(void);
51
 
52
void cpuSetInterrupt(int priority);
53
void cpuResetInterrupt(int priority);
54
 
55
void cpuReset(void);
56
void cpuInit(Word initialPC);
57
void cpuExit(void);
58
 
59
 
60
#endif /* _CPU_H_ */

powered by: WebSVN 2.1.0

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