SlideShare uma empresa Scribd logo
1 de 4
Baixar para ler offline
International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5




 Implementation of Register Files in the Processor of Hard Real Time
                   Systems for Context Switching
 1
     Prof. B Abdul Rahim, 2 Mr. S.Narayana Raju, 3 Mr. M M Venkateswara Rao
                               1
                                Head, Dept. Of ECE AITS, Rajampet, kadapa (Dist.), A.P, India
                           2
                            M.Tech (Embedded Systems), NECT, Hyderabad, RR (dist.), A.P, India
                          3
                            M.Tech (Embedded Systems), AITS, Rajampet, kadapa (Dist.), A.P, India




Abstract
Embedded Real Time applications use multi threading           Commonly called threads and a kernel that coordinates
to share of real time application. The advantage of           their execution. A thread is an executing Instance of an
multi-threading include greater throughput, more              Application and its context is the contents of the
efficient CPU use, Better system reliability improved         processor registers and program counter at any point of
performance on multiprocessor computer.                       time. A scheduler, a part of the Real Time operating
 Real time systems like Flight control systems require        System’s kernel, schedules threads execution based
very precise timing; multi threading itself becomes an        upon their priority. Context switching function can be
overhead cost mainly due to context switching of the          described in slightly more detail as the Kernel performs
real-time operating system (RTOS). In this paper we           different activities with regard to threads on the CPU as
propose a new approach to improve the overall                 follows.
performance of embedded systems by implementing               1. Suspend the progress of current running thread and
register files into processor register bank itself. So that        store the processor’s state for that thread in the
the system use multithreading by moving the context                memory.
switching component of the real-time operating system         2. Retrieve the context of the next thread, in the
(RTOS) to the processor hardware. This technique leads             scheduler’s ready list, from memory and restore it
to savings of processor clock cycles used by context               in the processor’s registers.
switching, By this approach the hard real time                Context Switching occur as a result of threads
embedded systems performance can be improved                  voluntarily relinquishing their allocated execution time
                                                              or as a result of the scheduler making the context switch
                                                              when a process has used ip its allocated time slice. A
Keywords: Context Switching, Operating System,
                                                              context switch can also occur as a result of a hardware
Memory, Simulation, Programming, Hard Real Time,              interrupt, which is a signal from a hardware device to
Log Terminal                                                  the kernel indicating that an event has occurred. Storing
                                                              and restoring processor’s registers to/from external
                 I. INTRODUCTION                              memory (RAM) is a time consuming activity and may
    In general, an operating system (OS) is responsible       take 50 to 80 processors clock cycles depending upon
