FPGA Implementation of Interrupt Controller (8259) by Using Verilog HDL
FPGA Implementation of Interrupt Controller (8259) by Using Verilog HDL
FPGA Implementation of Interrupt Controller (8259) by Using Verilog HDL
6, June 2012
Bekkam Satheesh
M.Tech, VLSI Department of ECE,VNR VJIET Hyderabad, India
N. Dhanalakshmi
Associate Professor Department of ECE,VNR VJIET Hyderabad, India
ABSTRACT
A Priority Interrupt Controller is a hardware designed chip which acts as an overall system manager to efficiently handle the multiple interrupts that tend to occur from the varied number of peripheral devices. Hence, it relieves the systems CPU from the task of polling in a multilevel priority system. This paper deals with implementation of a Priority Interrupt Controller using Verilog language. During the implementation, the Verilog code has been written for all the internal registers of the Priority Interrupt Controller so that it can accomplish its task of prioritizing the various interrupts and thereby increasing the efficiency of the processor. In this paper the entire functional block was sub divided into various modules like vector address module, command register module, mask register module and finally it was integrated into a single unit to accomplish specified tasks. In the present work the Priority Interrupt Controller was made to operate in three different modes-Fully Nested Mode, Rotating Priority Mode, and Special Mask Mode.
2. IMPLEMENTATION
The Priority Interrupt Controller 82C59A is divided into various modules like Vector Address Module, Mask Register Sub module, Mask Register Module, Command Register Module, Interrupt Modes Module. All the codes of the modules are integrated using a Top Module and waveforms for various modes - Fully Nested Mode, Rotating Priority Mode, and Special Mask Mode have been obtained. The powerful features of the 82C59A in a microcomputer system are its programmability and the interrupt routine addressing capability. The latter allows direct or indirect jumping to the specified interrupt routine requested without any polling of the interrupting devices. The normal sequence of events during an interrupt depends on the type of CPU being used.
Keywords
FPGA, Fully Nested Mode, Interrupt Controller, Rotating Priority Mode, Special Mask Mode.
1. INTRODUCTION
The Programmable Interrupt Controller functions as an overall manager in an Interrupt-Driven system. It accept requests from the peripheral equipment, determines which of the incoming requests is of the highest priority, ascertains whether the incoming request has a higher priority value than the level currently being serviced, and issues an interrupt to the CPU based on this determination. Each peripheral device or structure usually has a special program or routine that is associated with its specific functional or operational requirements; this is referred to as a service routine. The Priority Interrupt Controller, after issuing an interrupt to the CPU, must some how input information into the CPU that can point the Program Counter to the service routine associa ted with the requesting device. This pointer is an address in a vectoring table and is referred to as vectoring data. This Priority Interrupt Controller is a device specifically designed for use in real time, interrupt driven microcomputer systems. It manages eight levels of requests and has built-in features for expandability to other 82C59As that is up to 64 levels. It is programmed by system software as an I/O peripheral. A selection of priority modes is available to the programmer so that the manner in which the requests are processed by the Priority Interrupt Controller (82C59A) can be configured to match system requirements. The priority modes can be changed or reconfigured dynamically at any time during main program operation.
RdN WrN A0 CsN SP/E IR0 N IR1 IR2 IR3 IR4 IR5 IR6 IR7
Data Bus[7:0]
TOP MODULE
INT INTA_N
12
International Journal of Computer Applications (0975 888) Volume 48 No.6, June 2012 Table 1: Signal description of Priority Interrupt Controller (82C59A) S.No Signal Mode Description This is also an active low 1 CsN Input signal, which controls the enabling and disabling of the 82C59A. A low on this signal enables the 82C59A to 2 RdN Input send the status of the IRR, IMR, ISR and Interrupt Level A low on this signal 3 WrN Input enables the CPU to write control words to the 82C59A This is used in conjunction with WrN and RdN signals to write commands into the 4 A0 Input various command registers, as well as various status registers of the 82C59A 5 SP/EN Input 6 7 8 9 10 11 12 13 IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7 DataBus [7:0] INT Input Input Input Input Input Input Input Input Control, Status, Interrupt Vector information is transferred through this bidirectional bus. This is the Interrupt signal to the CPU This is an Acknowledgement signal for the Interrupt Request to the CPU by 82C59A. These seven signals are the Interrupt Requests from the seven devices connected
LSBAddr [7:0]
14
InOut
15
Input
16
INTA_N
Output
13
International Journal of Computer Applications (0975 888) Volume 48 No.6, June 2012
Rst CsN RdN Wr A0 N INTA_ DataBus[7: N 0] IMR[7:0] ISR[7:0] IRR[7:0] LSBAddr[7:0] COMMAND REGISTER MODULE
LSBAddr[7:0]
Input
This provides the second vector byte to be transferred to the CPU. These four outputs provide the Initialization command words, which are written into the 82C59A. These three outputs provide the Operation command words, which are written into the 82C59A.
ICW1-ICW4
Output
10
OCW1 to OCW3
Output
14
International Journal of Computer Applications (0975 888) Volume 48 No.6, June 2012 5 6 IR [7:0] IMR [7:0] Input Output These are Interrupt Requests to the 82C59A This provides the interrupt request lines, which are masked.
15
International Journal of Computer Applications (0975 888) Volume 48 No.6, June 2012
16
International Journal of Computer Applications (0975 888) Volume 48 No.6, June 2012
Fig 10: Output Waveform for TOP MODULE (Automatic Rotate Mode) II
Fig 10: Output Waveform for TOP module (Automatic Rotate Mode) - I
17
International Journal of Computer Applications (0975 888) Volume 48 No.6, June 2012
Fig 11: Output Waveform for TOP MODULE (Specific Rotation Mode) -II
Fig 12: Output Waveform for TOP MODULE (Fully Nested Mode) - I
18
International Journal of Computer Applications (0975 888) Volume 48 No.6, June 2012
INT OUTPUT
Fig 12: Output Waveform for FPGA implementation of the priority interrupt Controller 82C59A
4. CONCLUSION
This Priority Interrupt Controller is a device specifically designed for use in real time, interrupt driven microcomputer systems. It manages eight levels of requests and has built-in features for expandability to other 82C59As that is up to 64 levels. This Priority Interrupt Controller is implemented by using SPATRAN-3 Xilinx FPGA. From the results, the performance of the respective logics was verified with the assumptions that were taken into account when creating the logic. Hence, this work has been demonstrated the principles for designing a Priority Interrupt Controller-82C59A to meet the worst-case timing specifications
5. REFERENCES
[1]. William Stallings, Computer Organization, 7th Edition, Free Press, 2002. [2]. Brown, Ralf/Kyle and Jim Paperback, PC Interrupts 8259, 2nd edition, Addison-Wesley, 2006. [3]. Joe McGovern, Interrupt Driven PC System Design, 4th edition, Prentice Hall of India, 2003. [4].Charles H. Roth, Digital Systems Design, 4th edition, Jr. PWS Publishing House, 1998. [5]. Douglas J Smith, HDL Chip Design, Doone Publications ,3rd Edition,1996. [6]. Samir Palnithkar Verilog HDL, Prentice Hall PTR Publishers, 2nd edition, 2003. [7].Donald E Thamas, The Verilog hardware description language, Kluwer Academic publishers,5th Edition, 2002.
19