CN1224896C - Microprocessor Architecture for Critical Section Control - Google Patents

Microprocessor Architecture for Critical Section Control Download PDF

Info

Publication number
CN1224896C
CN1224896C CN 99126042 CN99126042A CN1224896C CN 1224896 C CN1224896 C CN 1224896C CN 99126042 CN99126042 CN 99126042 CN 99126042 A CN99126042 A CN 99126042A CN 1224896 C CN1224896 C CN 1224896C
Authority
CN
China
Prior art keywords
instruction
signal line
microprocessor
interrupt request
request signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 99126042
Other languages
Chinese (zh)
Other versions
CN1304087A (en
Inventor
刘德忠
李桓瑞
陈泳成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sunplus Technology Co Ltd
Original Assignee
Sunplus Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sunplus Technology Co Ltd filed Critical Sunplus Technology Co Ltd
Priority to CN 99126042 priority Critical patent/CN1224896C/en
Publication of CN1304087A publication Critical patent/CN1304087A/en
Application granted granted Critical
Publication of CN1224896C publication Critical patent/CN1224896C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

A microprocessor structure able to realize the control of critical area features that an instruction temporary storage is used to hold the instruction to be executed by microprocessor, a judging logic unit is used to control the interrupt request signal line of microprocessor, and when the contents of said temporary storage are compared with a storage instruction, the interrupt request signal line is closed to realize the control of critical area.

Description

Microprocessor structure capable of implementing control of critical section
Technical field
The present invention is the technical field of relevant microprocessor, refers to a kind of microprocessor structure capable of implementing control of critical section especially.
Background technology
In known microprocessor, can provide a kind of method to satisfy the control that the user uses for system resource usually when the environment of multiple stroke (Multi-Process) to critical section (Critical Section) control; with the generation of avoiding conflicting between each stroke; and the general method that adopts promptly is to use test and the mode of setting (Test and Set) to reach control to the critical section, and its algorithm is as follows:
bool?test-and-set(bool*s){//atomic?function,
//can?not?be
//interrupted
bool?original=s;
s=true;
return?original;}
And the use-case that makes of corresponding program end is:
while(test-and-set(&sign));//if?sign?is?true,
//someone?else?is
//in?critical
//section,wait.
...Critical?section?here…
sing=false;//leave?critical?section,make?it
//available?to?others.
...Non-critical?section…
Is that whole function performance is packaged in the exclusive instruction with it in general micro controller for the realization of Test and Set, and reach indivisible characteristic, can be to guarantee whole process once to be finished not interrupted by other program of carrying out midway.Microprocessors such as 80386 and 80486 in the x86 family that is produced with the most common INTE1 company are to provide the exclusive instruction of BTS (Test Bit Set) to realize the method for Test and Set.Yet this kind is in the mode of the control that provides extra exclusive instruction to realize to use for the critical section, more instruction set number must be arranged for microprocessor, even cause to use long instruction length, and also can increase the complexity and size of microprogram, the exclusive instruction of more necessary use just can be accomplished the control of critical section and the management of system resource for the developer of application program, therefore, aforementioned known microprocessor gives improved necessity in fact for the mode of the control of critical section use.
The creator whence originally in the spirit of positive innovation, is urgently thought a kind of " microprocessor structure capable of implementing control of critical section " that can address the above problem because of in this, and several times research experiment is eventually to finishing this novel progressive creation.
Summary of the invention
A purpose of the present invention is that a kind of microprocessor structure capable of implementing control of critical section is being provided, and it does not need exclusive instruction can support the control of critical section with simple circuit.
Another object of the present invention is that a kind of microprocessor structure capable of implementing control of critical section is being provided, and it can realize safe data recasting.
For reaching aforesaid purpose, a kind of microprocessor structure capable of implementing control of critical section of the present invention is characterized in that, mainly comprises:
One interrupt request signal line;
One instruction registor stores and holds the instruction that microprocessor will be carried out;
One decision logic unit is a comparer, with the content and to this instruction registor be written into the instruction or a save command compare; And
One colligator carries out the computing of logical and with the inverse value of the output of this interrupt request signal line and this comparer, is identical and it is output as at 1 o'clock with the comparative result at the comparer of this comparer, and this interrupt request signal line is closed.
Wherein be written into instruction or save command is identical and this is written into and instructs or save command when belonging to the instruction of specific addressing mode when the content of judging this instruction registor and this, this interrupt request signal line is closed.
Wherein this specific addressing mode is to be the addressing mode of microprocessor in order to the instruction of access critical section.
A kind of microprocessor structure capable of implementing control of critical section of the present invention is characterized in that, mainly comprises:
One interrupt request signal line;
One instruction registor stores the instruction that microprocessor will be carried out:
One comparer, it is that content and to this instruction registor is written into instruction or a save command is compared, to produce a relatively output; And
One storage unit is in order to keep this comparer in the relatively output that the last instruction cycle produced;
One first colligator, with this comparer produced relatively output and this storage unit stored relatively export the computing that inverse value is carried out logical and; And
One second colligator, the inverse value of the output of this first colligator and this interrupt request signal line carry out the computing of logical and, with the comparative result at this comparer is identical and it relatively is output as 1, and what this storage unit was stored relatively is output as at 0 o'clock, and this interrupt request signal line is closed.
Wherein this storage unit is to be a latch.
A kind of microprocessor structure capable of implementing control of critical section of the present invention is characterized in that, mainly comprises:
One interrupt request signal line;
One instruction registor stores the instruction that microprocessor will be carried out:
One working storage of looking ahead is to read the next instruction that microprocessor will be carried out in advance;
One first comparer, it is that content and to this instruction registor is written into instruction and compares, to produce one first relatively output: and
One second comparer, it is that the content of this working storage of looking ahead is compared with a save command, to produce one second relatively output;
One logical AND gate, to this first relatively output and this second relatively output carry out the computing of logical and;
One colligator, inverse value and this interrupt request signal line of the output of this logical AND gate are carried out the computing of logical and, with the comparative result at this first and second comparer be identical and this first and second relatively export and be at 1 o'clock, this interrupt request signal line is closed.
Because modern design of the present invention can provide on the industry and utilize, and truly have the enhancement effect, so apply for a patent in accordance with the law.
Description of drawings
For making the auditor can further understand structure of the present invention, feature and purpose thereof, the attached now detailed description with stationary and preferred embodiment as after, wherein:
Fig. 1 is the functional block diagram of microprocessor structure capable of implementing control of critical section of the present invention.
Fig. 2 is the structural drawing of a preferred embodiment of microprocessor structure capable of implementing control of critical section of the present invention.
Fig. 3 is the structural drawing of another preferred embodiment of microprocessor structure capable of implementing control of critical section of the present invention.
Fig. 4 is the structural drawing of the another preferred embodiment of microprocessor structure capable of implementing control of critical section of the present invention.
Fig. 5 is the structural drawing of a preferred embodiment again of microprocessor structure capable of implementing control of critical section of the present invention.
Embodiment
For improving the implementation of microprocessor to critical section control, at first via to the analysis of the critical section steering order of general test and setting (Test and Set) as can be known, it has following properties:
(1) Test and Set instruction is made up of an instruction that is written into (Load) and storage (Store).
(2) implementation that is written into and stores two instructions among the Test and Set is cannot be divided.
(3) whether the break in service requirement is just can be examined to be triggered before an instruction is finished back or execution.
According to above-mentioned characteristic, microprocessor structure capable of implementing control of critical section of the present invention is the inspection of then closing the break in service requirement before back or save command execution are carried out in instruction being written into, so that be written into and store between two instructions is to carry out continuously and can be not divided, and can realize control, so only need select one and can implement to being written into or storing to the critical section.
Fig. 1 promptly shows the functional block diagram of microprocessor structure capable of implementing control of critical section of the present invention, it mainly is with interrupt request signal line 11, instruction registor 12, decision logic unit 13 and demoder 15 provide the function of instruction decoding and down trigger, and realization is to the control of critical section, wherein, this instruction registor 12 is the instructions in order to keep microprocessor to carry out, and decode to carry out it by 15 pairs of these instructions of this demoder, and this decision logic unit 13 is to control this interrupt request signal line according to the content of this instruction registor 12, to judge that when this decision logic unit 13 content that this instruction registor was kept is one when being written into instruction or save command, this decision logic unit 13 is the output states that produce a logical one in its output, otherwise be the state of output logic 0, and this interrupt request signal line 11 and just be connected to a colligator 14 with the output of this decision logic unit 13, anti-input end, according to this inverse value of the output of interrupt request and this decision logic unit 13 is carried out the computing of logical and (AND), the output of this colligator 14 then is fed to this demoder 15.
Structure by above-mentioned microprocessor, the instruction that will carry out when this instruction registor 12 is to be written into or during save command for one, this decision logic unit 13 is output as logical one, computing via this colligator 14, this logical one carries out the computing of logical and through anti-phase for logical zero and with interrupt request, this interrupt request signal line 11 is closed, can reach and make that to be written into and to store between two instructions be to carry out continuously and can divided effect, otherwise, the instruction that will carry out when this instruction registor 12 is non-to be one to be written into or during save command, this interrupt request signal line 11 is to be fed to this demoder 15 through this colligator 14, to allow the generation of interruption acknowledge.
Therefore, when being written into when identical with the address that stores, can realize the control of critical section, and the address is not simultaneously, and can realize safe data recasting (data duplicate), that is to be written into and save command is remake in the process of data, the not influence that can be interrupted and destroy the security of data.Aforesaid again be written into or save command is not limited to access to storer (Memory) also can be used the access for I/O mouth (IO Port).
And to other general non-being written into or the execution of save command of critical section control of being engaged in, can close the action of break in service with eliminating by limiting its addressing mode, that is, this decision logic unit 13 only when judging that the instruction that this instruction registor 12 is kept is the addressing mode of microprocessor in order to the instruction of access critical section, is just closed this interrupt request signal line 11.In addition, and can whether be that storage and other approximate mode are got rid of most situation further by limiting the order (for example will be written into and store alternate order and change continuous being written into or storing into) that instructs or prejudging next bar instruction, for the situation of failing to get rid of, because this kind function is just closed the inspection of break in service requirement, delay an instruction time generation (be written into and carry out the required time) so only can cause interrupt service routine, and consuming time very short, so even under the situation of erroneous judgement, also there is not influence for function face and result owing to being written into the instruction execution.
With reference to a preferred embodiment shown in Figure 2, it is to come content and to instruction registor 12 to be written into instruction with a comparer 21 to compare, reach the function of the decision logic unit 13 of aforementioned microprocessor structure capable of implementing control of critical section according to this, and as this comparer 21 result relatively when being identical, it is closed this interrupt request signal line 11, therefore can after being written into the instruction execution, close the break in service requirement, and realize control the critical section.
Fig. 3 then shows another preferred embodiment of the present invention, it is to come the content of instruction registor 12 is compared with a save command with a comparer 31, reach the function of the decision logic unit 13 of aforementioned microprocessor structure capable of implementing control of critical section according to this, and as this comparer 31 result relatively when being identical, it is closed this interrupt request signal line 11, therefore can before save command is carried out, close the break in service requirement, and realize control the critical section.
Fig. 4 then shows another preferred embodiment of the present invention, it is with a comparer 41, one storage unit 42 and a colligator 43 are realized the decision logic unit 13 of aforementioned microprocessor structure capable of implementing control of critical section, wherein, this comparer 41 is that the content and to instruction registor 12 is written into instruction or a save command is compared, when being identical when comparative result, it relatively is output as 1, and work as comparative result for not simultaneously, it relatively is output as 0, this storage unit 42 is preferably to be a latch, for in order to keep this comparer 41 in the relatively output that the last instruction cycle produced, and what the relatively output that this comparer 41 is produced and this storage unit 42 were kept is just relatively exporting and is being connected to this colligator 43, anti-input end, according to this present relatively output and the relatively inverse value of output in last cycle are carried out the computing of logical and (AND), the output of this colligator 43 promptly is in order to control interrupt request signal line 11, the output that also is about to interrupt request signal line 11 and this colligator 43 just is being connected to another colligator 14, anti-input end, carry out the computing of logical and with inverse value and this interrupt request signal line 11 with the output of aforementioned colligator 43, and can be at this comparer 41 relatively be output as 1, and what this storage unit 42 was kept relatively is output as at 0 o'clock, this interrupt request signal line 11 is closed, so removing can be by carrying out and closes the break in service requirement before back or save command are carried out and realize the control to the critical section being written into instruction, and can further get rid of continuous be written into or the save command execution the erroneous judgement that may cause.
Fig. 5 shows a preferred embodiment more of the present invention, it is with one first comparer 51, one second comparer 52 and a logical AND gate 53 are realized the decision logic unit 13 of aforementioned microprocessor structure capable of implementing control of critical section, wherein, this first comparer 51 is that the content and to instruction registor 12 is written into instruction and compares, when being identical when comparative result, it relatively is output as 1, and work as comparative result for not simultaneously, it relatively is output as 0, this second comparer 52 is to compare in advance in order to the instruction that will carry out the next instruction cycle, and the instruction that the next instruction cycle will carry out is kept by the working storage 54 of looking ahead, therefore, this second comparer 52 promptly is that the content of this working storage 54 of looking ahead is compared with a save command, when being identical when comparative result, it relatively is output as 1, and work as comparative result for not simultaneously, it relatively is output as 0, and the input end of relatively exporting and be connected to this logical AND gate 53 that the relatively output that this first comparer 51 is produced and this second comparer 52 are produced, according to this with two comparers 51, the computing of logical and is carried out in 52 output, the output of this logical AND gate 53 promptly is in order to control interrupt request signal line 11, the output that also is about to this interrupt request signal line 11 and this logical AND gate 53 just is being connected to colligator 14, anti-input end, carry out the computing of logical and with inverse value and this interrupt request signal line 11 with the output of this logical AND gate 53, and can be at this first and second comparer 51,52 relatively output is at 1 o'clock, this interrupt request signal line 11 is closed, close the effect of break in service requirement to reach before being written into instruction execution back and save command execution, and can further reduce the possibility of erroneous judgement.
Via aforesaid explanation as can be known, with respect to known mode to provide extra exclusive instruction to support critical section control, microprocessor structure capable of implementing control of critical section of the present invention has following benefit:
(1) need not provide extra exclusive instruction can support the control of critical section, the instruction set number is less.
(2) only need simple circuit can reach control, can simplify the exploitation of microprogram, do not need to realize especially exclusive steering order.
(3) parallel simultaneously term of execution that the control of critical section can and instruction, therefore can't increase on the sequential of carrying out for each instruction.
(4) the general instruction of use that can very suitable feel for procedure development person and reach the control of critical section need not the exclusive instruction of special call.
(5) the present invention also provides a kind of safe data recasting mode.
To sum up institute is old, and no matter the present invention is all showing it totally different in the feature of known techniques with regard to purpose, means and effect, for the quantum jump of microprocessor in the design that realizes critical section control, earnestly ask your juror and perceive, grant quasi patent early, with Jiahui society, the true feeling moral just.Only it should be noted that above-mentioned many embodiment give an example for convenience of explanation, the interest field that the present invention advocated should be as the criterion so that claim is described certainly, but not only limits to the foregoing description.

Claims (6)

1.一种可实现临界区控制的微处理器结构,其特征在于,主要包括:1. A microprocessor structure capable of realizing critical section control, characterized in that it mainly comprises: 一中断要求信号线;an interrupt request signal line; 一指令暂存器,储存持微处理器所要执行的指令;an instruction register, which stores instructions to be executed by the microprocessor; 一判断逻辑单元为一比较器,以对该指令暂存器的内容与一载入指令或一储存指令相比;以及a judgment logic unit is a comparator to compare the contents of the instruction register with a load instruction or a store instruction; and 一结合器,将该中断要求信号线及该比较器的输出的反相值进行逻辑与的运算,以在该比较器的比较器的比较结果为相同而其输出为1时,将该中断要求信号线予以关闭。A combiner, which performs a logic AND operation on the interrupt request signal line and the inverting value of the output of the comparator, so that when the comparison results of the comparators of the comparators are the same and the output is 1, the interrupt request The signal line is turned off. 2.根据权利要求1所述的可实现临界区控制的微处理器结构,其特征在于,其中当判定该指令暂存器的内容和该载入指令或储存指令相同且该载入指令或储存指令属于特定的定址模式的指令时,将该中断要求信号线予以关闭。2. The microprocessor structure capable of realizing critical section control according to claim 1, wherein when it is determined that the contents of the instruction temporary register are identical to the load instruction or the storage instruction and the load instruction or the storage instruction When the instruction belongs to the instruction of the specific addressing mode, the interrupt request signal line is turned off. 3.根据权利要求2所述的可实现临界区控制的微处理器结构,其特征在于,其中该特定的定址模式是为微处理器用以存取临界区的指令的定址模式。3 . The microprocessor structure capable of controlling critical sections according to claim 2 , wherein the specific addressing mode is an addressing mode for instructions used by the microprocessor to access critical sections. 4 . 4.一种可实现临界区控制的微处理器结构,其特征在于,主要包括:4. A microprocessor structure capable of realizing critical section control, characterized in that it mainly comprises: 一中断要求信号线;an interrupt request signal line; 一指令暂存器,储存微处理器所要执行的指令:An instruction register, storing instructions to be executed by the microprocessor: 一比较器,其是对该指令暂存器的内容与一载入指令或一储存指令相比,以产生一比较输出;以及a comparator that compares the contents of the instruction register with a load instruction or a store instruction to generate a comparison output; and 一存储单元,是用以保持该比较器于前一指令周期所产生的比较输出;A storage unit is used to keep the comparison output generated by the comparator in the previous instruction cycle; 一第一结合器,将该比较器所产生的比较输出与该存储单元所储存的比较输出反相值进行逻辑与的运算;以及A first combiner, performing a logical AND operation on the comparison output generated by the comparator and the inversion value of the comparison output stored in the storage unit; and 一第二结合器,该第一结合器的输出的反相值与该中断要求信号线进行逻辑与的运算,以在该比较器的比较结果为相同而其比较输出为1,且该存储单元所储存的比较输出为0时,将该中断要求信号线予以关闭。A second combiner, the inversion value of the output of the first combiner and the interrupt request signal line are logically ANDed, so that the comparison result of the comparator is the same and the comparison output is 1, and the storage unit When the stored comparison output is 0, the interrupt request signal line is turned off. 5.根据权利要求4所述的可实现临界区控制的微处理器结构,其特征在于,其中该存储单元是为一锁存器。5. The microprocessor structure capable of realizing critical section control according to claim 4, wherein the storage unit is a latch. 6.一种可实现临界区控制的微处理器结构,其特征在于,主要包括:6. A microprocessor structure capable of realizing critical section control, characterized in that it mainly comprises: 一中断要求信号线;an interrupt request signal line; 一指令暂存器,储存微处理器所要执行的指令:An instruction register, storing instructions to be executed by the microprocessor: 一预取暂存器,是预先读取微处理器所要执行的下一个指令;A prefetch temporary register is to read in advance the next instruction to be executed by the microprocessor; 一第一比较器,其是对该指令暂存器的内容与一载入指令相比,以产生一第一比较输出:以及a first comparator, which compares the contents of the instruction register with a load instruction to generate a first comparison output: and 一第二比较器,其是对该预取暂存器的内容与一储存指令相比,以产生一第二比较输出;a second comparator, which compares the contents of the prefetch register with a store instruction to generate a second comparison output; 一逻辑与门,对该第一比较输出及该第二比较输出进行逻辑与的运算;A logical AND gate, performing a logical AND operation on the first comparison output and the second comparison output; 一结合器,将该逻辑与门的输出的反相值与该中断要求信号线进行逻辑与的运算,以在该第一及第二比较器的比较结果均为相同而该第一及第二比较输出均为1时,将该中断要求信号线予以关闭。A combiner, the inverting value of the output of the logical AND gate and the interrupt request signal line are logically ANDed, so that the comparison results of the first and second comparators are the same and the first and second When the comparison outputs are all 1, the interrupt request signal line is turned off.
CN 99126042 1999-12-13 1999-12-13 Microprocessor Architecture for Critical Section Control Expired - Fee Related CN1224896C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 99126042 CN1224896C (en) 1999-12-13 1999-12-13 Microprocessor Architecture for Critical Section Control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 99126042 CN1224896C (en) 1999-12-13 1999-12-13 Microprocessor Architecture for Critical Section Control

Publications (2)

Publication Number Publication Date
CN1304087A CN1304087A (en) 2001-07-18
CN1224896C true CN1224896C (en) 2005-10-26

Family

ID=5284290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 99126042 Expired - Fee Related CN1224896C (en) 1999-12-13 1999-12-13 Microprocessor Architecture for Critical Section Control

Country Status (1)

Country Link
CN (1) CN1224896C (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7129883B2 (en) * 2004-02-23 2006-10-31 Sony Corporation Method and apparatus for AD conversion, semiconductor device for detecting distribution of physical quantity, and electronic apparatus

Also Published As

Publication number Publication date
CN1304087A (en) 2001-07-18

Similar Documents

Publication Publication Date Title
CN1047677C (en) Instruction Dependent Scheduling Technology for Multiple Execution Units
CN1726470A (en) Method and system for managing machine state in virtual machine operations
CN106843756B (en) Memory page recycling method and system based on page classification
US8392989B2 (en) Anti-malware scanning in parallel processors of a graphics processing unit
CN1613054A (en) Controlling compatibility levels of binary translations between instruction set architectures
CN1608246A (en) Suspension of thread execution in multithreaded processors
CN1355902A (en) Method and apparatus for enhancing scheduling in advanced microprocessor
CN1444154A (en) Multiple processor system
CN1650266A (en) Time-multiplexed speculative multi-threading to support single-threaded applications
CN1306419C (en) A cache and a method for reading data from the cache
CN1450450A (en) 32-bit embedded microprocessor adopting double instruction set
CN118132009A (en) Host command processing method and device, electronic equipment and storage medium
CN1291323C (en) Marking position stacking and microprocessor using same
CN106569961B (en) A cache module based on memory access address continuity and its memory access method
CN1224896C (en) Microprocessor Architecture for Critical Section Control
CN112162855B (en) GPU page miss processing method, system and medium based on page-locked memory
CN100583028C (en) Method for fetching instruction in processor, fetching device and processor comprising fetching device
CN1725216A (en) Shared library text copy method and apparatus for supporting cross-fork system calls
CN1794185A (en) Resources calling method in multiline range process
CN1746849A (en) Interpretation method in a kind of binary translation
CN1269043C (en) Remapping method of memory address
CN1248109C (en) Information processing unit and information processing method
JP3590282B2 (en) Stop point interrupt generator for superscalar microprocessor
Chen et al. Parallelization of AdaBoost algorithm on multi-core processors
CN1529229A (en) Optimal Processing Method of Flag Bits in Binary Translation

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20051026

Termination date: 20131213