for managing the hardware resources of a computer and         context size and RTOS design. If the system needs to
hosting applications that execute on the computer. A          respond to an event in less than this time, the event
RTOS Is a Specialized type of operating system                response has to be implemented as an Interrupt Routine
designed to execute applications with very precise            (ISR). On the other hand, if several events happen
timing and a high degree of reliability. They are             continuously, then the overall performance of the
intended for use with real time applications. Such            system may not be acceptable as most treads may not
applications include embedded systems (such as                get a chance to execute. To improve responsiveness, the
programmable thermostats and household appliance              context switch time needs to be reduced. In general,
controllers), industrial robots, spacecrafts, industrial      there are two factors that effect the context switching
controllers, scientific research equipments, etc. RTOS        cost. Direct cost due to moving the processor’s registers
can be divided into two categories, hard real-time and        to and from external memory or cache and indirect cost
soft real-time systems. In a hard real-time or immediate      because of perturbation of cache, CPU, pipeline, etc.
real-time system, the completion of an operating after        This presents difficulty in estimating the total cost of
its deadline is considered useless, and this may cause a      context switching cost[2], several algorithms have been
critical failure of the complete system and can lead to       developed and implemented to reduce the direct cost of
an accident (e.g. Engine Control Unit of a car,               context switching[3][4][5]. As discussed earlier,
Computer Numeric Control Machines). Usually the               context registers need to be saved externamemory one
kernel divides the application into logical pieces            at a time. A MIPS processor with 12 registers (9
                                                              temporary registers, stack pointer, global pointer and

Issn 2250-3005(online)                                        September| 2012                              Page 1542
International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5




program counter), need to be saved, it requires at least 2    The software implementation is divided into two parts.
X 2 X 12=48 clock cycles to switch the context. Using         The first part deals with modification of GNU MIPS
our suggested approach, this context switch time would        tool-chain by adding the ‘scxt’ and ‘rcxt’ instructions to
be reduced drastically to 4 processor’s clock cycles          the GNU-MIPS assembler [8].
independent of the number of context registers.                   The second part mainly deals with the
The approach presented in this paper is to save the           implementation of a small co-operative operating
context in newly created context register files. These        system that executes the threads in round robin fashion
register files are implemented in the processor hardware      using the newly implemented context switch
itself as part of the processor’s register bank module.       instructions. The’sext’ and ‘rext’ was developed using
To test and achieve the required performance, software        mips assembly language and the cooperating operating
also needs to be modified to exploit the suggested            system was developed using C- language. Those two
hardware design.                                              files executed in VMWARE linux environment. These
                                                              object files added to the GNU MIPS assembler so that
       II. HARDWARE IMPLEMENTATION                            the GNU MIPS tool-chain gets modified. This
    To prove the concept and measure the performance          operating system supports context switching using
