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

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [emuThor/] [source/] [clsPIC.h] - Blame information for rev 35

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 robfinch
#pragma once
2 32 robfinch
#include "stdafx.h"
3 35 robfinch
// Programmable Interrupt Controller Emulator
4
//
5
// This class emulates some of the functionality of the interrupt
6
// controller. Edge sensing on the interrupt inputs is not currently
7
// supported. The edge sensing on the clock interrupts is emulated
8
// by resetting the interrupt input when the PIC recieves the
9
// command to acknowledge the edge sensitive interrupt and only
10
// driving the interrupt signal true by the timer. The timers
11
// effectively act like pulse generators which provide only a
12
// positive transition to the clock signal. The negative 
13
// transition is supplied when the interrupt is acknowledged.
14
// In the real system the clock generator provides a square wave
15
// output for the interrupts so edge sensing is necessary.
16
// It's faked out so that from the perspective of the BIOS
17
// software it looks the same.
18 30 robfinch
 
19 32 robfinch
extern clsSystem system1;
20 30 robfinch
 
21
class clsPIC : public clsDevice
22
{
23 32 robfinch
public:
24 30 robfinch
        bool enables[16];
25 35 robfinch
        bool edges[16];         // edge sensitive
26 30 robfinch
        bool irq30Hz;
27
        bool irq1024Hz;
28
        bool irqKeyboard;
29 32 robfinch
        bool irqUart;
30
        bool irq;
31
        bool nmi;
32 30 robfinch
        unsigned int vecno;
33
        clsPIC(void);
34
        void Reset();
35
        bool IsSelected(unsigned int ad) {
36
                return ((ad & 0xFFFFFFC0)==0xFFDC0FC0);
37
        };
38 32 robfinch
        unsigned int Read(unsigned int ad);
39
        void Write(unsigned int ad, unsigned int dat, unsigned int mask);
40
        void Step(void);
41 30 robfinch
};
42
 

powered by: WebSVN 2.1.0

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