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

Subversion Repositories eco32

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

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

powered by: WebSVN 2.1.0

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