of our suggested approach, MIPS processor architecture        external RAM locations as well as internal register
was selected [6] and the suggested approach was               files.
implemented on top of it. The register bank module of             Figure 2. Shows the co-operating operating system’s
the processor was modified by adding register files in        tread structure. To achieve the fast context switch using
the register bank to save context. The size of each           internal register files, application has to set the
register file is equal to context size. We have               ‘FastCtxtSwitch’ member of the task structure to 1 for
implemented 6 register files. The block diagram of the        that particular thread at the time of thread creation.
modified MIPS architecture as shown in figure 1.

                                                                 #include “plasma’s”

                                                                 #define CONTXT_SIZE 15
                                                                 typedef void (*TaskFunc)(void)
                                                                 typedef struct task
                                                                 {
                                                                 Void (*Taskptr)();
                                                                 …………..
                                                                 …………..
                                                                 ……..
                                                                 }

                                                                 Void createTask (….)
                                                                   {
                                                                 If (cnxt_type= =0)
                                                                 {Threads[TaskID].State=0;
                                                                 Threads[TaskID].Fastctxtswitch=1;
                                                                 }else
 Figure 1. Modified MIPS processor architecture                  {
                                                                 Threads[TaskID].FastCtxtSwitch=0;
    To access these register files, two special context          }
switch CPU instructions have been implemented: ’sext’
and ‘rext’ to save and restore the processor’s context
respectively. The index will be stored in temporary                  Figure 2. Task Structure
register that to which register file the context will be
stored and from which register file the context will be
                                                                          IV. SIMULATION RESULTS
restore. Example register $4 contains the index of the
                                                                  Xilinx Spartan 3E 1600E the advanced development
register file.
                                                              board was used for our test and experimentation [9].
                                                              Xilinx ISE 10.1 was used to design the hardware and
       III. SOFTWARE IMPLEMENTATION                           the simulations were executed using the advanced
   To implement the software we have installed                simulation and debugging toolset, ModelSim [10].
VMWARE for Linux operating system environment.                Figure 3 shows the simulation wave form. Context
VMWARE is an utility to enter from one operating              registers are saved in the context switch register file-2
system to another operating system.                           in 2 clock cycles.

Issn 2250-3005(online)                                        September| 2012                               Page 1543
International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5




                                                             Figure 5. iMPACT Programming Succeeded

                                                                         VI. TEST APPLICATION 1
                                                                This Application tests the successful operation of the
                                                             proposed approach by switching four threads using
                                                             internal register files. This test is used to ensure that
Figure 3. Simulation results for ‘scxt’ instruction          data between threads is not corrupted and thread’s
                                                             context switching is correct. The flow chart of this
Similarly figure 4. Shows the simulation waveform of         application is shown in figure 6.
the ‘rext’ instruction. The context registers are also
being restored from the context switch register file-2 in
2 clock cycles.




  Figure 4. Simulation results for ‘rext’ instruction

         V. PROGRAMMING VIA IMPACT
    After successfully compiling an FPGA design using
the Xilinx development software, the design can be                 Figure 6:Flowchart for Test Application -1
downloaded using the iMPACT programming software
and the USB cable. To begin programming, connect the            There are four Tasks Executes in round robin
USB cable to the starter kit board and apply power to        fashion. TaskID=0, TaskID=1, TaskID=2, TaskID=3
the board. Then double-click configure Device                executes one by one, finally the TaskID3 calculates and
(iMPACT) from within Project Navigator. To start             prints the Number of Clock cycles consumed to process
programming the FPGA, right click the FPGA and               one data sample. These Tasks will send the messages to
select program. When the FPGA successfully programs,         the debug terminal port, the output log received on the
the iMPACT software indicates success, as shown in           debug terminal as shown in figure 7.
Figure 5.




Issn 2250-3005(online)                                       September| 2012                              Page 1544
International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5




                                                              algorithm. This paper also takes another step forward in
                                                              moving the real-time operating system kernel to
                                                              hardware and programming iMPACT using Xilinx
                                                              software.


                                                                                 IX. REFERENCES
                                                              [I]      http://www.rtos.com/PDFs/           AnalyzingReal-
                                                                     TimeSystemBehavior.pdf
                                                              [2] Francis M. David, Jeffery C. Carlyle, Roy H. Campbell
                                                                     "Context Switch Overheads for Linux on ARM
                                                                     Platforms" San Diego, California Article No. : 3 Year of
                                                                     Publication: 2007 ISBN:978-I-59593-751-3
                                                              [3]   Zhaohui Wu, Hong Li, Zhigang Gao, Jie Sun, Jiang Li An
                                                                     Improved Method of Task Context Switching in OSEK
                                                                     Operating System" Advanced Information Networking
Figure 7: Serial Debug Log from Test Application -1                  and Applications, 2006. AlNA 2006. Publication date:
                                                                     18-20 April 2006 ISSN : 1550-445X
            VII. TEST APPLICATION-2                           [4]   Jeffrey S. Snyder, David B. Whalley, Theodore P. Baker
   The Second application is designed to measure the                 "Fast Context Switches: Compiler and rchitectural
performance improvement, in clock cycles. It creates                 support for Preemptive Scheduling" Microprocessors and
four threads that executes in never-ending loops. First              Microsystems, pp.35-42, 1995.
two threads does context switching using internal                    Vailable:citesser.ist.psu.edul33707.html
                                                              [5]   Xiangrong Zhou, Peter Petrov "Rapid and low-cost
register files. Next two threads does context switching
                                                                     context-switch       through     embedded      processor
using external memory. Message send to the debug                     customization for real-time and control applications"
serial port include: Number of Clock cycles consumed                 DAC 2006, July 24- 28 San Francisco, CA [6]
by first two threads, Number of clock cycles consumed                http://www.opencores.org/projecLplasma
by the next two threads. Finally, the difference between      [7]   MIPS Assembly Language Programmer's Guide, ASM - 0
these two. Figure 8 shows the output log for this test.              I-DOC, PartNumber 02-0036-005 October, 1992
                                                              [8]   http://ftp. gnu.org/gnuibinutilsl
                                                              [9]   MicroBlaze Development Kit Spartan-3E 1600E Edition
                                                                     User Guidewww.xilinx.com
                                                              [10] http://model.com/contentlmodelsim-pe-simulation-
                                                                  and-debug




Figure 8: Serial Debug Log from Test Appl-2

                VIII.    CONCLUSION
     This paper Presents a new approach as an attempt
to improve the hard RTOS system performance which
helps in meeting the deadlines in an efficient Way. It
boosts the system performance for such systems where
lot of context switching is required in a small period of
time. This approach can be easily extended to soft
RTOS and regular operating systems to improve the
overall system performance. In these systems, threads
are created at run time and it is difficult to know the
number of threads at the design time. Therefore, threads
that are part of frequent context switching using internal
register files using the specially designed scheduler
Issn 2250-3005(online)                                        September| 2012                                   Page 1545

Mais conteúdo relacionado

Mais procurados

Process management in os
Process management in osProcess management in os
Process management in osMiong Lazaro
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchDaniel Ben-Zvi
 
process management
 process management process management
process managementAshish Kumar
 
Chapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsChapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsWayne Jones Jnr
 
Process management
Process managementProcess management
Process managementBirju Tank
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSvtunotesbysree
 
2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduho
2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduho2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduho
2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduhoKim Du-Ho
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time KernelsArnav Soni
 
Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernelMahendra M
 
Memory Bandwidth QoS
Memory Bandwidth QoSMemory Bandwidth QoS
Memory Bandwidth QoSRohit Jnagal
 
Evaluating the performance and behaviour of rt xen
Evaluating the performance and behaviour of rt xenEvaluating the performance and behaviour of rt xen
Evaluating the performance and behaviour of rt xenijesajournal
 
Windows process-scheduling
Windows process-schedulingWindows process-scheduling
Windows process-schedulingTalha Shaikh
 

Mais procurados (20)

Process management in os
Process management in osProcess management in os
Process management in os
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
 
Preempt_rt realtime patch
Preempt_rt realtime patchPreempt_rt realtime patch
Preempt_rt realtime patch
 
33
3333
33
 
process management
 process management process management
process management
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Chapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsChapter 19 - Real Time Systems
Chapter 19 - Real Time Systems
 
142 144
142 144142 144
142 144
 
Process management
Process managementProcess management
Process management
 
Cat @ scale
Cat @ scaleCat @ scale
Cat @ scale
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
 
2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduho
2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduho2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduho
2010 nephee 01_smart_grid과제진행및이슈사항_20100630_kimduho
 
Ch3-2
Ch3-2Ch3-2
Ch3-2
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time Kernels
 
Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernel
 
Real time Linux
Real time LinuxReal time Linux
Real time Linux
 
Memory Bandwidth QoS
Memory Bandwidth QoSMemory Bandwidth QoS
Memory Bandwidth QoS
 
Evaluating the performance and behaviour of rt xen
Evaluating the performance and behaviour of rt xenEvaluating the performance and behaviour of rt xen
Evaluating the performance and behaviour of rt xen
 
Windows process-scheduling
Windows process-schedulingWindows process-scheduling
Windows process-scheduling
 

Destaque

A Study on Video Steganographic Techniques
A Study on Video Steganographic TechniquesA Study on Video Steganographic Techniques
A Study on Video Steganographic Techniquesijceronline
 
Study on groundwater quality in and around sipcot industrial complex, area cu...
Study on groundwater quality in and around sipcot industrial complex, area cu...Study on groundwater quality in and around sipcot industrial complex, area cu...
Study on groundwater quality in and around sipcot industrial complex, area cu...ijceronline
 
Design And Analysis of a Rocker Arm
Design And Analysis of a Rocker ArmDesign And Analysis of a Rocker Arm
Design And Analysis of a Rocker Armijceronline
 
Stress Analysis of a Centrifugal Supercharger Impeller Blade
Stress Analysis of a Centrifugal Supercharger Impeller BladeStress Analysis of a Centrifugal Supercharger Impeller Blade
Stress Analysis of a Centrifugal Supercharger Impeller Bladeijceronline
 
Inventory Management Project
Inventory Management ProjectInventory Management Project
Inventory Management ProjectMOHD ARISH
 
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy GraphStrong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graphijceronline
 
Development of a Cassava Starch Extraction Machine
Development of a Cassava Starch Extraction MachineDevelopment of a Cassava Starch Extraction Machine
Development of a Cassava Starch Extraction Machineijceronline
 
Engendering sustainable socio-spatial environment for tourism activities in t...
Engendering sustainable socio-spatial environment for tourism activities in t...Engendering sustainable socio-spatial environment for tourism activities in t...
Engendering sustainable socio-spatial environment for tourism activities in t...ijceronline
 
The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...
The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...
The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...ijceronline
 

Destaque (9)

A Study on Video Steganographic Techniques
A Study on Video Steganographic TechniquesA Study on Video Steganographic Techniques
A Study on Video Steganographic Techniques
 
Study on groundwater quality in and around sipcot industrial complex, area cu...
Study on groundwater quality in and around sipcot industrial complex, area cu...Study on groundwater quality in and around sipcot industrial complex, area cu...
Study on groundwater quality in and around sipcot industrial complex, area cu...
 
Design And Analysis of a Rocker Arm
Design And Analysis of a Rocker ArmDesign And Analysis of a Rocker Arm
Design And Analysis of a Rocker Arm
 
Stress Analysis of a Centrifugal Supercharger Impeller Blade
Stress Analysis of a Centrifugal Supercharger Impeller BladeStress Analysis of a Centrifugal Supercharger Impeller Blade
Stress Analysis of a Centrifugal Supercharger Impeller Blade
 
Inventory Management Project
Inventory Management ProjectInventory Management Project
Inventory Management Project
 
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy GraphStrong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graph
 
Development of a Cassava Starch Extraction Machine
Development of a Cassava Starch Extraction MachineDevelopment of a Cassava Starch Extraction Machine
Development of a Cassava Starch Extraction Machine
 
Engendering sustainable socio-spatial environment for tourism activities in t...
Engendering sustainable socio-spatial environment for tourism activities in t...Engendering sustainable socio-spatial environment for tourism activities in t...
Engendering sustainable socio-spatial environment for tourism activities in t...
 
The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...
The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...
The Myth of Softening behavior of the Cohesive Zone Model Exact derivation of...
 

Semelhante a IJCER (www.ijceronline.com) International Journal of computational Engineering research

RTOS implementation
RTOS implementationRTOS implementation
RTOS implementationRajan Kumar
 
Embedded Intro India05
Embedded Intro India05Embedded Intro India05
Embedded Intro India05Rajesh Gupta
 
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems iosrjce
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded SystemsHimanshu Ghetia
 
Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...
Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...
Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...CSCJournals
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsPawandeep Kaur
 
Co question bank LAKSHMAIAH
Co question bank LAKSHMAIAH Co question bank LAKSHMAIAH
Co question bank LAKSHMAIAH veena babu
 
embedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfembedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfabdulkerimaragaw936
 
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTINGDYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTINGcscpconf
 
Area Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips ProcessorArea Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips ProcessorIOSR Journals
 
Implementation of RISC-Based Architecture for Low power applications
Implementation of RISC-Based Architecture for Low power applicationsImplementation of RISC-Based Architecture for Low power applications
Implementation of RISC-Based Architecture for Low power applicationsIOSR Journals
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCoburn Watson
 
Inference accelerators
Inference acceleratorsInference accelerators
Inference acceleratorsDarshanG13
 

Semelhante a IJCER (www.ijceronline.com) International Journal of computational Engineering research (20)

RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
Embedded Intro India05
Embedded Intro India05Embedded Intro India05
Embedded Intro India05
 
TenAsys.Fall07
TenAsys.Fall07TenAsys.Fall07
TenAsys.Fall07
 
K017617786
K017617786K017617786
K017617786
 
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...
Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...
Run-Time Adaptive Processor Allocation of Self-Configurable Intel IXP2400 Net...
 
Os Concepts
Os ConceptsOs Concepts
Os Concepts
 
Lab6 rtos
Lab6 rtosLab6 rtos
Lab6 rtos
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Co question bank LAKSHMAIAH
Co question bank LAKSHMAIAH Co question bank LAKSHMAIAH
Co question bank LAKSHMAIAH
 
Embedded os
Embedded osEmbedded os
Embedded os
 
Realtime
RealtimeRealtime
Realtime
 
embedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfembedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdf
 
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTINGDYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
 
Area Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips ProcessorArea Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips Processor
 
Implementation of RISC-Based Architecture for Low power applications
Implementation of RISC-Based Architecture for Low power applicationsImplementation of RISC-Based Architecture for Low power applications
Implementation of RISC-Based Architecture for Low power applications
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performance
 
Inference accelerators
Inference acceleratorsInference accelerators
Inference accelerators
 

Último

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

IJCER (www.ijceronline.com) International Journal of computational Engineering research

  • 1. International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5 Implementation of Register Files in the Processor of Hard Real Time Systems for Context Switching 1 Prof. B Abdul Rahim, 2 Mr. S.Narayana Raju, 3 Mr. M M Venkateswara Rao 1 Head, Dept. Of ECE AITS, Rajampet, kadapa (Dist.), A.P, India 2 M.Tech (Embedded Systems), NECT, Hyderabad, RR (dist.), A.P, India 3 M.Tech (Embedded Systems), AITS, Rajampet, kadapa (Dist.), A.P, India Abstract Embedded Real Time applications use multi threading Commonly called threads and a kernel that coordinates to share of real time application. The advantage of their execution. A thread is an executing Instance of an multi-threading include greater throughput, more Application and its context is the contents of the efficient CPU use, Better system reliability improved processor registers and program counter at any point of performance on multiprocessor computer. time. A scheduler, a part of the Real Time operating Real time systems like Flight control systems require System’s kernel, schedules threads execution based very precise timing; multi threading itself becomes an upon their priority. Context switching function can be overhead cost mainly due to context switching of the described in slightly more detail as the Kernel performs real-time operating system (RTOS). In this paper we different activities with regard to threads on the CPU as propose a new approach to improve the overall follows. performance of embedded systems by implementing 1. Suspend the progress of current running thread and register files into processor register bank itself. So that store the processor’s state for that thread in the the system use multithreading by moving the context memory. switching component of the real-time operating system 2. Retrieve the context of the next thread, in the (RTOS) to the processor hardware. This technique leads scheduler’s ready list, from memory and restore it to savings of processor clock cycles used by context in the processor’s registers. switching, By this approach the hard real time Context Switching occur as a result of threads embedded systems performance can be improved voluntarily relinquishing their allocated execution time or as a result of the scheduler making the context switch when a process has used ip its allocated time slice. A Keywords: Context Switching, Operating System, context switch can also occur as a result of a hardware Memory, Simulation, Programming, Hard Real Time, interrupt, which is a signal from a hardware device to Log Terminal the kernel indicating that an event has occurred. Storing and restoring processor’s registers to/from external I. INTRODUCTION memory (RAM) is a time consuming activity and may In general, an operating system (OS) is responsible take 50 to 80 processors clock cycles depending upon for managing the hardware resources of a computer and context size and RTOS design. If the system needs to hosting applications that execute on the computer. A respond to an event in less than this time, the event RTOS Is a Specialized type of operating system response has to be implemented as an Interrupt Routine designed to execute applications with very precise (ISR). On the other hand, if several events happen timing and a high degree of reliability. They are continuously, then the overall performance of the intended for use with real time applications. Such system may not be acceptable as most treads may not applications include embedded systems (such as get a chance to execute. To improve responsiveness, the programmable thermostats and household appliance context switch time needs to be reduced. In general, controllers), industrial robots, spacecrafts, industrial there are two factors that effect the context switching controllers, scientific research equipments, etc. RTOS cost. Direct cost due to moving the processor’s registers can be divided into two categories, hard real-time and to and from external memory or cache and indirect cost soft real-time systems. In a hard real-time or immediate because of perturbation of cache, CPU, pipeline, etc. real-time system, the completion of an operating after This presents difficulty in estimating the total cost of its deadline is considered useless, and this may cause a context switching cost[2], several algorithms have been critical failure of the complete system and can lead to developed and implemented to reduce the direct cost of an accident (e.g. Engine Control Unit of a car, context switching[3][4][5]. As discussed earlier, Computer Numeric Control Machines). Usually the context registers need to be saved externamemory one kernel divides the application into logical pieces at a time. A MIPS processor with 12 registers (9 temporary registers, stack pointer, global pointer and Issn 2250-3005(online) September| 2012 Page 1542
  • 2. International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5 program counter), need to be saved, it requires at least 2 The software implementation is divided into two parts. X 2 X 12=48 clock cycles to switch the context. Using The first part deals with modification of GNU MIPS our suggested approach, this context switch time would tool-chain by adding the ‘scxt’ and ‘rcxt’ instructions to be reduced drastically to 4 processor’s clock cycles the GNU-MIPS assembler [8]. independent of the number of context registers. The second part mainly deals with the The approach presented in this paper is to save the implementation of a small co-operative operating context in newly created context register files. These system that executes the threads in round robin fashion register files are implemented in the processor hardware using the newly implemented context switch itself as part of the processor’s register bank module. instructions. The’sext’ and ‘rext’ was developed using To test and achieve the required performance, software mips assembly language and the cooperating operating also needs to be modified to exploit the suggested system was developed using C- language. Those two hardware design. files executed in VMWARE linux environment. These object files added to the GNU MIPS assembler so that II. HARDWARE IMPLEMENTATION the GNU MIPS tool-chain gets modified. This To prove the concept and measure the performance operating system supports context switching using of our suggested approach, MIPS processor architecture external RAM locations as well as internal register was selected [6] and the suggested approach was files. implemented on top of it. The register bank module of Figure 2. Shows the co-operating operating system’s the processor was modified by adding register files in tread structure. To achieve the fast context switch using the register bank to save context. The size of each internal register files, application has to set the register file is equal to context size. We have ‘FastCtxtSwitch’ member of the task structure to 1 for implemented 6 register files. The block diagram of the that particular thread at the time of thread creation. modified MIPS architecture as shown in figure 1. #include “plasma’s” #define CONTXT_SIZE 15 typedef void (*TaskFunc)(void) typedef struct task { Void (*Taskptr)(); ………….. ………….. …….. } Void createTask (….) { If (cnxt_type= =0) {Threads[TaskID].State=0; Threads[TaskID].Fastctxtswitch=1; }else Figure 1. Modified MIPS processor architecture { Threads[TaskID].FastCtxtSwitch=0; To access these register files, two special context } switch CPU instructions have been implemented: ’sext’ and ‘rext’ to save and restore the processor’s context respectively. The index will be stored in temporary Figure 2. Task Structure register that to which register file the context will be stored and from which register file the context will be IV. SIMULATION RESULTS restore. Example register $4 contains the index of the Xilinx Spartan 3E 1600E the advanced development register file. board was used for our test and experimentation [9]. Xilinx ISE 10.1 was used to design the hardware and III. SOFTWARE IMPLEMENTATION the simulations were executed using the advanced To implement the software we have installed simulation and debugging toolset, ModelSim [10]. VMWARE for Linux operating system environment. Figure 3 shows the simulation wave form. Context VMWARE is an utility to enter from one operating registers are saved in the context switch register file-2 system to another operating system. in 2 clock cycles. Issn 2250-3005(online) September| 2012 Page 1543
  • 3. International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5 Figure 5. iMPACT Programming Succeeded VI. TEST APPLICATION 1 This Application tests the successful operation of the proposed approach by switching four threads using internal register files. This test is used to ensure that Figure 3. Simulation results for ‘scxt’ instruction data between threads is not corrupted and thread’s context switching is correct. The flow chart of this Similarly figure 4. Shows the simulation waveform of application is shown in figure 6. the ‘rext’ instruction. The context registers are also being restored from the context switch register file-2 in 2 clock cycles. Figure 4. Simulation results for ‘rext’ instruction V. PROGRAMMING VIA IMPACT After successfully compiling an FPGA design using the Xilinx development software, the design can be Figure 6:Flowchart for Test Application -1 downloaded using the iMPACT programming software and the USB cable. To begin programming, connect the There are four Tasks Executes in round robin USB cable to the starter kit board and apply power to fashion. TaskID=0, TaskID=1, TaskID=2, TaskID=3 the board. Then double-click configure Device executes one by one, finally the TaskID3 calculates and (iMPACT) from within Project Navigator. To start prints the Number of Clock cycles consumed to process programming the FPGA, right click the FPGA and one data sample. These Tasks will send the messages to select program. When the FPGA successfully programs, the debug terminal port, the output log received on the the iMPACT software indicates success, as shown in debug terminal as shown in figure 7. Figure 5. Issn 2250-3005(online) September| 2012 Page 1544
  • 4. International Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 5 algorithm. This paper also takes another step forward in moving the real-time operating system kernel to hardware and programming iMPACT using Xilinx software. IX. REFERENCES [I] http://www.rtos.com/PDFs/ AnalyzingReal- TimeSystemBehavior.pdf [2] Francis M. David, Jeffery C. Carlyle, Roy H. Campbell "Context Switch Overheads for Linux on ARM Platforms" San Diego, California Article No. : 3 Year of Publication: 2007 ISBN:978-I-59593-751-3 [3] Zhaohui Wu, Hong Li, Zhigang Gao, Jie Sun, Jiang Li An Improved Method of Task Context Switching in OSEK Operating System" Advanced Information Networking Figure 7: Serial Debug Log from Test Application -1 and Applications, 2006. AlNA 2006. Publication date: 18-20 April 2006 ISSN : 1550-445X VII. TEST APPLICATION-2 [4] Jeffrey S. Snyder, David B. Whalley, Theodore P. Baker The Second application is designed to measure the "Fast Context Switches: Compiler and rchitectural performance improvement, in clock cycles. It creates support for Preemptive Scheduling" Microprocessors and four threads that executes in never-ending loops. First Microsystems, pp.35-42, 1995. two threads does context switching using internal Vailable:citesser.ist.psu.edul33707.html [5] Xiangrong Zhou, Peter Petrov "Rapid and low-cost register files. Next two threads does context switching context-switch through embedded processor using external memory. Message send to the debug customization for real-time and control applications" serial port include: Number of Clock cycles consumed DAC 2006, July 24- 28 San Francisco, CA [6] by first two threads, Number of clock cycles consumed http://www.opencores.org/projecLplasma by the next two threads. Finally, the difference between [7] MIPS Assembly Language Programmer's Guide, ASM - 0 these two. Figure 8 shows the output log for this test. I-DOC, PartNumber 02-0036-005 October, 1992 [8] http://ftp. gnu.org/gnuibinutilsl [9] MicroBlaze Development Kit Spartan-3E 1600E Edition User Guidewww.xilinx.com [10] http://model.com/contentlmodelsim-pe-simulation- and-debug Figure 8: Serial Debug Log from Test Appl-2 VIII. CONCLUSION This paper Presents a new approach as an attempt to improve the hard RTOS system performance which helps in meeting the deadlines in an efficient Way. It boosts the system performance for such systems where lot of context switching is required in a small period of time. This approach can be easily extended to soft RTOS and regular operating systems to improve the overall system performance. In these systems, threads are created at run time and it is difficult to know the number of threads at the design time. Therefore, threads that are part of frequent context switching using internal register files using the specially designed scheduler Issn 2250-3005(online) September| 2012 Page 1545