WO2015186170A1 - Calculation circuit diagnostic device and calculation circuit diagnostic program - Google Patents

Calculation circuit diagnostic device and calculation circuit diagnostic program Download PDF

Info

Publication number
WO2015186170A1
WO2015186170A1 PCT/JP2014/064598 JP2014064598W WO2015186170A1 WO 2015186170 A1 WO2015186170 A1 WO 2015186170A1 JP 2014064598 W JP2014064598 W JP 2014064598W WO 2015186170 A1 WO2015186170 A1 WO 2015186170A1
Authority
WO
WIPO (PCT)
Prior art keywords
circuit
arithmetic
diagnostic
expression
value
Prior art date
Application number
PCT/JP2014/064598
Other languages
French (fr)
Japanese (ja)
Inventor
怜也 市岡
Original Assignee
三菱電機株式会社
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 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to PCT/JP2014/064598 priority Critical patent/WO2015186170A1/en
Publication of WO2015186170A1 publication Critical patent/WO2015186170A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing

Definitions

  • the present invention relates to a technique for diagnosing an arithmetic circuit.
  • Walking-bit is a method in which the input value is changed bit by bit, and it is determined whether an expected value for the input value is obtained for each input value. If the expected value for at least one of the input values cannot be obtained, it is determined that the arithmetic unit is out of order. Walking-bit is disclosed in Non-Patent Document 1.
  • the total data size of expected values reaches several hundred kilobytes.
  • the walking-bit cannot be applied.
  • An object of the present invention is to reduce the storage capacity necessary for diagnosing an arithmetic circuit.
  • the arithmetic circuit diagnostic apparatus of the present invention is Using a first reference circuit that is an arithmetic circuit that obtains a correct calculation result, a reference calculation unit that calculates a first reference calculation expression; Using a first diagnostic circuit that is an arithmetic circuit to be diagnosed, a diagnostic arithmetic unit that calculates a first diagnostic arithmetic expression that obtains the same arithmetic result as the first reference arithmetic expression; The operation result of the first diagnostic operation expression calculated by the diagnosis operation unit is compared with the operation result of the first reference operation expression calculated by the reference operation unit, and the first result is calculated based on the comparison result. And an arithmetic circuit diagnostic unit that determines whether the diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result.
  • another arithmetic circuit can be diagnosed using an arithmetic circuit that can obtain a correct arithmetic result. As a result, it is not necessary to store an expected value to be compared with the calculation result of another arithmetic circuit, and the storage capacity necessary for diagnosing the other arithmetic circuit is reduced.
  • FIG. 1 is a configuration diagram of an embedded system 100 according to Embodiment 1.
  • FIG. 3 is a diagram illustrating a plurality of arithmetic circuits provided in the CPU 101 in Embodiment 1.
  • FIG. 3 is a flowchart illustrating arithmetic circuit diagnosis processing of the embedded system 100 according to the first embodiment. Is a table showing the relationship between the operation result of the arithmetic operation result and diagnostic calculating formula Z 2 reference arithmetic expression Z 1 in the first embodiment.
  • 3 is a diagram illustrating a relationship among a plurality of arithmetic circuits in Embodiment 1.
  • FIG. 2 is a hardware configuration diagram of the embedded system 100 according to Embodiment 1.
  • FIG. 1 is a configuration diagram of an embedded system 100 according to Embodiment 1.
  • FIG. 3 is a diagram illustrating a plurality of arithmetic circuits provided in the CPU 101 in Embodiment 1.
  • FIG. 3 is a flowchart illustrating arith
  • Embodiment 1 FIG. A mode for reducing the storage capacity necessary for diagnosing the arithmetic circuit will be described.
  • FIG. 1 is a configuration diagram of an embedded system 100 according to the first embodiment.
  • the configuration of the embedded system 100 in the first embodiment will be described with reference to FIG. However, the configuration of the embedded system 100 may not be the same as the configuration shown in FIG.
  • the embedded system 100 (an example of a logic circuit diagnostic device) is a computer that is embedded in an electronic device such as a home appliance or an FA device, and is an example of an information processing device that performs information processing by the CPU 101.
  • FA is an abbreviation for Factory Automation.
  • the embedded system 100 includes a CPU 101, a basic circuit diagnosis unit 110, a reference operation unit 120, a diagnosis operation unit 130, an operation circuit diagnosis unit 140, a diagnosis result output unit 150, and a diagnosis storage unit 190.
  • the CPU 101 includes a plurality of arithmetic circuits that perform different types of operations such as four arithmetic operations, logical operations, and shift operations.
  • the arithmetic circuit is also called an arithmetic unit or an arithmetic device.
  • the basic circuit diagnosis unit 110 calculates a reference arithmetic expression using a reference circuit. Then, the basic circuit diagnosis unit 110 determines whether the reference circuit is a normal operation circuit that can obtain a correct operation result based on the operation result of the reference operation expression.
  • the reference circuit is a predetermined arithmetic circuit among a plurality of arithmetic circuits provided in the CPU 101.
  • the reference arithmetic expression is an arithmetic expression including an operation performed by the reference circuit. The reference arithmetic expression is determined in advance.
  • the reference arithmetic unit 120 calculates a reference arithmetic expression using a reference circuit.
  • the reference circuit is a basic circuit that is determined by the basic circuit diagnosis unit 110 to be a normal arithmetic circuit.
  • the reference arithmetic expression is an arithmetic expression including an operation performed by the reference circuit or an arithmetic expression including an operation performed by the reference circuit.
  • the reference arithmetic expression is determined in advance.
  • the diagnostic calculation unit 130 calculates a diagnostic calculation formula using a diagnostic circuit.
  • the diagnostic circuit is an arithmetic circuit for diagnosing whether a correct arithmetic result is obtained from among a plurality of arithmetic circuits provided in the CPU 101.
  • the diagnosis arithmetic expression is an arithmetic expression that obtains the same operation result as the reference arithmetic expression.
  • the diagnostic arithmetic expression is an arithmetic expression including an arithmetic operation performed by the diagnostic circuit or an arithmetic expression including an arithmetic operation performed by the diagnostic circuit.
  • the diagnostic calculation formula is determined in advance.
  • the arithmetic circuit diagnosis unit 140 compares the operation result of the diagnostic operation expression calculated by the diagnosis operation unit 130 with the operation result of the reference operation expression calculated by the reference operation unit 120, and correct operation of the diagnosis circuit based on the comparison result It is determined whether the result is a normal arithmetic circuit that can obtain a result.
  • the diagnosis result output unit 150 outputs the diagnosis results of a plurality of arithmetic circuits provided in the CPU 101 based on the determination result of the determination by the arithmetic circuit diagnosis unit 140. For example, when all the arithmetic circuits are normal arithmetic circuits, the diagnostic result output unit 150 outputs a message indicating that all the arithmetic circuits are operating normally as a diagnostic result. For example, when the first arithmetic circuit is not a normal arithmetic circuit but an abnormal arithmetic circuit, the diagnostic result output unit 150 outputs a message indicating that the first arithmetic circuit has failed as a diagnostic result.
  • the diagnostic storage unit 190 stores data used, generated, or input / output by the embedded system 100.
  • the diagnosis storage unit 190 stores a reference calculation result 191, a diagnosis calculation result 192, a diagnosis result file 193, an expected value table 199, and the like.
  • the reference calculation result 191 is data indicating the calculation result of the reference calculation expression calculated by the reference calculation unit 120.
  • the diagnostic calculation result 192 is data indicating the calculation result of the diagnostic calculation formula calculated by the diagnostic calculation unit 130.
  • the diagnosis result file 193 is data indicating the diagnosis result.
  • the expected value table 199 is data used for diagnosing the basic circuit.
  • the expected value table 199 includes the correct operation result (expected value) of the operation expression in association with the input value (operand) input to the operation circuit.
  • the input value corresponds to an assigned value to be assigned to the arithmetic expression.
  • FIG. 2 is a diagram illustrating a plurality of arithmetic circuits provided in the CPU 101 in the first embodiment.
  • a plurality of arithmetic circuits provided in the CPU 101 in Embodiment 1 will be described with reference to FIG.
  • the CPU 101 may include arithmetic circuits other than the plurality of arithmetic circuits illustrated in FIG. Further, the CPU 101 may not include at least one of the arithmetic circuits illustrated in FIG.
  • the CPU 101 includes an addition circuit 201, a subtraction circuit 202, a multiplication circuit 203, and a division circuit 204. These are arithmetic circuits that perform four arithmetic operations.
  • the adder circuit 201 is an arithmetic circuit that performs addition.
  • the subtraction circuit 202 is an arithmetic circuit that performs subtraction.
  • the multiplication circuit 203 is an arithmetic circuit that performs multiplication.
  • the division circuit 204 is an arithmetic circuit that performs division.
  • the CPU 101 includes an OR circuit 211, an AND circuit 212, an exclusive OR circuit 213, a logic NOT circuit 214, and a sign inversion circuit 215. These are arithmetic circuits that perform logical operations.
  • the logical sum circuit 211 is an arithmetic circuit for obtaining a logical sum.
  • the logical product circuit 212 is an arithmetic circuit for obtaining a logical product.
  • the exclusive OR circuit 213 is an arithmetic circuit for obtaining an exclusive OR.
  • the logical negation circuit 214 is an arithmetic circuit that performs logical negation that inverts a bit value included in a bit string representing a binary value.
  • the sign inversion circuit 215 is an arithmetic circuit that performs sign inversion to invert the bit value of the sign bit in the bit string including the sign bit representing the sign (positive or negative). The sign bit is the most significant bit (leftmost bit).
  • the CPU 101 includes a left shift circuit 221, an arithmetic right shift circuit 222, and a logical right shift circuit 223. These are arithmetic circuits for performing a shift operation.
  • the left shift circuit 221 is an arithmetic circuit that performs a left shift that shifts a bit value included in a bit string to the left.
  • the arithmetic right shift circuit 222 is an arithmetic circuit that performs an arithmetic right shift that shifts the bit value included in the bit string to the right except the bit value of the sign bit.
  • the logical right shift circuit 223 is an arithmetic circuit that performs a logical right shift that shifts the bit value included in the bit string including the bit value of the sign bit to the right.
  • FIG. 3 is a flowchart showing arithmetic circuit diagnosis processing of the embedded system 100 according to the first embodiment.
  • An arithmetic circuit diagnosis process of the embedded system 100 according to the first embodiment will be described with reference to FIG. However, the arithmetic circuit diagnosis process may not be the same as the process shown in FIG.
  • the basic circuit diagnosis unit 110 calculates an addition operation expression using the adder circuit 201, and determines whether the adder circuit 201 is a normal operation circuit based on the operation result.
  • the addition arithmetic expression is an arithmetic expression including addition, and is an example of a reference arithmetic expression.
  • the adder circuit 201 is an example of a basic circuit.
  • the basic circuit diagnosis unit 110 determines whether the adder circuit 201 is a normal arithmetic circuit by a technique called walking-bit.
  • walking-bit discloses the walking-bit.
  • the basic circuit diagnosis unit 110 determines whether the adder circuit 201 is a normal arithmetic circuit as follows.
  • the basic circuit diagnosis unit 110 inputs an input value to the adder circuit 201 to cause the adder circuit 201 to calculate an addition operation expression.
  • the basic circuit diagnosis unit 110 acquires the expected value associated with the input value from the expected value table 199.
  • the basic circuit diagnosis unit 110 compares the operation result obtained by the adder circuit 201 with the acquired expected value, and determines whether the adder circuit 201 is a normal operation circuit based on the comparison result. When the calculation result is the same as the expected value, the addition circuit 201 is a normal calculation circuit. When the calculation result is different from the expected value, the adding circuit 201 is not a normal calculation circuit but a failed calculation circuit (abnormal calculation circuit).
  • the basic circuit diagnosis unit 110 may generate a plurality of input values by a technique called walking-bit. When a technique called walking-bit is used, a plurality of input values are generated by shifting a bit having a bit value of 1.
  • the basic circuit diagnosis unit 110 may acquire an input value from the expected value table 199 or the like.
  • the adder circuit 201 is a normal calculation circuit.
  • the addition circuit 201 is not a normal calculation circuit. This is the end of the description of S101.
  • the basic circuit diagnosis unit 110 calculates a logical negation expression using the logic negation circuit 214, and determines whether the logic negation circuit 214 is a normal computation circuit based on the computation result.
  • the logical negation arithmetic expression is an arithmetic expression including logical negation, and is an example of a reference arithmetic expression.
  • the logic negation circuit 214 is an example of a basic circuit.
  • the method for determining whether the logical negation circuit 214 is a normal arithmetic circuit is the same as the method for determining whether the adder circuit 201 is a normal arithmetic circuit in S101. This is the end of the description of S102.
  • the basic circuit diagnosis unit 110 calculates a logical sum operation expression using the logical sum circuit 211, and determines whether the logical sum circuit 211 is a normal arithmetic circuit based on the calculation result.
  • the logical sum arithmetic expression is an arithmetic expression composed of logical sum and is an example of a reference arithmetic expression.
  • the OR circuit 211 is an example of a basic circuit. The method for determining whether the OR circuit 211 is a normal arithmetic circuit is the same as the method for determining whether the adder circuit 201 is a normal arithmetic circuit in S101. This is the end of the description of S103.
  • S101 to S103 may be in any order. After S101 to S103 are completed, the process proceeds from S111 to S114. However, if it is determined in S101 that the adding circuit 201 is not a normal arithmetic circuit, the process does not proceed to S111 and S112. If it is determined in S102 that the logical negation circuit 214 is not a normal arithmetic circuit, the process does not proceed to S112, S113, and S114. If it is determined in S103 that the OR circuit 211 is not a normal arithmetic circuit, the process does not proceed to S114. If the process does not proceed to any of S111 to S114, the process proceeds to S190.
  • the reference operation unit 120 inputs the input value (X, Y) to the adder circuit 201 (an example of the first reference circuit), thereby causing the adder circuit 201 to input a reference operation expression for the multiplier circuit (first An example of a reference arithmetic expression) is calculated.
  • the adder circuit 201 is a normal arithmetic circuit.
  • the diagnostic operation unit 130 inputs the same input value as the input value input to the addition circuit 201 to the multiplication circuit 203 (an example of the first diagnosis circuit), thereby causing the multiplication circuit 203 to perform a diagnostic operation for the multiplication circuit.
  • An expression (an example of a first diagnostic calculation expression) is calculated.
  • the diagnostic arithmetic expression for the multiplication circuit is an arithmetic expression that obtains the same calculation result as the reference arithmetic expression for the multiplication circuit. Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and whether the multiplication circuit 203 is a normal operation circuit based on the comparison result. judge. When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the multiplication circuit 203 is a normal calculation circuit.
  • the reference calculation unit 120 may generate a plurality of input values by a technique called walking-bit.
  • Non-patent document 1 discloses the walking-bit.
  • the multiplication circuit 203 is a normal calculation circuit.
  • the operation result obtained by the reference operation unit 120 differs from the operation result obtained by the diagnosis operation unit 130 for at least one of the input values, the multiplication circuit 203 is not a normal operation circuit.
  • the reference arithmetic expression for the multiplication circuit is an arithmetic expression for obtaining a value obtained by adding the Y values X by addition.
  • This reference arithmetic expression is represented by X + X +.
  • the number of X is Y.
  • the diagnostic arithmetic expression for the multiplication circuit is an arithmetic expression for obtaining a value obtained by multiplying the value X by the value Y by multiplication.
  • the diagnostic arithmetic expression for the multiplier circuit is an arithmetic expression that can obtain the same arithmetic result as the reference arithmetic expression for the multiplier circuit.
  • “nnnnb” means that “nnnn” is a binary value.
  • Figure 4 is a table showing a relationship between the operation result of the arithmetic operation result and diagnostic calculating formula Z 2 reference arithmetic expression Z 1 in the first embodiment.
  • the reference calculation unit 120 adds the input values (X, Y) to the addition circuit 201 (an example of the first reference circuit) or the logical negation circuit 214 (an example of the second reference circuit).
  • the circuit 201 and the logic negation circuit 214 are caused to calculate a reference arithmetic expression (an example of a first reference arithmetic expression) for the subtraction circuit.
  • the adder circuit 201 and the logic negation circuit 214 are normal arithmetic circuits.
  • the diagnostic operation unit 130 also subtracts the subtraction circuit 202 by inputting the same input value as the input value input to the addition circuit 201 or the logical negation circuit 214 to the subtraction circuit 202 (an example of the first diagnosis circuit).
  • a diagnostic arithmetic expression for the circuit (an example of a first diagnostic arithmetic expression) is calculated.
  • the diagnostic arithmetic expression for the subtraction circuit is an arithmetic expression that obtains the same operation result as the reference arithmetic expression for the subtraction circuit.
  • the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and whether the subtraction circuit 202 is a normal operation circuit based on the comparison result. judge.
  • the subtraction circuit 202 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • the reference arithmetic expression for the subtraction circuit obtains the value obtained by inverting the sign of the value Y by obtaining the one's complement of the value Y by logical negation and adding 1 to the one's complement of the value Y.
  • This is an arithmetic expression for obtaining a value obtained by subtracting the value Y from the value X by adding a value obtained by inverting the sign of the value Y to X.
  • This reference arithmetic expression is represented by X + ( ⁇ Y + 1).
  • ⁇ Y means the logical negation of Y, that is, the one's complement of Y.
  • the one's complement of the value Y is a value represented by a bit string obtained by inverting the bit value included in the bit string representing the value Y in binary.
  • the value obtained by inverting the sign of the value Y is a value corresponding to the two's complement of the value Y.
  • the diagnostic arithmetic expression for the subtraction circuit is an arithmetic expression for obtaining a value obtained by subtracting the value Y from the value X by subtraction.
  • This diagnostic arithmetic expression is represented by XY.
  • XY X + ( ⁇ Y + 1) holds. That is, the diagnostic calculation formula for the subtraction circuit is a calculation formula that can obtain the same calculation result as the reference calculation formula for the subtraction circuit.
  • the reference operation unit 120 inputs the input value (X) to the logic negation circuit 214 (an example of the first reference circuit), whereby the reference operation expression for the sign inverting circuit (first An example of the reference calculation formula is calculated.
  • the logic negation circuit 214 is a normal arithmetic circuit.
  • the diagnostic operation unit 130 inputs the same input value as the input value input to the logic negation circuit 214 to the sign inversion circuit 215 (an example of the first diagnosis circuit), whereby the sign inversion circuit 215 receives the sign inversion circuit. Diagnostic calculation formula (an example of the first diagnostic calculation formula) is calculated.
  • the diagnostic arithmetic expression for the sign inversion circuit is an arithmetic expression that can obtain the same operation result as the reference arithmetic expression for the sign inversion circuit.
  • the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and the sign inversion circuit 215 is a normal operation circuit based on the comparison result. To determine.
  • the sign inversion circuit 215 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • the reference arithmetic expression for the sign inverting circuit is an arithmetic expression that obtains a value obtained by inverting the sign of the value X by obtaining the one's complement of the value X by logical negation and adding 1 to the one's complement of the value X. It is.
  • This reference arithmetic expression is represented by ( ⁇ X + 1).
  • the diagnostic arithmetic expression for the sign inversion circuit is an arithmetic expression for obtaining a value obtained by inverting the sign of the value X by sign inversion.
  • This diagnostic arithmetic expression is represented by NEG X.
  • the reference operation unit 120 inputs the input values (X, Y) to the logical NOT circuit 214 (an example of the first reference circuit) or the logical sum circuit 211 (an example of the second reference circuit).
  • the logical negation circuit 214 and the logical sum circuit 211 are caused to calculate a reference arithmetic expression (an example of a first reference arithmetic expression) for the AND circuit.
  • the logical negation circuit 214 and the logical sum circuit 211 are normal arithmetic circuits.
  • the diagnostic operation unit 130 inputs the same input value as the input value input to the logical NOT circuit 214 or the logical sum circuit 211 to the logical product circuit 212 (an example of the first diagnostic circuit).
  • a diagnostic operation expression for an AND circuit is an operation expression that obtains the same operation result as a reference operation expression for an AND circuit. Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and the logical product circuit 212 is a normal operation circuit based on the comparison result. To determine. When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the sign inversion circuit 215 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • the reference arithmetic expression for the logical product circuit calculates the logical sum of the X bit string representing the value X and the Y bit string representing the value Y, and inverts the bit value included in the logical sum bit string representing the obtained logical sum.
  • This is an arithmetic expression for obtaining a bit string by logical negation.
  • This reference arithmetic expression is represented by ⁇ (A OR B).
  • OR means logical sum.
  • a diagnostic operation expression for a logical product circuit obtains an inverted X bit string obtained by inverting a bit value included in an X bit string and an inverted Y bit string obtained by inverting a bit value included in a Y bit string by logical negation, and an inverted X bit string.
  • This diagnostic arithmetic expression is represented by ( ⁇ A) AND ( ⁇ B).
  • AND means a logical product.
  • ( ⁇ A) AND ( ⁇ B) ⁇ (A OR B) holds.
  • the logical AND circuit diagnostic arithmetic expression is an arithmetic expression that obtains the same operation result as the AND circuit reference arithmetic expression.
  • S111 to S114 may be out of order. After S111 to S114 are completed, the process proceeds from S121 to S123. However, if it is determined in S111 that the multiplication circuit 203 is not a normal arithmetic circuit, the process does not proceed to S121. If it is determined in S112 that the subtraction circuit 202 is not a normal arithmetic circuit, the process does not proceed to S122. If it is determined in S114 that the logical product circuit 212 is not a normal arithmetic circuit, the process does not proceed to S123. If the process does not proceed to any of S121 to S123, the process proceeds to S190.
  • the reference calculation unit 120 inputs the input value (X, Y) to the multiplication circuit 203 (an example of the first diagnostic circuit or the first reference circuit), thereby causing the multiplication circuit 203 to use the left shift circuit.
  • a reference arithmetic expression (second reference arithmetic expression or an example of the first reference arithmetic expression) is calculated.
  • the multiplier circuit 203 is a normal arithmetic circuit.
  • the diagnostic operation unit 130 inputs the same input value as the input value input to the multiplication circuit 203 to the left shift circuit 221 (second diagnostic circuit or an example of the first diagnostic circuit), whereby the left shift circuit 221 causes the left shift circuit diagnostic arithmetic expression (second diagnostic arithmetic expression or an example of the first diagnostic arithmetic expression) to be calculated.
  • the diagnostic operation expression for the left shift circuit is an operation expression that obtains the same operation result as the reference operation expression for the left shift circuit.
  • the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and the left shift circuit 221 is a normal operation circuit based on the comparison result. To determine. When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the left shift circuit 221 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • the reference arithmetic expression for the left shift circuit is an arithmetic expression that obtains a value obtained by multiplying a value X by a power of 2 to a value obtained by multiplying the value X by a power of 2 to the Y power.
  • This reference arithmetic expression is represented by X * 2 ⁇ Y.
  • 2 ⁇ Y means 2 to the power of Y.
  • the diagnostic arithmetic expression for the left shift circuit is an arithmetic expression for obtaining a value represented by a bit string obtained by shifting the bit string representing the value X to the left by Y bits by left shift. This diagnostic arithmetic expression is represented by X ⁇ Y.
  • X ⁇ Y means that the bit string representing the value X is shifted to the left by Y bits.
  • X ⁇ Y X * 2 ⁇ Y holds.
  • the diagnostic calculation formula for the left shift circuit is a calculation formula that obtains the same calculation result as the reference calculation formula for the left shift circuit.
  • the reference operation unit 120 inputs the input value (X, Y) to the subtraction circuit 202 (an example of the first diagnostic circuit or the first reference circuit), thereby causing the subtraction circuit 202 to reference the division circuit.
  • An arithmetic expression (second reference arithmetic expression or an example of the first reference arithmetic expression) is calculated.
  • the subtraction circuit 202 is a normal arithmetic circuit.
  • the diagnostic operation unit 130 inputs the same input value as the input value input to the subtracting circuit 202 to the dividing circuit 204 (second diagnostic circuit or an example of the first diagnostic circuit), whereby the dividing circuit 204 is input.
  • a diagnostic arithmetic expression for the division circuit (an example of the second diagnostic arithmetic expression or the first diagnostic arithmetic expression) is calculated.
  • the diagnostic arithmetic expression for the divider circuit is an arithmetic expression that obtains the same calculation result as the reference arithmetic expression for the divider circuit.
  • the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and whether the division circuit 204 is a normal operation circuit based on the comparison result. judge.
  • the division circuit 204 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • the reference arithmetic expression for the division circuit is an arithmetic expression for obtaining a value representing the number of times the value Y can be subtracted from the value X by subtraction.
  • This reference arithmetic expression is represented by (XY ⁇ Y... ⁇ Y).
  • (XY ⁇ Y... ⁇ Y) means that the number of times that the value Y can be subtracted from the value X is counted.
  • the diagnostic arithmetic expression for the division circuit is an arithmetic expression for obtaining a quotient obtained by dividing the value X by the value Y by division.
  • the reference operation unit 120 performs an AND circuit 212 (an example of a first diagnostic circuit), a logical NOT circuit 214 (an example of a first reference circuit), or an OR circuit 211 (an example of a second reference circuit).
  • an AND circuit 212 an example of a first diagnostic circuit
  • a logical NOT circuit 214 an example of a first reference circuit
  • an OR circuit 211 an example of a second reference circuit.
  • the diagnostic operation unit 130 inputs the same input value as the input value input to the logical product circuit 212, the logical NOT circuit 214, or the logical sum circuit 211 to the exclusive OR circuit 213 (an example of a second diagnostic circuit).
  • the exclusive OR circuit 213 is caused to calculate a diagnostic operation expression for the exclusive OR circuit (an example of the second diagnosis operation expression).
  • the diagnostic operation expression for the exclusive OR circuit is an operation expression that obtains the same operation result as the reference operation expression for the exclusive OR circuit.
  • the arithmetic circuit diagnostic unit 140 compares the arithmetic result obtained by the reference arithmetic unit 120 with the arithmetic result obtained by the diagnostic arithmetic unit 130, and the exclusive OR circuit 213 is a normal arithmetic circuit based on the comparison result. It is determined whether it is.
  • the exclusive OR circuit 213 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • a reference arithmetic expression for an exclusive OR circuit obtains an inverted X bit string and an inverted Y bit string by logical negation, obtains a first AND bit string and a second AND bit string, This is an arithmetic expression for obtaining a logical sum of a logical product bit string and a second logical product bit string.
  • the inverted X bit string is a bit string obtained by inverting the bit value included in the X bit string representing the value X
  • the inverted Y bit string is a bit string obtained by inverting the bit value included in the Y bit string representing the value Y.
  • the first AND bit string is a bit string that represents the logical product of the X bit string and the inverted Y bit string
  • the second AND bit string is a bit string that represents the logical product of the inverted X bit string and the Y bit string.
  • This reference arithmetic expression is represented by (X AND ⁇ Y) OR ( ⁇ X AND Y).
  • the diagnostic arithmetic expression for the exclusive OR circuit is an arithmetic expression for obtaining an exclusive OR of the X bit string and the Y bit string.
  • This diagnostic arithmetic expression is represented by X XOR Y.
  • XOR means exclusive OR.
  • the diagnostic operation expression for the exclusive OR circuit is an operation expression that obtains the same operation result as the reference operation expression for the exclusive OR circuit.
  • S121 to S123 may be out of order. After S121 to S123 are completed, the process proceeds to S131. However, if it is determined in S122 that the division circuit 204 is not a normal arithmetic circuit, the process proceeds to S190 instead of S131.
  • the reference calculation unit 120 inputs input values (X, X, D) to the division circuit 204 (an example of the second diagnostic circuit or the first reference circuit) or the multiplication circuit 203 (an example of the normal calculation circuit or the second reference circuit).
  • the division circuit 204 and the multiplication circuit 203 are caused to calculate the reference arithmetic expression (an example of the third reference arithmetic expression or the first reference arithmetic expression) for the arithmetic right shift circuit.
  • the division circuit 204 and the multiplication circuit 203 are normal arithmetic circuits.
  • the diagnostic calculation unit 130 inputs the same input value as the input value input to the division circuit 204 or the multiplication circuit 203 to the arithmetic right shift circuit 222 (an example of the third diagnosis circuit or the first reference circuit).
  • the arithmetic right shift circuit 222 is caused to calculate a diagnostic arithmetic expression for the arithmetic right shift circuit (a third diagnostic arithmetic expression or an example of the first diagnostic arithmetic expression).
  • the diagnostic arithmetic expression for the arithmetic right shift circuit is an arithmetic expression that obtains the same operation result as the reference arithmetic expression for the arithmetic right shift circuit.
  • the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and based on the comparison result, the arithmetic right shift circuit 222 is a normal operation circuit. Determine if there is.
  • the arithmetic right shift circuit 222 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • the reference arithmetic expression for the arithmetic right shift circuit is an arithmetic expression that obtains a quotient obtained by dividing the value X by 2 to the Y power by obtaining 2 to the Y power by division.
  • This reference arithmetic expression is represented by X / (2 ⁇ Y).
  • a diagnostic arithmetic expression for an arithmetic right shift circuit is an arithmetic expression that obtains a value represented by a bit string obtained by shifting a bit string representing a value X to the right by Y bits excluding a sign bit representing a sign of the value X by arithmetic right shift.
  • This diagnostic arithmetic expression is represented by X SHARY Y.
  • SHA means arithmetic right shift.
  • X SHARY Y X / (2 ⁇ Y) holds. That is, the diagnostic arithmetic expression for the arithmetic right shift circuit is an arithmetic expression that obtains the same arithmetic result as the reference arithmetic expression for the arithmetic right shift circuit.
  • the process proceeds to S141. However, if it is determined in S131 that the arithmetic right shift circuit 222 is not a normal arithmetic circuit, the process proceeds to S190 instead of S141.
  • the reference operation unit 120 transfers the arithmetic right shift circuit 222 (an example of the third diagnostic circuit or the first reference circuit) or the exclusive OR circuit 213 (an example of the normal operation circuit or the second reference circuit).
  • the arithmetic right shift circuit 222 and the exclusive OR circuit 213 receive the reference arithmetic expression (fourth reference arithmetic expression or first reference arithmetic expression) for the logical right shift circuit. (Example).
  • the arithmetic right shift circuit 222 and the exclusive OR circuit 213 are normal arithmetic circuits.
  • diagnosis operation unit 130 applies the same input value as the input value input to the arithmetic right shift circuit 222 or the exclusive OR circuit 213 to the logical right shift circuit 223 (an example of the fourth diagnosis circuit or the first diagnosis circuit). ) causes the logical right shift circuit 223 to calculate a logical arithmetic expression for the logical right shift circuit (a fourth diagnostic arithmetic expression or an example of the first diagnostic arithmetic expression).
  • the diagnostic arithmetic expression for the logical right shift circuit is an arithmetic expression that obtains the same arithmetic result as the reference arithmetic expression for the logical right shift circuit.
  • the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and based on the comparison result, the logical right shift circuit 223 is a normal operation circuit. Determine if there is.
  • the logical right shift circuit 223 is a normal calculation circuit.
  • the reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
  • the reference arithmetic expression for the logical right shift circuit is an arithmetic expression for obtaining a logical sum of a maximum value bit string and a shift bit string by obtaining a shift bit string by arithmetic right shift.
  • the shift bit string is a bit string obtained by shifting the X bit string representing the value X to the right by Y bits excluding the X code bit representing the sign of the value X.
  • the maximum value bit string is a bit string composed of a sign bit having a bit value of 0 and another bit having a bit value of 1, that is, a bit string representing a positive maximum value.
  • This reference arithmetic expression is represented by (X SHA Y) AND 0x7FFFFFFF.
  • 0x7FFFFFFFF means the maximum value bit string.
  • a diagnostic arithmetic expression for a logical right shift circuit is an arithmetic expression for obtaining a bit string obtained by shifting an X bit string (including an X sign bit) to the right by Y bits by a logical right shift.
  • This diagnostic arithmetic expression is represented by X SHLR Y.
  • SHLR means a logical right shift.
  • X SHLR Y (X SHA Y) AND 0x7FFFFFFF holds. That is, the reference arithmetic expression for the logical right shift circuit is an arithmetic expression that obtains the same operation result as the diagnostic arithmetic expression for the logical right shift circuit.
  • the diagnosis result output unit 150 outputs the diagnosis results of a plurality of arithmetic circuits included in the CPU 101 based on the determination results of S101 to S141. After S190, the arithmetic circuit diagnosis process ends.
  • FIG. 5 is a diagram illustrating a relationship among a plurality of arithmetic circuits in the first embodiment.
  • the arithmetic circuit at the start point of the arrow is a normal arithmetic circuit that calculates the reference arithmetic expression
  • the arithmetic circuit at the end point of the arrow is a diagnostic circuit that calculates the diagnostic arithmetic expression.
  • the adder circuit 201 and the logic negation circuit 214 are arithmetic circuits at the start point of an arrow indicating the subtractor circuit 202, and therefore calculate a reference arithmetic expression for the subtractor circuit.
  • the subtraction circuit 202 is an arithmetic circuit at the end point of the arrow, it calculates a diagnostic arithmetic expression for the subtraction circuit.
  • FIG. 6 is a hardware configuration diagram of the embedded system 100 according to the first embodiment.
  • a hardware configuration of the embedded system 100 according to the first embodiment will be described with reference to FIG.
  • the hardware configuration of the embedded system 100 may not be the same as the configuration shown in FIG.
  • the embedded system 100 is a computer including an arithmetic device 901, an auxiliary storage device 902, a main storage device 903, a communication device 904, and an input / output device 905.
  • the arithmetic device 901, auxiliary storage device 902, main storage device 903, communication device 904, and input / output device 905 are connected to the bus 909.
  • the arithmetic device 901 is a CPU (Central Processing Unit) that executes a program.
  • the auxiliary storage device 902 is, for example, a ROM (Read Only Memory), a flash memory, or a hard disk device.
  • the main storage device 903 is, for example, a RAM (Random Access Memory).
  • the communication device 904 performs communication via the Internet, a LAN (local area network), a telephone line network, or other networks in a wired or wireless manner.
  • the input / output device 905 is, for example, a mouse, a keyboard, or a display device.
  • the program is stored in the auxiliary storage device 902.
  • an operating system OS
  • a program for realizing the function described as “ ⁇ unit” is stored in the auxiliary storage device 902.
  • the program is stored in the auxiliary storage device 902, loaded into the main storage device 903, read into the arithmetic device 901, and executed by the arithmetic device 901.
  • Embodiment 1 proposes a technique for reducing the storage capacity necessary for storing an expected value. Specifically, two expressions that use different arithmetic circuits with the same result are calculated, and the respective results are compared. If the results match, it is determined that there is no failure, and if the results do not match, it is determined that there is a failure. However, for the adder circuit 201, the logical NOT circuit 214, and the logical sum circuit 211 that are the basis of all the arithmetic circuits, the expected value of the operation result is stored in the storage unit, the operation result is compared with the expected value, Based on the failure detection.
  • the following effects can be obtained.
  • a failure of the arithmetic circuit of the CPU 101 can be detected.
  • the storage capacity for storing the expected value can be reduced. Since it can be realized by software, it is not necessary to add hardware for diagnosis and can be realized at low cost. Since it corresponds to general operations such as four arithmetic operations, logical operations, and shift operations, it can be applied to various CPUs 101.
  • the first embodiment is an example of a form of the embedded system 100. That is, the embedded system 100 may not include some of the components described in the first embodiment. Further, the embedded system 100 may include components that are not described in the first embodiment.
  • the embedded system 100 may be a device that diagnoses a plurality of arithmetic circuits included in another computer. At least one arithmetic circuit other than the adder circuit 201, the logical NOT circuit 214, and the logical sum circuit 211 may be diagnosed by the basic circuit diagnostic unit 110 using the expected value.
  • the processing procedure described in the first embodiment using a flowchart or the like is an example of the processing procedure of the method and program according to the first embodiment.
  • the method and program according to the first embodiment may be realized by a processing procedure that is partially different from the processing procedure described in the first embodiment.
  • “to part” can be read as “to process”, “to process”, “to program”, “to apparatus”, and the like.
  • 100 embedded system 101 CPU, 110 basic circuit diagnostic unit, 120 reference arithmetic unit, 130 diagnostic arithmetic unit, 140 arithmetic circuit diagnostic unit, 150 diagnostic result output unit, 190 diagnostic storage unit, 191 reference arithmetic result, 192 diagnostic arithmetic result, 193 diagnosis result file, 199 expected value table, 201 addition circuit, 202 subtraction circuit, 203 multiplication circuit, 204 division circuit, 211 logical sum circuit, 212 logical product circuit, 213 exclusive logical sum circuit, 214 logical negation circuit, 215 code Inversion circuit, 221 left shift circuit, 222 arithmetic right shift circuit, 223 logical right shift circuit, 901 arithmetic device, 902 auxiliary storage device, 903 main storage device, 904 communication device, 905 input / output device, 909 bus.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

A reference calculation unit (120) calculates the result of a first reference calculation expression by use of a first reference circuit which is one of a plurality of calculation circuits provided to a CPU (101), and with which it is possible to correctly calculate the result of a calculation expression. A diagnostic calculation unit (130) calculates the result of a first diagnostic calculation expression by use of a first circuit to be diagnosed, which is a calculation circuit to be diagnosed and is selected from among the plurality of calculation circuits provided to the CPU, said first diagnostic calculation expression having the same result as the first reference calculation expression. A calculation circuit diagnostic unit (140) compares the calculated result of the first diagnostic calculation expression, as calculated by the diagnostic calculation unit, with the calculated result of the first reference calculation expression, as calculated by the reference calculation unit, and determines, on the basis of the comparison result, whether the first circuit to be diagnosed is a calculation circuit with which it is possible to correctly calculate the result of a calculation expression.

Description

演算回路診断装置および演算回路診断プログラムArithmetic circuit diagnostic device and arithmetic circuit diagnostic program
 本発明は、演算回路を診断する技術に関するものである。 The present invention relates to a technique for diagnosing an arithmetic circuit.
 従来、walking-bitと呼ばれる手法を用いて、CPU(Central Processing Unit)に備わる演算器の診断が行われていた。walking-bitは入力値が1ビットずつ変更される手法であり、入力値毎に入力値に対する期待値が得られるか判定される。そして、少なくともいずれかの入力値に対する期待値が得られない場合、その演算器は故障していると判断される。walking-bitは非特許文献1に開示されている。 Conventionally, an arithmetic unit provided in a CPU (Central Processing Unit) has been diagnosed using a technique called walking-bit. Walking-bit is a method in which the input value is changed bit by bit, and it is determined whether an expected value for the input value is obtained for each input value. If the expected value for at least one of the input values cannot be obtained, it is determined that the arithmetic unit is out of order. Walking-bit is disclosed in Non-Patent Document 1.
 CPUの全ての演算器をwalking-bitで診断する場合、期待値の総データサイズが膨大になるという課題がある。
 例えば、“add R1 R2”という演算を行う加算器をwalking-bitで診断する場合、R1のパターン数にR2のパターン数を掛けた数と同じ個数の期待値が必要になる。つまり、R1が34パターンであり、R2が34パターンであれば、1156個(=34×34)の期待値が必要になる。そして、1つの期待値のデータサイズが32ビットであれば、期待値の総データサイズは約4キロバイト(=1156×32ビット)になる。
 また、CPUは複数の加算器を備え、各加算器は複数のアドレッシングモードを持つ。そのため、CPUの全ての演算器を診断しようとした場合、期待値の総データサイズは数百キロバイトに及ぶ。その場合、組込みシステムのように記憶容量が制限されているシステムに全ての期待値を記憶できないため、walking-bitを適用することはできない。
When all the arithmetic units of the CPU are diagnosed by walking-bit, there is a problem that the total data size of expected values becomes enormous.
For example, when an adder that performs the operation “add R1 R2” is diagnosed by walking-bit, the same number of expected values as the number of R1 patterns multiplied by the number of R2 patterns is required. That is, if R1 is 34 patterns and R2 is 34 patterns, 1156 (= 34 × 34) expected values are required. If the data size of one expected value is 32 bits, the total data size of the expected values is about 4 kilobytes (= 1156 × 32 bits).
Further, the CPU includes a plurality of adders, and each adder has a plurality of addressing modes. Therefore, when trying to diagnose all the arithmetic units of the CPU, the total data size of expected values reaches several hundred kilobytes. In this case, since all expected values cannot be stored in a system with a limited storage capacity such as an embedded system, the walking-bit cannot be applied.
特開2007-047893号公報JP 2007-047993 A 特開2002-318706号公報JP 2002-318706 A 特開平11-085554号公報Japanese Patent Laid-Open No. 11-085554 特開昭62-206642号公報JP 62-206642 A
 本発明は、演算回路を診断するために必要な記憶容量を削減できるようにすることを目的とする。 An object of the present invention is to reduce the storage capacity necessary for diagnosing an arithmetic circuit.
 本発明の演算回路診断装置は、
 正しい演算結果が得られる演算回路である第一の参照回路を用いて、第一の参照演算式を演算する参照演算部と、
 診断される演算回路である第一の診断回路を用いて、前記第一の参照演算式と同じ演算結果が求まる第一の診断演算式を演算する診断演算部と、
 前記診断演算部によって演算された前記第一の診断演算式の演算結果を前記参照演算部によって演算された前記第一の参照演算式の演算結果と比較し、比較結果に基づいて前記第一の診断回路が正しい演算結果が得られる演算回路であるか判定する演算回路診断部とを備える。
The arithmetic circuit diagnostic apparatus of the present invention is
Using a first reference circuit that is an arithmetic circuit that obtains a correct calculation result, a reference calculation unit that calculates a first reference calculation expression;
Using a first diagnostic circuit that is an arithmetic circuit to be diagnosed, a diagnostic arithmetic unit that calculates a first diagnostic arithmetic expression that obtains the same arithmetic result as the first reference arithmetic expression;
The operation result of the first diagnostic operation expression calculated by the diagnosis operation unit is compared with the operation result of the first reference operation expression calculated by the reference operation unit, and the first result is calculated based on the comparison result. And an arithmetic circuit diagnostic unit that determines whether the diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result.
 本発明によれば、正しい演算結果が得られる演算回路を用いて他の演算回路を診断することができる。これにより、他の演算回路の演算結果と比較する期待値を記憶する必要が無くなり、他の演算回路を診断するために必要な記憶容量が削減される。 According to the present invention, another arithmetic circuit can be diagnosed using an arithmetic circuit that can obtain a correct arithmetic result. As a result, it is not necessary to store an expected value to be compared with the calculation result of another arithmetic circuit, and the storage capacity necessary for diagnosing the other arithmetic circuit is reduced.
実施の形態1における組み込みシステム100の構成図である。1 is a configuration diagram of an embedded system 100 according to Embodiment 1. FIG. 実施の形態1におけるCPU101に備わる複数の演算回路を示す図である。3 is a diagram illustrating a plurality of arithmetic circuits provided in the CPU 101 in Embodiment 1. FIG. 実施の形態1における組み込みシステム100の演算回路診断処理を示すフローチャートである。3 is a flowchart illustrating arithmetic circuit diagnosis processing of the embedded system 100 according to the first embodiment. 実施の形態1における参照演算式Zの演算結果と診断演算式Zの演算結果との関係を示す表である。Is a table showing the relationship between the operation result of the arithmetic operation result and diagnostic calculating formula Z 2 reference arithmetic expression Z 1 in the first embodiment. 実施の形態1における複数の演算回路の関係を示す図である。3 is a diagram illustrating a relationship among a plurality of arithmetic circuits in Embodiment 1. FIG. 実施の形態1における組み込みシステム100のハードウェア構成図である。2 is a hardware configuration diagram of the embedded system 100 according to Embodiment 1. FIG.
 実施の形態1.
 演算回路を診断するために必要な記憶容量を削減する形態について説明する。
Embodiment 1 FIG.
A mode for reducing the storage capacity necessary for diagnosing the arithmetic circuit will be described.
 図1は、実施の形態1における組み込みシステム100の構成図である。
 実施の形態1における組み込みシステム100の構成について、図1に基づいて説明する。但し、組み込みシステム100の構成は図1に示す構成と同一でなくても構わない。
FIG. 1 is a configuration diagram of an embedded system 100 according to the first embodiment.
The configuration of the embedded system 100 in the first embodiment will be described with reference to FIG. However, the configuration of the embedded system 100 may not be the same as the configuration shown in FIG.
 組み込みシステム100(論理回路診断装置の一例)は、家電機器またはFA機器などの電子機器に組み込まれるコンピュータであり、CPU101によって情報処理を行う情報処理装置の一例である。FAはFactory Automationの略称である。
 組み込みシステム100は、CPU101と、基礎回路診断部110と、参照演算部120と、診断演算部130と、演算回路診断部140と、診断結果出力部150と、診断記憶部190とを備える。
The embedded system 100 (an example of a logic circuit diagnostic device) is a computer that is embedded in an electronic device such as a home appliance or an FA device, and is an example of an information processing device that performs information processing by the CPU 101. FA is an abbreviation for Factory Automation.
The embedded system 100 includes a CPU 101, a basic circuit diagnosis unit 110, a reference operation unit 120, a diagnosis operation unit 130, an operation circuit diagnosis unit 140, a diagnosis result output unit 150, and a diagnosis storage unit 190.
 CPU101は、四則演算、論理演算またはシフト演算などの異なる種類の演算を行う複数の演算回路を備える。演算回路は演算器または演算装置ともいう。 The CPU 101 includes a plurality of arithmetic circuits that perform different types of operations such as four arithmetic operations, logical operations, and shift operations. The arithmetic circuit is also called an arithmetic unit or an arithmetic device.
 基礎回路診断部110は、基準回路を用いて、基準演算式を演算する。そして、基礎回路診断部110は、基準演算式の演算結果に基づいて、基準回路が正しい演算結果が得られる正常な演算回路であるか判定する。
 基準回路は、CPU101に備わる複数の演算回路のうち、予め決められた一部の演算回路である。
 基準演算式は、基準回路が行う演算から成る演算式である。基準演算式は予め決められている。
The basic circuit diagnosis unit 110 calculates a reference arithmetic expression using a reference circuit. Then, the basic circuit diagnosis unit 110 determines whether the reference circuit is a normal operation circuit that can obtain a correct operation result based on the operation result of the reference operation expression.
The reference circuit is a predetermined arithmetic circuit among a plurality of arithmetic circuits provided in the CPU 101.
The reference arithmetic expression is an arithmetic expression including an operation performed by the reference circuit. The reference arithmetic expression is determined in advance.
 参照演算部120は、参照回路を用いて、参照演算式を演算する。
 参照回路は、基礎回路診断部110によって正常な演算回路であると判定された基礎回路である。
 参照演算式は、参照回路が行う演算から成る演算式、または、参照回路が行う演算を含んだ演算式である。参照演算式は予め決められている。
The reference arithmetic unit 120 calculates a reference arithmetic expression using a reference circuit.
The reference circuit is a basic circuit that is determined by the basic circuit diagnosis unit 110 to be a normal arithmetic circuit.
The reference arithmetic expression is an arithmetic expression including an operation performed by the reference circuit or an arithmetic expression including an operation performed by the reference circuit. The reference arithmetic expression is determined in advance.
 診断演算部130は、診断回路を用いて、診断演算式を演算する。
 診断回路は、CPU101に備わる複数の演算回路のうち、正しい演算結果が得られるか診断される演算回路である。
 診断演算式は、参照演算式と同じ演算結果が求まる演算式である。また、診断演算式は、診断回路が行う演算から成る演算式、または、診断回路が行う演算を含んだ演算式である。診断演算式は予め決められている。
The diagnostic calculation unit 130 calculates a diagnostic calculation formula using a diagnostic circuit.
The diagnostic circuit is an arithmetic circuit for diagnosing whether a correct arithmetic result is obtained from among a plurality of arithmetic circuits provided in the CPU 101.
The diagnosis arithmetic expression is an arithmetic expression that obtains the same operation result as the reference arithmetic expression. The diagnostic arithmetic expression is an arithmetic expression including an arithmetic operation performed by the diagnostic circuit or an arithmetic expression including an arithmetic operation performed by the diagnostic circuit. The diagnostic calculation formula is determined in advance.
 演算回路診断部140は、診断演算部130によって演算された診断演算式の演算結果を参照演算部120によって演算された参照演算式の演算結果と比較し、比較結果に基づいて診断回路が正しい演算結果が得られる正常な演算回路であるか判定する。 The arithmetic circuit diagnosis unit 140 compares the operation result of the diagnostic operation expression calculated by the diagnosis operation unit 130 with the operation result of the reference operation expression calculated by the reference operation unit 120, and correct operation of the diagnosis circuit based on the comparison result It is determined whether the result is a normal arithmetic circuit that can obtain a result.
 診断結果出力部150は、演算回路診断部140による判定の判定結果に基づいて、CPU101に備わる複数の演算回路の診断結果を出力する。
 例えば、全ての演算回路が正常な演算回路である場合、診断結果出力部150は、全ての演算回路が正常に動作している旨のメッセージを診断結果として出力する。
 例えば、第一の演算回路が正常な演算回路でなくて異常な演算回路である場合、診断結果出力部150は、第一の演算回路が故障した旨のメッセージを診断結果として出力する。
The diagnosis result output unit 150 outputs the diagnosis results of a plurality of arithmetic circuits provided in the CPU 101 based on the determination result of the determination by the arithmetic circuit diagnosis unit 140.
For example, when all the arithmetic circuits are normal arithmetic circuits, the diagnostic result output unit 150 outputs a message indicating that all the arithmetic circuits are operating normally as a diagnostic result.
For example, when the first arithmetic circuit is not a normal arithmetic circuit but an abnormal arithmetic circuit, the diagnostic result output unit 150 outputs a message indicating that the first arithmetic circuit has failed as a diagnostic result.
 診断記憶部190は、組み込みシステム100が使用、生成または入出力するデータを記憶する。
 例えば、診断記憶部190は、参照演算結果191、診断演算結果192、診断結果ファイル193および期待値テーブル199などを記憶する。
 参照演算結果191は、参照演算部120によって演算された参照演算式の演算結果を示すデータである。
 診断演算結果192は、診断演算部130によって演算された診断演算式の演算結果を示すデータである。
 診断結果ファイル193は、診断結果を示すデータである。
 期待値テーブル199は、基礎回路を診断するために用いられるデータである。期待値テーブル199は、演算回路に入力される入力値(オペランド)に対応付けて、演算式の正しい演算結果(期待値)を含む。入力値は演算式に代入される代入値に相当する。
The diagnostic storage unit 190 stores data used, generated, or input / output by the embedded system 100.
For example, the diagnosis storage unit 190 stores a reference calculation result 191, a diagnosis calculation result 192, a diagnosis result file 193, an expected value table 199, and the like.
The reference calculation result 191 is data indicating the calculation result of the reference calculation expression calculated by the reference calculation unit 120.
The diagnostic calculation result 192 is data indicating the calculation result of the diagnostic calculation formula calculated by the diagnostic calculation unit 130.
The diagnosis result file 193 is data indicating the diagnosis result.
The expected value table 199 is data used for diagnosing the basic circuit. The expected value table 199 includes the correct operation result (expected value) of the operation expression in association with the input value (operand) input to the operation circuit. The input value corresponds to an assigned value to be assigned to the arithmetic expression.
 図2は、実施の形態1におけるCPU101に備わる複数の演算回路を示す図である。
 実施の形態1におけるCPU101に備わる複数の演算回路について、図2に基づいて説明する。但し、CPU101は、図2に示す複数の演算回路以外の演算回路を備えても構わない。また、CPU101は、図2に示す少なくともいずれかの演算回路を備えなくても構わない。
FIG. 2 is a diagram illustrating a plurality of arithmetic circuits provided in the CPU 101 in the first embodiment.
A plurality of arithmetic circuits provided in the CPU 101 in Embodiment 1 will be described with reference to FIG. However, the CPU 101 may include arithmetic circuits other than the plurality of arithmetic circuits illustrated in FIG. Further, the CPU 101 may not include at least one of the arithmetic circuits illustrated in FIG.
 CPU101は、加算回路201と、減算回路202と、乗算回路203と、除算回路204とを備える。これらは四則演算を行う演算回路である。
 加算回路201は、加算を行う演算回路である。
 減算回路202は、減算を行う演算回路である。
 乗算回路203は、乗算を行う演算回路である。
 除算回路204は、除算を行う演算回路である。
The CPU 101 includes an addition circuit 201, a subtraction circuit 202, a multiplication circuit 203, and a division circuit 204. These are arithmetic circuits that perform four arithmetic operations.
The adder circuit 201 is an arithmetic circuit that performs addition.
The subtraction circuit 202 is an arithmetic circuit that performs subtraction.
The multiplication circuit 203 is an arithmetic circuit that performs multiplication.
The division circuit 204 is an arithmetic circuit that performs division.
 CPU101は、論理和回路211と、論理積回路212と、排他的論理和回路213と、論理否定回路214と、符号反転回路215とを備える。これらは論理演算を行う演算回路である。
 論理和回路211は、論理和を求める演算回路である。
 論理積回路212は、論理積を求める演算回路である。
 排他的論理和回路213は、排他的論理和を求める演算回路である。
 論理否定回路214は、二進数の値を表すビット列に含まれるビット値を反転する論理否定を行う演算回路である。
 符号反転回路215は、符号(正または負)を表す符号ビットを含むビット列のうちの符号ビットのビット値を反転する符号反転を行う演算回路である。符号ビットは最上位のビット(左端のビット)である。
The CPU 101 includes an OR circuit 211, an AND circuit 212, an exclusive OR circuit 213, a logic NOT circuit 214, and a sign inversion circuit 215. These are arithmetic circuits that perform logical operations.
The logical sum circuit 211 is an arithmetic circuit for obtaining a logical sum.
The logical product circuit 212 is an arithmetic circuit for obtaining a logical product.
The exclusive OR circuit 213 is an arithmetic circuit for obtaining an exclusive OR.
The logical negation circuit 214 is an arithmetic circuit that performs logical negation that inverts a bit value included in a bit string representing a binary value.
The sign inversion circuit 215 is an arithmetic circuit that performs sign inversion to invert the bit value of the sign bit in the bit string including the sign bit representing the sign (positive or negative). The sign bit is the most significant bit (leftmost bit).
 CPU101は、左シフト回路221と、算術右シフト回路222と、論理右シフト回路223とを備える。これらはシフト演算を行う演算回路である。
 左シフト回路221は、ビット列に含まれるビット値を左にシフトする左シフトを行う演算回路である。
 算術右シフト回路222は、符号ビットのビット値を除いてビット列に含まれるビット値を右にシフトする算術右シフトを行う演算回路である。
 論理右シフト回路223は、符号ビットのビット値を含めてビット列に含まれるビット値を右にシフトする論理右シフトを行う演算回路である。
The CPU 101 includes a left shift circuit 221, an arithmetic right shift circuit 222, and a logical right shift circuit 223. These are arithmetic circuits for performing a shift operation.
The left shift circuit 221 is an arithmetic circuit that performs a left shift that shifts a bit value included in a bit string to the left.
The arithmetic right shift circuit 222 is an arithmetic circuit that performs an arithmetic right shift that shifts the bit value included in the bit string to the right except the bit value of the sign bit.
The logical right shift circuit 223 is an arithmetic circuit that performs a logical right shift that shifts the bit value included in the bit string including the bit value of the sign bit to the right.
 図3は、実施の形態1における組み込みシステム100の演算回路診断処理を示すフローチャートである。
 実施の形態1における組み込みシステム100の演算回路診断処理について、図3に基づいて説明する。但し、演算回路診断処理は図3に示す処理と同一でなくても構わない。
FIG. 3 is a flowchart showing arithmetic circuit diagnosis processing of the embedded system 100 according to the first embodiment.
An arithmetic circuit diagnosis process of the embedded system 100 according to the first embodiment will be described with reference to FIG. However, the arithmetic circuit diagnosis process may not be the same as the process shown in FIG.
 S101において、基礎回路診断部110は、加算回路201を用いて加算演算式を演算し、演算結果に基づいて加算回路201が正常な演算回路であるか判定する。
 加算演算式は加算から成る演算式であり、基準演算式の一例である。加算回路201は基礎回路の一例である。
 例えば、基礎回路診断部110は、walking-bitと呼ばれる手法によって、加算回路201が正常な演算回路であるか判定する。walking-bitについては非特許文献1に開示されている。
In S101, the basic circuit diagnosis unit 110 calculates an addition operation expression using the adder circuit 201, and determines whether the adder circuit 201 is a normal operation circuit based on the operation result.
The addition arithmetic expression is an arithmetic expression including addition, and is an example of a reference arithmetic expression. The adder circuit 201 is an example of a basic circuit.
For example, the basic circuit diagnosis unit 110 determines whether the adder circuit 201 is a normal arithmetic circuit by a technique called walking-bit. Non-patent document 1 discloses the walking-bit.
 例えば、基礎回路診断部110は、加算回路201が正常な演算回路であるかを以下のように判定する。
 基礎回路診断部110は、入力値を加算回路201に入力することによって、加算回路201に加算演算式を演算させる。
 基礎回路診断部110は入力値に対応付けられた期待値を期待値テーブル199から取得する。
 基礎回路診断部110は加算回路201によって得られた演算結果を取得した期待値と比較し、比較結果に基づいて加算回路201が正常な演算回路であるか判定する。
 演算結果が期待値と同じである場合、加算回路201は正常な演算回路である。演算結果が期待値と異なる場合、加算回路201は正常な演算回路でなく、故障した演算回路(異常な演算回路)である。
For example, the basic circuit diagnosis unit 110 determines whether the adder circuit 201 is a normal arithmetic circuit as follows.
The basic circuit diagnosis unit 110 inputs an input value to the adder circuit 201 to cause the adder circuit 201 to calculate an addition operation expression.
The basic circuit diagnosis unit 110 acquires the expected value associated with the input value from the expected value table 199.
The basic circuit diagnosis unit 110 compares the operation result obtained by the adder circuit 201 with the acquired expected value, and determines whether the adder circuit 201 is a normal operation circuit based on the comparison result.
When the calculation result is the same as the expected value, the addition circuit 201 is a normal calculation circuit. When the calculation result is different from the expected value, the adding circuit 201 is not a normal calculation circuit but a failed calculation circuit (abnormal calculation circuit).
 基礎回路診断部110は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい。walking-bitと呼ばれる手法が用いられる場合、ビット値が1であるビットをシフトすることによって、複数の入力値が生成される。基礎回路診断部110は期待値テーブル199などから入力値を取得してもよい。
 全ての入力値において演算結果が期待値と同じである場合、加算回路201は正常な演算回路である。少なくともいずれかの入力値において演算結果が期待値と異なる場合、加算回路201は正常な演算回路でない。
 以上により、S101の説明を終える。
The basic circuit diagnosis unit 110 may generate a plurality of input values by a technique called walking-bit. When a technique called walking-bit is used, a plurality of input values are generated by shifting a bit having a bit value of 1. The basic circuit diagnosis unit 110 may acquire an input value from the expected value table 199 or the like.
When the calculation result is the same as the expected value for all input values, the adder circuit 201 is a normal calculation circuit. When the calculation result is different from the expected value in at least one of the input values, the addition circuit 201 is not a normal calculation circuit.
This is the end of the description of S101.
 S102において、基礎回路診断部110は、論理否定回路214を用いて論理否定演算式を演算し、演算結果に基づいて論理否定回路214が正常な演算回路であるか判定する。
 論理否定演算式は論理否定から成る演算式であり、基準演算式の一例である。論理否定回路214は基礎回路の一例である。
 論理否定回路214が正常な演算回路であるかを判定する方法は、S101において加算回路201が正常な演算回路であるか判定する方法と同様である。
 以上により、S102の説明を終える。
In S102, the basic circuit diagnosis unit 110 calculates a logical negation expression using the logic negation circuit 214, and determines whether the logic negation circuit 214 is a normal computation circuit based on the computation result.
The logical negation arithmetic expression is an arithmetic expression including logical negation, and is an example of a reference arithmetic expression. The logic negation circuit 214 is an example of a basic circuit.
The method for determining whether the logical negation circuit 214 is a normal arithmetic circuit is the same as the method for determining whether the adder circuit 201 is a normal arithmetic circuit in S101.
This is the end of the description of S102.
 S103において、基礎回路診断部110は、論理和回路211を用いて論理和演算式を演算し、演算結果に基づいて論理和回路211が正常な演算回路であるか判定する。
 論理和演算式は論理和から成る演算式であり、基準演算式の一例である。論理和回路211は基礎回路の一例である。
 論理和回路211が正常な演算回路であるかを判定する方法は、S101において加算回路201が正常な演算回路であるか判定する方法と同様である。
 以上により、S103の説明を終える。
In S103, the basic circuit diagnosis unit 110 calculates a logical sum operation expression using the logical sum circuit 211, and determines whether the logical sum circuit 211 is a normal arithmetic circuit based on the calculation result.
The logical sum arithmetic expression is an arithmetic expression composed of logical sum and is an example of a reference arithmetic expression. The OR circuit 211 is an example of a basic circuit.
The method for determining whether the OR circuit 211 is a normal arithmetic circuit is the same as the method for determining whether the adder circuit 201 is a normal arithmetic circuit in S101.
This is the end of the description of S103.
 S101からS103は順不同で構わない。
 S101からS103が終了した後、処理はS111からS114に進む。
 但し、S101において加算回路201が正常な演算回路でないと判定された場合、処理はS111およびS112に進まない。
 また、S102において論理否定回路214が正常な演算回路でないと判定された場合、処理はS112、S113およびS114に進まない。
 また、S103において論理和回路211が正常な演算回路でないと判定された場合、処理はS114に進まない。
 処理がS111からS114のいずれにも進まない場合、処理はS190に進む。
S101 to S103 may be in any order.
After S101 to S103 are completed, the process proceeds from S111 to S114.
However, if it is determined in S101 that the adding circuit 201 is not a normal arithmetic circuit, the process does not proceed to S111 and S112.
If it is determined in S102 that the logical negation circuit 214 is not a normal arithmetic circuit, the process does not proceed to S112, S113, and S114.
If it is determined in S103 that the OR circuit 211 is not a normal arithmetic circuit, the process does not proceed to S114.
If the process does not proceed to any of S111 to S114, the process proceeds to S190.
 S111において、参照演算部120は、加算回路201(第一の参照回路の一例)に入力値(X、Y)を入力することによって、加算回路201に乗算回路用の参照演算式(第一の参照演算式の一例)を演算させる。加算回路201は正常な演算回路である。
 また、診断演算部130は、加算回路201に入力される入力値と同じ入力値を乗算回路203(第一の診断回路の一例)に入力することによって、乗算回路203に乗算回路用の診断演算式(第一の診断演算式の一例)を演算させる。乗算回路用の診断演算式は、乗算回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて乗算回路203が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、乗算回路203は正常な演算回路である。
In S111, the reference operation unit 120 inputs the input value (X, Y) to the adder circuit 201 (an example of the first reference circuit), thereby causing the adder circuit 201 to input a reference operation expression for the multiplier circuit (first An example of a reference arithmetic expression) is calculated. The adder circuit 201 is a normal arithmetic circuit.
Further, the diagnostic operation unit 130 inputs the same input value as the input value input to the addition circuit 201 to the multiplication circuit 203 (an example of the first diagnosis circuit), thereby causing the multiplication circuit 203 to perform a diagnostic operation for the multiplication circuit. An expression (an example of a first diagnostic calculation expression) is calculated. The diagnostic arithmetic expression for the multiplication circuit is an arithmetic expression that obtains the same calculation result as the reference arithmetic expression for the multiplication circuit.
Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and whether the multiplication circuit 203 is a normal operation circuit based on the comparison result. judge.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the multiplication circuit 203 is a normal calculation circuit.
 参照演算部120は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい。walking-bitについては非特許文献1に開示されている。
 全ての入力値において参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、乗算回路203は正常な演算回路である。少なくともいずれかの入力値において参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と異なる場合、乗算回路203は正常な演算回路でない。
The reference calculation unit 120 may generate a plurality of input values by a technique called walking-bit. Non-patent document 1 discloses the walking-bit.
When the calculation results obtained by the reference calculation unit 120 are the same as the calculation results obtained by the diagnosis calculation unit 130 for all input values, the multiplication circuit 203 is a normal calculation circuit. When the operation result obtained by the reference operation unit 120 differs from the operation result obtained by the diagnosis operation unit 130 for at least one of the input values, the multiplication circuit 203 is not a normal operation circuit.
 例えば、乗算回路用の参照演算式はY個の値Xを合計した値を加算によって求める演算式である。この参照演算式はX+X+・・・+Xで表される。但し、Xの個数はY個である。
 例えば、乗算回路用の診断演算式は、値Xに値Yを掛けた値を乗算によって求める演算式である。この診断演算式はX*Yで表される。
 この場合、図4に示すように、Xの値およびYの値に関わらず、X*Y=X+X+・・・+Xが成り立つ。つまり、乗算回路用の診断演算式は、乗算回路用の参照演算式と同じ演算結果が求まる演算式である。図4において、“nnnnb”は“nnnn”が2進数の値であることを意味する。
 図4は、実施の形態1における参照演算式Zの演算結果と診断演算式Zの演算結果との関係を示す表である。
For example, the reference arithmetic expression for the multiplication circuit is an arithmetic expression for obtaining a value obtained by adding the Y values X by addition. This reference arithmetic expression is represented by X + X +. However, the number of X is Y.
For example, the diagnostic arithmetic expression for the multiplication circuit is an arithmetic expression for obtaining a value obtained by multiplying the value X by the value Y by multiplication. This diagnostic arithmetic expression is represented by X * Y.
In this case, as shown in FIG. 4, X * Y = X + X +... + X holds regardless of the values of X and Y. In other words, the diagnostic arithmetic expression for the multiplier circuit is an arithmetic expression that can obtain the same arithmetic result as the reference arithmetic expression for the multiplier circuit. In FIG. 4, “nnnnb” means that “nnnn” is a binary value.
Figure 4 is a table showing a relationship between the operation result of the arithmetic operation result and diagnostic calculating formula Z 2 reference arithmetic expression Z 1 in the first embodiment.
 S112において、参照演算部120は、加算回路201(第一の参照回路の一例)または論理否定回路214(第二の参照回路の一例)に入力値(X、Y)を入力することによって、加算回路201および論理否定回路214に減算回路用の参照演算式(第一の参照演算式の一例)を演算させる。加算回路201および論理否定回路214は正常な演算回路である。
 また、診断演算部130は、加算回路201または論理否定回路214に入力される入力値と同じ入力値を減算回路202(第一の診断回路の一例)に入力することによって、減算回路202に減算回路用の診断演算式(第一の診断演算式の一例)を演算させる。減算回路用の診断演算式は、減算回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて減算回路202が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、減算回路202は正常な演算回路である。
In S112, the reference calculation unit 120 adds the input values (X, Y) to the addition circuit 201 (an example of the first reference circuit) or the logical negation circuit 214 (an example of the second reference circuit). The circuit 201 and the logic negation circuit 214 are caused to calculate a reference arithmetic expression (an example of a first reference arithmetic expression) for the subtraction circuit. The adder circuit 201 and the logic negation circuit 214 are normal arithmetic circuits.
The diagnostic operation unit 130 also subtracts the subtraction circuit 202 by inputting the same input value as the input value input to the addition circuit 201 or the logical negation circuit 214 to the subtraction circuit 202 (an example of the first diagnosis circuit). A diagnostic arithmetic expression for the circuit (an example of a first diagnostic arithmetic expression) is calculated. The diagnostic arithmetic expression for the subtraction circuit is an arithmetic expression that obtains the same operation result as the reference arithmetic expression for the subtraction circuit.
Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and whether the subtraction circuit 202 is a normal operation circuit based on the comparison result. judge.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the subtraction circuit 202 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、減算回路用の参照演算式は、値Yの1の補数を論理否定によって求めて、値Yの1の補数に1を加算することによって値Yの符号を反転した値を求めて、値Xに値Yの符号を反転した値を加算することによって値Xから値Yを引いた値を求める演算式である。この参照演算式はX+(^Y+1)で表される。但し、^YはYの論理否定、つまり、Yの1の補数を意味する。値Yの1の補数は、値Yを2進数で表すビット列に含まれるビット値を反転したビット列によって表される値である。値Yの符号を反転した値は値Yの2の補数に相当する値である。
 例えば、減算回路用の診断演算式は、値Xから値Yを引いた値を減算によって求める演算式である。この診断演算式はX-Yで表される。
 この場合、X-Y=X+(^Y+1)が成り立つ。つまり、減算回路用の診断演算式は、減算回路用の参照演算式と同じ演算結果が求まる演算式である。
For example, the reference arithmetic expression for the subtraction circuit obtains the value obtained by inverting the sign of the value Y by obtaining the one's complement of the value Y by logical negation and adding 1 to the one's complement of the value Y. This is an arithmetic expression for obtaining a value obtained by subtracting the value Y from the value X by adding a value obtained by inverting the sign of the value Y to X. This reference arithmetic expression is represented by X + (^ Y + 1). However, ^ Y means the logical negation of Y, that is, the one's complement of Y. The one's complement of the value Y is a value represented by a bit string obtained by inverting the bit value included in the bit string representing the value Y in binary. The value obtained by inverting the sign of the value Y is a value corresponding to the two's complement of the value Y.
For example, the diagnostic arithmetic expression for the subtraction circuit is an arithmetic expression for obtaining a value obtained by subtracting the value Y from the value X by subtraction. This diagnostic arithmetic expression is represented by XY.
In this case, XY = X + (^ Y + 1) holds. That is, the diagnostic calculation formula for the subtraction circuit is a calculation formula that can obtain the same calculation result as the reference calculation formula for the subtraction circuit.
 S113において、参照演算部120は、論理否定回路214(第一の参照回路の一例)に入力値(X)を入力することによって、論理否定回路214に符号反転回路用の参照演算式(第一の参照演算式の一例)を演算させる。論理否定回路214は正常な演算回路である。
 また、診断演算部130は、論理否定回路214に入力される入力値と同じ入力値を符号反転回路215(第一の診断回路の一例)に入力することによって、符号反転回路215に符号反転回路用の診断演算式(第一の診断演算式の一例)を演算させる。符号反転回路用の診断演算式は、符号反転回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて符号反転回路215が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、符号反転回路215は正常な演算回路である。
In S113, the reference operation unit 120 inputs the input value (X) to the logic negation circuit 214 (an example of the first reference circuit), whereby the reference operation expression for the sign inverting circuit (first An example of the reference calculation formula is calculated. The logic negation circuit 214 is a normal arithmetic circuit.
Further, the diagnostic operation unit 130 inputs the same input value as the input value input to the logic negation circuit 214 to the sign inversion circuit 215 (an example of the first diagnosis circuit), whereby the sign inversion circuit 215 receives the sign inversion circuit. Diagnostic calculation formula (an example of the first diagnostic calculation formula) is calculated. The diagnostic arithmetic expression for the sign inversion circuit is an arithmetic expression that can obtain the same operation result as the reference arithmetic expression for the sign inversion circuit.
The arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and the sign inversion circuit 215 is a normal operation circuit based on the comparison result. To determine.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the sign inversion circuit 215 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、符号反転回路用の参照演算式は、値Xの1の補数を論理否定によって求めて、値Xの1の補数に1を加算することによって値Xの符号を反転した値を求める演算式である。この参照演算式は(^X+1)で表される。
 例えば、符号反転回路用の診断演算式は、値Xの符号を反転した値を符号反転によって求める演算式である。この診断演算式はNEG Xで表される。但し、NEGは符号反転を意味する。
 この場合、NEG X=(^X+1)が成り立つ。つまり、符号反転回路用の診断演算式は、符号反転回路用の参照演算式と同じ演算結果が求まる演算式である。
For example, the reference arithmetic expression for the sign inverting circuit is an arithmetic expression that obtains a value obtained by inverting the sign of the value X by obtaining the one's complement of the value X by logical negation and adding 1 to the one's complement of the value X. It is. This reference arithmetic expression is represented by (^ X + 1).
For example, the diagnostic arithmetic expression for the sign inversion circuit is an arithmetic expression for obtaining a value obtained by inverting the sign of the value X by sign inversion. This diagnostic arithmetic expression is represented by NEG X. However, NEG means sign inversion.
In this case, NEG X = (^ X + 1) holds. That is, the diagnostic arithmetic expression for the sign inversion circuit is an arithmetic expression that obtains the same operation result as the reference arithmetic expression for the sign inversion circuit.
 S114において、参照演算部120は、論理否定回路214(第一の参照回路の一例)または論理和回路211(第二の参照回路の一例)に入力値(X、Y)を入力することによって、論理否定回路214および論理和回路211に論理積回路用の参照演算式(第一の参照演算式の一例)を演算させる。論理否定回路214および論理和回路211は正常な演算回路である。
 また、診断演算部130は、論理否定回路214または論理和回路211に入力される入力値と同じ入力値を論理積回路212(第一の診断回路の一例)に入力することによって、論理積回路212に論理積回路用の診断演算式(第一の診断演算式の一例)を演算させる。論理積回路用の診断演算式は、論理積回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて論理積回路212が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、符号反転回路215は正常な演算回路である。
In S114, the reference operation unit 120 inputs the input values (X, Y) to the logical NOT circuit 214 (an example of the first reference circuit) or the logical sum circuit 211 (an example of the second reference circuit). The logical negation circuit 214 and the logical sum circuit 211 are caused to calculate a reference arithmetic expression (an example of a first reference arithmetic expression) for the AND circuit. The logical negation circuit 214 and the logical sum circuit 211 are normal arithmetic circuits.
Further, the diagnostic operation unit 130 inputs the same input value as the input value input to the logical NOT circuit 214 or the logical sum circuit 211 to the logical product circuit 212 (an example of the first diagnostic circuit). 212 is caused to calculate a diagnostic operation expression for the AND circuit (an example of the first diagnosis operation expression). A diagnostic operation expression for an AND circuit is an operation expression that obtains the same operation result as a reference operation expression for an AND circuit.
Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and the logical product circuit 212 is a normal operation circuit based on the comparison result. To determine.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the sign inversion circuit 215 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、論理積回路用の参照演算式は、値Xを表すXビット列と値Yを表すYビット列との論理和を求めて、求めた論理和を表す論理和ビット列に含まれるビット値を反転したビット列を論理否定によって求める演算式である。この参照演算式は^(A OR B)で表される。但し、ORは論理和を意味する。
 例えば、論理積回路用の診断演算式は、Xビット列に含まれるビット値を反転した反転Xビット列とYビット列に含まれるビット値を反転した反転Yビット列とを論理否定によって求めて、反転Xビット列と反転Yビット列との論理積を求める演算式である。この診断演算式は(^A)AND(^B)で表される。但し、ANDは論理積を意味する。
 この場合、(^A)AND(^B)=^(A OR B)が成り立つ。つまり、論理積回路用の診断演算式は、論理積回路用の参照演算式と同じ演算結果が求まる演算式である。
For example, the reference arithmetic expression for the logical product circuit calculates the logical sum of the X bit string representing the value X and the Y bit string representing the value Y, and inverts the bit value included in the logical sum bit string representing the obtained logical sum. This is an arithmetic expression for obtaining a bit string by logical negation. This reference arithmetic expression is represented by ^ (A OR B). However, OR means logical sum.
For example, a diagnostic operation expression for a logical product circuit obtains an inverted X bit string obtained by inverting a bit value included in an X bit string and an inverted Y bit string obtained by inverting a bit value included in a Y bit string by logical negation, and an inverted X bit string. Is an arithmetic expression for obtaining the logical product of the inverted Y bit string. This diagnostic arithmetic expression is represented by (^ A) AND (^ B). However, AND means a logical product.
In this case, (^ A) AND (^ B) = ^ (A OR B) holds. In other words, the logical AND circuit diagnostic arithmetic expression is an arithmetic expression that obtains the same operation result as the AND circuit reference arithmetic expression.
 S111からS114は順不同で構わない。
 S111からS114が終了した後、処理はS121からS123に進む。
 但し、S111において乗算回路203が正常な演算回路でないと判定された場合、処理はS121に進まない。
 また、S112において減算回路202が正常な演算回路でないと判定された場合、処理はS122に進まない。
 また、S114において、論理積回路212が正常な演算回路でないと判定された場合、処理はS123に進まない。
 処理がS121からS123のいずれにも進まない場合、処理はS190に進む。
S111 to S114 may be out of order.
After S111 to S114 are completed, the process proceeds from S121 to S123.
However, if it is determined in S111 that the multiplication circuit 203 is not a normal arithmetic circuit, the process does not proceed to S121.
If it is determined in S112 that the subtraction circuit 202 is not a normal arithmetic circuit, the process does not proceed to S122.
If it is determined in S114 that the logical product circuit 212 is not a normal arithmetic circuit, the process does not proceed to S123.
If the process does not proceed to any of S121 to S123, the process proceeds to S190.
 S121において、参照演算部120は、乗算回路203(第一の診断回路または第一の参照回路の一例)に入力値(X、Y)を入力することによって、乗算回路203に左シフト回路用の参照演算式(第二の参照演算式または第一の参照演算式の一例)を演算させる。乗算回路203は正常な演算回路である。
 また、診断演算部130は、乗算回路203に入力される入力値と同じ入力値を左シフト回路221(第二の診断回路または第一の診断回路の一例)に入力することによって、左シフト回路221に左シフト回路用の診断演算式(第二の診断演算式または第一の診断演算式の一例)を演算させる。左シフト回路用の診断演算式は、左シフト回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて左シフト回路221が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、左シフト回路221は正常な演算回路である。
In S121, the reference calculation unit 120 inputs the input value (X, Y) to the multiplication circuit 203 (an example of the first diagnostic circuit or the first reference circuit), thereby causing the multiplication circuit 203 to use the left shift circuit. A reference arithmetic expression (second reference arithmetic expression or an example of the first reference arithmetic expression) is calculated. The multiplier circuit 203 is a normal arithmetic circuit.
In addition, the diagnostic operation unit 130 inputs the same input value as the input value input to the multiplication circuit 203 to the left shift circuit 221 (second diagnostic circuit or an example of the first diagnostic circuit), whereby the left shift circuit 221 causes the left shift circuit diagnostic arithmetic expression (second diagnostic arithmetic expression or an example of the first diagnostic arithmetic expression) to be calculated. The diagnostic operation expression for the left shift circuit is an operation expression that obtains the same operation result as the reference operation expression for the left shift circuit.
The arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and the left shift circuit 221 is a normal operation circuit based on the comparison result. To determine.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the left shift circuit 221 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、左シフト回路用の参照演算式は、2のY乗を乗算によって求めて、値Xに2のY乗を掛けた値を乗算によって求める演算式である。この参照演算式はX*2^Yで表される。但し、2^Yは2のY乗を意味する。
 例えば、左シフト回路用の診断演算式は、値Xを表すビット列を左にYビットシフトしたビット列が表す値を、左シフトによって求める演算式である。この診断演算式はX<<Yで表される。但し、X<<Yは値Xを表すビット列を左にYビットシフトすることを意味する。
 この場合、X<<Y=X*2^Yが成り立つ。つまり、左シフト回路用の診断演算式は、左シフト回路用の参照演算式と同じ演算結果が求まる演算式である。
For example, the reference arithmetic expression for the left shift circuit is an arithmetic expression that obtains a value obtained by multiplying a value X by a power of 2 to a value obtained by multiplying the value X by a power of 2 to the Y power. This reference arithmetic expression is represented by X * 2 ^ Y. However, 2 ^ Y means 2 to the power of Y.
For example, the diagnostic arithmetic expression for the left shift circuit is an arithmetic expression for obtaining a value represented by a bit string obtained by shifting the bit string representing the value X to the left by Y bits by left shift. This diagnostic arithmetic expression is represented by X << Y. However, X << Y means that the bit string representing the value X is shifted to the left by Y bits.
In this case, X << Y = X * 2 ^ Y holds. In other words, the diagnostic calculation formula for the left shift circuit is a calculation formula that obtains the same calculation result as the reference calculation formula for the left shift circuit.
 S122において、参照演算部120は、減算回路202(第一の診断回路または第一の参照回路の一例)に入力値(X、Y)を入力することによって、減算回路202に除算回路用の参照演算式(第二の参照演算式または第一の参照演算式の一例)を演算させる。減算回路202は正常な演算回路である。
 また、診断演算部130は、減算回路202に入力される入力値と同じ入力値を除算回路204(第二の診断回路または第一の診断回路の一例)に入力することによって、除算回路204に除算回路用の診断演算式(第二の診断演算式または第一の診断演算式の一例)を演算させる。除算回路用の診断演算式は、除算回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて除算回路204が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、除算回路204は正常な演算回路である。
In S122, the reference operation unit 120 inputs the input value (X, Y) to the subtraction circuit 202 (an example of the first diagnostic circuit or the first reference circuit), thereby causing the subtraction circuit 202 to reference the division circuit. An arithmetic expression (second reference arithmetic expression or an example of the first reference arithmetic expression) is calculated. The subtraction circuit 202 is a normal arithmetic circuit.
Further, the diagnostic operation unit 130 inputs the same input value as the input value input to the subtracting circuit 202 to the dividing circuit 204 (second diagnostic circuit or an example of the first diagnostic circuit), whereby the dividing circuit 204 is input. A diagnostic arithmetic expression for the division circuit (an example of the second diagnostic arithmetic expression or the first diagnostic arithmetic expression) is calculated. The diagnostic arithmetic expression for the divider circuit is an arithmetic expression that obtains the same calculation result as the reference arithmetic expression for the divider circuit.
Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and whether the division circuit 204 is a normal operation circuit based on the comparison result. judge.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the division circuit 204 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、除算回路用の参照演算式は、値Xから値Yを引ける回数を表す値を減算によって求める演算式である。この参照演算式は(X-Y-Y・・・-Y)で表される。但し、(X-Y-Y・・・-Y)は値Xから値Yを引ける回数を計数することを意味する。
 例えば、除算回路用の診断演算式は、値Xを値Yで割った商を除算によって求める演算式である。この診断演算式はX/Yで表される。
 この場合、X/Y=(X-Y-Y・・・-Y)が成り立つ。つまり、除算回路用の診断演算式は、除算回路用の参照演算式と同じ演算結果が求まる演算式である。
For example, the reference arithmetic expression for the division circuit is an arithmetic expression for obtaining a value representing the number of times the value Y can be subtracted from the value X by subtraction. This reference arithmetic expression is represented by (XY−Y... −Y). However, (XY−Y... −Y) means that the number of times that the value Y can be subtracted from the value X is counted.
For example, the diagnostic arithmetic expression for the division circuit is an arithmetic expression for obtaining a quotient obtained by dividing the value X by the value Y by division. This diagnostic arithmetic expression is represented by X / Y.
In this case, X / Y = (XY−Y... −Y) holds. That is, the diagnostic arithmetic expression for the divider circuit is an arithmetic expression that can obtain the same calculation result as the reference arithmetic expression for the divider circuit.
 S123において、参照演算部120は、論理積回路212(第一の診断回路の一例)、論理否定回路214(第一の参照回路の一例)または論理和回路211(第二の参照回路の一例)に入力値(X、Y)を入力することによって、論理積回路212、論理否定回路214および論理和回路211に排他的論理和回路用の参照演算式(第二の参照演算式の一例)を演算させる。論理積回路212、論理否定回路214および論理和回路211は正常な演算回路である。
 また、診断演算部130は、論理積回路212、論理否定回路214または論理和回路211に入力される入力値と同じ入力値を排他的論理和回路213(第二の診断回路の一例)に入力することによって、排他的論理和回路213に排他的論理和回路用の診断演算式(第二の診断演算式の一例)を演算させる。排他的論理和回路用の診断演算式は、排他的論理和回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて排他的論理和回路213が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、排他的論理和回路213は正常な演算回路である。
In S123, the reference operation unit 120 performs an AND circuit 212 (an example of a first diagnostic circuit), a logical NOT circuit 214 (an example of a first reference circuit), or an OR circuit 211 (an example of a second reference circuit). By inputting the input value (X, Y) into the logical product circuit 212, the logical negation circuit 214, and the logical sum circuit 211, the reference arithmetic expression for the exclusive OR circuit (an example of the second reference arithmetic expression) is provided. Calculate. The logical product circuit 212, the logical NOT circuit 214, and the logical sum circuit 211 are normal arithmetic circuits.
In addition, the diagnostic operation unit 130 inputs the same input value as the input value input to the logical product circuit 212, the logical NOT circuit 214, or the logical sum circuit 211 to the exclusive OR circuit 213 (an example of a second diagnostic circuit). By doing so, the exclusive OR circuit 213 is caused to calculate a diagnostic operation expression for the exclusive OR circuit (an example of the second diagnosis operation expression). The diagnostic operation expression for the exclusive OR circuit is an operation expression that obtains the same operation result as the reference operation expression for the exclusive OR circuit.
Then, the arithmetic circuit diagnostic unit 140 compares the arithmetic result obtained by the reference arithmetic unit 120 with the arithmetic result obtained by the diagnostic arithmetic unit 130, and the exclusive OR circuit 213 is a normal arithmetic circuit based on the comparison result. It is determined whether it is.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the exclusive OR circuit 213 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、排他的論理和回路用の参照演算式は、反転Xビット列と反転Yビット列とを論理否定によって求めて、第一の論理積ビット列と第二の論理積ビット列とを求めて、第一の論理積ビット列と第二の論理積ビット列との論理和を求める演算式である。反転Xビット列は値Xを表すXビット列に含まれるビット値を反転したビット列であり、反転Yビット列は値Yを表すYビット列に含まれるビット値を反転したビット列である。第一の論理積ビット列はXビット列と反転Yビット列との論理積を表すビット列であり、第二の論理積ビット列は反転Xビット列とYビット列との論理積を表すビット列である。この参照演算式は(X AND ^Y) OR (^X AND Y)で表される。
 この場合、排他的論理和回路用の診断演算式は、Xビット列とYビット列との排他的論理和を求める演算式である。この診断演算式はX XOR Yで表される。但し、XORは排他的論理和を意味する。
 この場合、X XOR Y=(X AND ^Y) OR (^X AND Y)が成り立つ。つまり、排他的論理和回路用の診断演算式は、排他的論理和回路用の参照演算式と同じ演算結果が求まる演算式である。
For example, a reference arithmetic expression for an exclusive OR circuit obtains an inverted X bit string and an inverted Y bit string by logical negation, obtains a first AND bit string and a second AND bit string, This is an arithmetic expression for obtaining a logical sum of a logical product bit string and a second logical product bit string. The inverted X bit string is a bit string obtained by inverting the bit value included in the X bit string representing the value X, and the inverted Y bit string is a bit string obtained by inverting the bit value included in the Y bit string representing the value Y. The first AND bit string is a bit string that represents the logical product of the X bit string and the inverted Y bit string, and the second AND bit string is a bit string that represents the logical product of the inverted X bit string and the Y bit string. This reference arithmetic expression is represented by (X AND ^ Y) OR (^ X AND Y).
In this case, the diagnostic arithmetic expression for the exclusive OR circuit is an arithmetic expression for obtaining an exclusive OR of the X bit string and the Y bit string. This diagnostic arithmetic expression is represented by X XOR Y. However, XOR means exclusive OR.
In this case, X XOR Y = (X AND ^ Y) OR (^ X AND Y) holds. That is, the diagnostic operation expression for the exclusive OR circuit is an operation expression that obtains the same operation result as the reference operation expression for the exclusive OR circuit.
 S121からS123は順不同で構わない。
 S121からS123が終了した後、処理はS131に進む。
 但し、S122において除算回路204が正常な演算回路でないと判定された場合、処理はS131ではなくS190に進む。
S121 to S123 may be out of order.
After S121 to S123 are completed, the process proceeds to S131.
However, if it is determined in S122 that the division circuit 204 is not a normal arithmetic circuit, the process proceeds to S190 instead of S131.
 S131において、参照演算部120は、除算回路204(第二の診断回路または第一の参照回路の一例)または乗算回路203(正常演算回路または第二の参照回路の一例)に入力値(X、Y)を入力することによって、除算回路204および乗算回路203に算術右シフト回路用の参照演算式(第三の参照演算式または第一の参照演算式の一例)を演算させる。除算回路204および乗算回路203は正常な演算回路である。
 また、診断演算部130は、除算回路204または乗算回路203に入力される入力値と同じ入力値を算術右シフト回路222(第三の診断回路または第一の参照回路の一例)に入力することによって、算術右シフト回路222に算術右シフト回路用の診断演算式(第三の診断演算式または第一の診断演算式の一例)を演算させる。算術右シフト回路用の診断演算式は、算術右シフト回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて算術右シフト回路222が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、算術右シフト回路222は正常な演算回路である。
In S131, the reference calculation unit 120 inputs input values (X, X, D) to the division circuit 204 (an example of the second diagnostic circuit or the first reference circuit) or the multiplication circuit 203 (an example of the normal calculation circuit or the second reference circuit). By inputting (Y), the division circuit 204 and the multiplication circuit 203 are caused to calculate the reference arithmetic expression (an example of the third reference arithmetic expression or the first reference arithmetic expression) for the arithmetic right shift circuit. The division circuit 204 and the multiplication circuit 203 are normal arithmetic circuits.
In addition, the diagnostic calculation unit 130 inputs the same input value as the input value input to the division circuit 204 or the multiplication circuit 203 to the arithmetic right shift circuit 222 (an example of the third diagnosis circuit or the first reference circuit). Thus, the arithmetic right shift circuit 222 is caused to calculate a diagnostic arithmetic expression for the arithmetic right shift circuit (a third diagnostic arithmetic expression or an example of the first diagnostic arithmetic expression). The diagnostic arithmetic expression for the arithmetic right shift circuit is an arithmetic expression that obtains the same operation result as the reference arithmetic expression for the arithmetic right shift circuit.
Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and based on the comparison result, the arithmetic right shift circuit 222 is a normal operation circuit. Determine if there is.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the arithmetic right shift circuit 222 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、算術右シフト回路用の参照演算式は、2のY乗を乗算によって求めて、値Xを2のY乗で割った商を除算によって求める演算式である。この参照演算式はX/(2^Y)で表される。
 例えば、算術右シフト回路用の診断演算式は、値Xを表すビット列を値Xの符号を表す符号ビットを除いて右にYビットシフトしたビット列が表す値を算術右シフトによって求める演算式である。この診断演算式はX SHAR Yで表される。但し、SHARは算術右シフトを意味する。
 この場合、X SHAR Y=X/(2^Y)が成り立つ。つまり、算術右シフト回路用の診断演算式は、算術右シフト回路用の参照演算式と同じ演算結果が求まる演算式である。
 S131の後、処理はS141に進む。但し、S131において算術右シフト回路222が正常な演算回路でないと判定された場合、処理はS141ではなくS190に進む。
For example, the reference arithmetic expression for the arithmetic right shift circuit is an arithmetic expression that obtains a quotient obtained by dividing the value X by 2 to the Y power by obtaining 2 to the Y power by division. This reference arithmetic expression is represented by X / (2 ^ Y).
For example, a diagnostic arithmetic expression for an arithmetic right shift circuit is an arithmetic expression that obtains a value represented by a bit string obtained by shifting a bit string representing a value X to the right by Y bits excluding a sign bit representing a sign of the value X by arithmetic right shift. . This diagnostic arithmetic expression is represented by X SHARY Y. However, SHA means arithmetic right shift.
In this case, X SHARY Y = X / (2 ^ Y) holds. That is, the diagnostic arithmetic expression for the arithmetic right shift circuit is an arithmetic expression that obtains the same arithmetic result as the reference arithmetic expression for the arithmetic right shift circuit.
After S131, the process proceeds to S141. However, if it is determined in S131 that the arithmetic right shift circuit 222 is not a normal arithmetic circuit, the process proceeds to S190 instead of S141.
 S141において、参照演算部120は、算術右シフト回路222(第三の診断回路または第一の参照回路の一例)または排他的論理和回路213(正常演算回路または第二の参照回路の一例)に入力値(X、Y)を入力することによって、算術右シフト回路222および排他的論理和回路213に論理右シフト回路用の参照演算式(第四の参照演算式または第一の参照演算式の一例)を演算させる。算術右シフト回路222および排他的論理和回路213は正常な演算回路である。
 また、診断演算部130は、算術右シフト回路222または排他的論理和回路213に入力される入力値と同じ入力値を論理右シフト回路223(第四の診断回路または第一の診断回路の一例)に入力することによって、論理右シフト回路223に論理右シフト回路用の診断演算式(第四の診断算式または第一の診断演算式の一例)を演算させる。論理右シフト回路用の診断演算式は、論理右シフト回路用の参照演算式と同じ演算結果が求まる演算式である。
 そして、演算回路診断部140は、参照演算部120によって得られた演算結果を診断演算部130によって得られた演算結果と比較し、比較結果に基づいて論理右シフト回路223が正常な演算回路であるか判定する。
 参照演算部120によって得られた演算結果が診断演算部130によって得られた演算結果と同じである場合、論理右シフト回路223は正常な演算回路である。
In S <b> 141, the reference operation unit 120 transfers the arithmetic right shift circuit 222 (an example of the third diagnostic circuit or the first reference circuit) or the exclusive OR circuit 213 (an example of the normal operation circuit or the second reference circuit). By inputting the input values (X, Y), the arithmetic right shift circuit 222 and the exclusive OR circuit 213 receive the reference arithmetic expression (fourth reference arithmetic expression or first reference arithmetic expression) for the logical right shift circuit. (Example). The arithmetic right shift circuit 222 and the exclusive OR circuit 213 are normal arithmetic circuits.
In addition, the diagnosis operation unit 130 applies the same input value as the input value input to the arithmetic right shift circuit 222 or the exclusive OR circuit 213 to the logical right shift circuit 223 (an example of the fourth diagnosis circuit or the first diagnosis circuit). ) Causes the logical right shift circuit 223 to calculate a logical arithmetic expression for the logical right shift circuit (a fourth diagnostic arithmetic expression or an example of the first diagnostic arithmetic expression). The diagnostic arithmetic expression for the logical right shift circuit is an arithmetic expression that obtains the same arithmetic result as the reference arithmetic expression for the logical right shift circuit.
Then, the arithmetic circuit diagnosis unit 140 compares the operation result obtained by the reference operation unit 120 with the operation result obtained by the diagnosis operation unit 130, and based on the comparison result, the logical right shift circuit 223 is a normal operation circuit. Determine if there is.
When the calculation result obtained by the reference calculation unit 120 is the same as the calculation result obtained by the diagnosis calculation unit 130, the logical right shift circuit 223 is a normal calculation circuit.
 参照演算部120および診断演算部130は、walking-bitと呼ばれる手法によって、複数の入力値を生成してもよい(S111と同様)。 The reference calculation unit 120 and the diagnosis calculation unit 130 may generate a plurality of input values by a technique called walking-bit (similar to S111).
 例えば、論理右シフト回路用の参照演算式は、シフトビット列を算術右シフトによって求めて、最大値ビット列とシフトビット列との論理和を求める演算式である。シフトビット列は、値Xを表すXビット列を値Xの符号を表すX符号ビットを除いて右にYビットシフトしたビット列である。最大値ビット列はビット値が0である符号ビットとビット値が1である他のビットとから成るビット列、つまり、正の最大値を表すビット列である。この参照演算式は(X SHAR Y) AND 0x7FFFFFFFで表される。但し、0x7FFFFFFFは最大値ビット列を意味する。
 例えば、論理右シフト回路用の診断演算式は、Xビット列(X符号ビットを含む)を右にYビットシフトしたビット列を論理右シフトによって求める演算式である。この診断演算式はX SHLR Yで表される。但し SHLRは論理右シフトを意味する。
 この場合、X SHLR Y=(X SHAR Y) AND 0x7FFFFFFFが成り立つ。つまり、論理右シフト回路用の参照演算式は、論理右シフト回路用の診断演算式と同じ演算結果が求まる演算式である。
 S141の後、処理はS190に進む。
For example, the reference arithmetic expression for the logical right shift circuit is an arithmetic expression for obtaining a logical sum of a maximum value bit string and a shift bit string by obtaining a shift bit string by arithmetic right shift. The shift bit string is a bit string obtained by shifting the X bit string representing the value X to the right by Y bits excluding the X code bit representing the sign of the value X. The maximum value bit string is a bit string composed of a sign bit having a bit value of 0 and another bit having a bit value of 1, that is, a bit string representing a positive maximum value. This reference arithmetic expression is represented by (X SHA Y) AND 0x7FFFFFFF. However, 0x7FFFFFFFF means the maximum value bit string.
For example, a diagnostic arithmetic expression for a logical right shift circuit is an arithmetic expression for obtaining a bit string obtained by shifting an X bit string (including an X sign bit) to the right by Y bits by a logical right shift. This diagnostic arithmetic expression is represented by X SHLR Y. However, SHLR means a logical right shift.
In this case, X SHLR Y = (X SHA Y) AND 0x7FFFFFFF holds. That is, the reference arithmetic expression for the logical right shift circuit is an arithmetic expression that obtains the same operation result as the diagnostic arithmetic expression for the logical right shift circuit.
After S141, the process proceeds to S190.
 S190において、診断結果出力部150は、S101からS141の各判定結果に基づいて、CPU101に備わる複数の演算回路の診断結果を出力する。
 S190の後、演算回路診断処理は終了する。
In S190, the diagnosis result output unit 150 outputs the diagnosis results of a plurality of arithmetic circuits included in the CPU 101 based on the determination results of S101 to S141.
After S190, the arithmetic circuit diagnosis process ends.
 図5は、実施の形態1における複数の演算回路の関係を示す図である。
 図5において、矢印の始点の演算回路は参照演算式を演算する正常な演算回路であり、矢印の終点の演算回路は診断演算式を演算する診断回路である。
 例えば、加算回路201および論理否定回路214は、減算回路202を指し示す矢印の始点の演算回路であるため、減算回路用の参照演算式を演算する。一方、減算回路202は、その矢印の終点の演算回路であるため、減算回路用の診断演算式を演算する。
FIG. 5 is a diagram illustrating a relationship among a plurality of arithmetic circuits in the first embodiment.
In FIG. 5, the arithmetic circuit at the start point of the arrow is a normal arithmetic circuit that calculates the reference arithmetic expression, and the arithmetic circuit at the end point of the arrow is a diagnostic circuit that calculates the diagnostic arithmetic expression.
For example, the adder circuit 201 and the logic negation circuit 214 are arithmetic circuits at the start point of an arrow indicating the subtractor circuit 202, and therefore calculate a reference arithmetic expression for the subtractor circuit. On the other hand, since the subtraction circuit 202 is an arithmetic circuit at the end point of the arrow, it calculates a diagnostic arithmetic expression for the subtraction circuit.
 図6は、実施の形態1における組み込みシステム100のハードウェア構成図である。
 実施の形態1における組み込みシステム100のハードウェア構成について、図6に基づいて説明する。但し、組み込みシステム100のハードウェア構成は図6に示す構成と同一でなくても構わない。
FIG. 6 is a hardware configuration diagram of the embedded system 100 according to the first embodiment.
A hardware configuration of the embedded system 100 according to the first embodiment will be described with reference to FIG. However, the hardware configuration of the embedded system 100 may not be the same as the configuration shown in FIG.
 組み込みシステム100は、演算装置901、補助記憶装置902、主記憶装置903、通信装置904および入出力装置905を備えるコンピュータである。
 演算装置901、補助記憶装置902、主記憶装置903、通信装置904および入出力装置905はバス909に接続している。
The embedded system 100 is a computer including an arithmetic device 901, an auxiliary storage device 902, a main storage device 903, a communication device 904, and an input / output device 905.
The arithmetic device 901, auxiliary storage device 902, main storage device 903, communication device 904, and input / output device 905 are connected to the bus 909.
 演算装置901は、プログラムを実行するCPU(Central Processing Unit)である。
 補助記憶装置902は、例えば、ROM(Read Only Memory)、フラッシュメモリまたはハードディスク装置である。
 主記憶装置903は、例えば、RAM(Random Access Memory)である。
 通信装置904は、有線または無線でインターネット、LAN(ローカルエリアネットワーク)、電話回線網またはその他のネットワークを介して通信を行う。
 入出力装置905は、例えば、マウス、キーボード、ディスプレイ装置である。
The arithmetic device 901 is a CPU (Central Processing Unit) that executes a program.
The auxiliary storage device 902 is, for example, a ROM (Read Only Memory), a flash memory, or a hard disk device.
The main storage device 903 is, for example, a RAM (Random Access Memory).
The communication device 904 performs communication via the Internet, a LAN (local area network), a telephone line network, or other networks in a wired or wireless manner.
The input / output device 905 is, for example, a mouse, a keyboard, or a display device.
 プログラムは、補助記憶装置902に記憶されている。
 例えば、オペレーティングシステム(OS)が補助記憶装置902に記憶される。また、「~部」として説明している機能を実現するプログラムが補助記憶装置902に記憶される。
 プログラムは、補助記憶装置902に記憶されており、主記憶装置903にロードされ、演算装置901に読み込まれ、演算装置901によって実行される。
The program is stored in the auxiliary storage device 902.
For example, an operating system (OS) is stored in the auxiliary storage device 902. Further, a program for realizing the function described as “˜unit” is stored in the auxiliary storage device 902.
The program is stored in the auxiliary storage device 902, loaded into the main storage device 903, read into the arithmetic device 901, and executed by the arithmetic device 901.
 「~の判断」、「~の判定」、「~の抽出」、「~の検知」、「~の設定」、「~の登録」、「~の選択」、「~の生成」、「~の入力」、「~の出力」等の処理の結果を示す情報、データ、ファイル、信号値または変数値が主記憶装置903または補助記憶装置902に記憶される。 “Determining”, “Determining”, “Extracting”, “Detecting”, “Settings”, “Registering”, “Selecting”, “Generating”, “To” Information, data, files, signal values or variable values indicating the results of processing such as “input”, “output of”, etc. are stored in the main storage device 903 or the auxiliary storage device 902.
 実施の形態1において、例えば、以下のような技術について説明した。
 実施の形態1は期待値を記憶するために必要な記憶容量を削減する技術を提案する。具体的には、結果が同じであるが異なる演算回路を利用する2つの式を演算し、それぞれの結果を比較する。それぞれの結果が一致する場合は故障なしと判断し、それぞれの結果が一致しない場合は故障ありと判断する。
 但し、全ての演算回路の基となる加算回路201、論理否定回路214および論理和回路211については、演算結果の期待値を記憶部に格納し、演算結果を期待値と比較し、比較結果に基づいて故障を検出する。理由は、異なる演算回路が両方とも故障していて演算結果が偶然同じになる場合であっても、各演算回路の故障を検出できるようにするためである。故障していないことが確認された演算回路を利用して得られた演算結果と診断の対象とする演算回路を利用して得られた演算結果とを比較することにより、異なる演算回路が両方とも故障していて演算結果が偶然同じになる場合を回避し、全ての演算回路の故障を検出することができる。
In the first embodiment, for example, the following technique has been described.
Embodiment 1 proposes a technique for reducing the storage capacity necessary for storing an expected value. Specifically, two expressions that use different arithmetic circuits with the same result are calculated, and the respective results are compared. If the results match, it is determined that there is no failure, and if the results do not match, it is determined that there is a failure.
However, for the adder circuit 201, the logical NOT circuit 214, and the logical sum circuit 211 that are the basis of all the arithmetic circuits, the expected value of the operation result is stored in the storage unit, the operation result is compared with the expected value, Based on the failure detection. The reason is that it is possible to detect a failure of each arithmetic circuit even when both different arithmetic circuits are faulty and the arithmetic result is the same by chance. By comparing the operation result obtained using the operation circuit that has been confirmed not to be in failure with the operation result obtained using the operation circuit to be diagnosed, both different operation circuits are It is possible to avoid a case where a failure occurs and the calculation result becomes the same by chance, and it is possible to detect a failure of all the operation circuits.
 実施の形態1により、例えば、以下のような効果を奏する。
 CPU101の演算回路の故障を検出できる。
 期待値を記憶するための記憶容量を減らすことができる。
 ソフトウェアによって実現できるため、診断用のハードウェアを追加する必要がなく、安価に実現できる。
 四則演算、論理演算およびシフト演算といった一般的な演算に対応しているため、様々なCPU101に適用することができる。
According to the first embodiment, for example, the following effects can be obtained.
A failure of the arithmetic circuit of the CPU 101 can be detected.
The storage capacity for storing the expected value can be reduced.
Since it can be realized by software, it is not necessary to add hardware for diagnosis and can be realized at low cost.
Since it corresponds to general operations such as four arithmetic operations, logical operations, and shift operations, it can be applied to various CPUs 101.
 実施の形態1は、組み込みシステム100の形態の一例である。
 つまり、組み込みシステム100は、実施の形態1で説明した構成要素の一部を備えなくても構わない。また、組み込みシステム100は、実施の形態1で説明していない構成要素を備えても構わない。
 組み込みシステム100は、他のコンピュータが備える複数の演算回路を診断する装置であっても構わない。
 加算回路201、論理否定回路214および論理和回路211以外の少なくともいずれかの演算回路が期待値を用いて基礎回路診断部110によって診断されても構わない。
The first embodiment is an example of a form of the embedded system 100.
That is, the embedded system 100 may not include some of the components described in the first embodiment. Further, the embedded system 100 may include components that are not described in the first embodiment.
The embedded system 100 may be a device that diagnoses a plurality of arithmetic circuits included in another computer.
At least one arithmetic circuit other than the adder circuit 201, the logical NOT circuit 214, and the logical sum circuit 211 may be diagnosed by the basic circuit diagnostic unit 110 using the expected value.
 実施の形態1においてフローチャート等を用いて説明した処理手順は、実施の形態1に係る方法およびプログラムの処理手順の一例である。実施の形態1に係る方法およびプログラムは、実施の形態1で説明した処理手順と一部異なる処理手順で実現されても構わない。 The processing procedure described in the first embodiment using a flowchart or the like is an example of the processing procedure of the method and program according to the first embodiment. The method and program according to the first embodiment may be realized by a processing procedure that is partially different from the processing procedure described in the first embodiment.
 実施の形態1において「~部」は「~処理」「~工程」「~プログラム」「~装置」などに読み替えることができる。 In the first embodiment, “to part” can be read as “to process”, “to process”, “to program”, “to apparatus”, and the like.
 100 組み込みシステム、101 CPU、110 基礎回路診断部、120 参照演算部、130 診断演算部、140 演算回路診断部、150 診断結果出力部、190 診断記憶部、191 参照演算結果、192 診断演算結果、193 診断結果ファイル、199 期待値テーブル、201 加算回路、202 減算回路、203 乗算回路、204 除算回路、211 論理和回路、212 論理積回路、213 排他的論理和回路、214 論理否定回路、215 符号反転回路、221 左シフト回路、222 算術右シフト回路、223 論理右シフト回路、901 演算装置、902 補助記憶装置、903 主記憶装置、904 通信装置、905 入出力装置、909 バス。 100 embedded system, 101 CPU, 110 basic circuit diagnostic unit, 120 reference arithmetic unit, 130 diagnostic arithmetic unit, 140 arithmetic circuit diagnostic unit, 150 diagnostic result output unit, 190 diagnostic storage unit, 191 reference arithmetic result, 192 diagnostic arithmetic result, 193 diagnosis result file, 199 expected value table, 201 addition circuit, 202 subtraction circuit, 203 multiplication circuit, 204 division circuit, 211 logical sum circuit, 212 logical product circuit, 213 exclusive logical sum circuit, 214 logical negation circuit, 215 code Inversion circuit, 221 left shift circuit, 222 arithmetic right shift circuit, 223 logical right shift circuit, 901 arithmetic device, 902 auxiliary storage device, 903 main storage device, 904 communication device, 905 input / output device, 909 bus.

Claims (14)

  1.  正しい演算結果が得られる演算回路である第一の参照回路を用いて、第一の参照演算式を演算する参照演算部と、
     診断される演算回路である第一の診断回路を用いて、前記第一の参照演算式と同じ演算結果が求まる第一の診断演算式を演算する診断演算部と、
     前記診断演算部によって演算された前記第一の診断演算式の演算結果を前記参照演算部によって演算された前記第一の参照演算式の演算結果と比較し、比較結果に基づいて前記第一の診断回路が正しい演算結果が得られる演算回路であるか判定する演算回路診断部と
    を備えることを特徴とする演算回路診断装置。
    Using a first reference circuit that is an arithmetic circuit that obtains a correct calculation result, a reference calculation unit that calculates a first reference calculation expression;
    Using a first diagnostic circuit that is an arithmetic circuit to be diagnosed, a diagnostic arithmetic unit that calculates a first diagnostic arithmetic expression that obtains the same arithmetic result as the first reference arithmetic expression;
    The operation result of the first diagnostic operation expression calculated by the diagnosis operation unit is compared with the operation result of the first reference operation expression calculated by the reference operation unit, and the first result is calculated based on the comparison result. An arithmetic circuit diagnostic apparatus comprising: an arithmetic circuit diagnosis unit that determines whether the diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result.
  2.  前記第一の参照回路は加算を行う演算回路であり、
     前記第一の参照演算式はY個の値Xを合計した値を加算によって求める演算式であり、
     前記第一の診断回路は乗算を行う演算回路であり、
     前記第一の診断演算式は前記値Xに値Yを掛けた値を乗算によって求める演算式である
    ことを特徴とする請求項1に記載の演算回路診断装置。
    The first reference circuit is an arithmetic circuit that performs addition,
    The first reference arithmetic expression is an arithmetic expression for obtaining a value obtained by adding up Y values X, and
    The first diagnostic circuit is an arithmetic circuit that performs multiplication,
    The arithmetic circuit diagnosis apparatus according to claim 1, wherein the first diagnostic arithmetic expression is an arithmetic expression for obtaining a value obtained by multiplying the value X by a value Y by multiplication.
  3.  前記参照演算部は、前記第一の参照回路と正しい演算結果が得られる第二の参照回路とを用いて、前記第一の参照演算式を演算し、
     前記第一の参照回路は加算を行う演算回路であり、
     前記第二の参照回路は値を表すビット列に含まれるビット値を反転する論理否定を行う演算回路であり、
     前記第一の参照演算式は値Xの1の補数を論理否定によって求めて、前記値Xの1の補数に1を加算することによって前記値Xの符号を反転した値を求める演算式であり、
     前記診断演算部は、前記第一の診断回路を用いて、前記第一の診断演算式を演算し、
     前記第一の診断回路は正負を表す符号を反転する符号反転を行う演算回路であり、
     前記第一の診断演算式は前記値Xの符号を反転した値を符号反転によって求める演算式である
    ことを特徴とする請求項1に記載の演算回路診断装置。
    The reference calculation unit calculates the first reference calculation expression using the first reference circuit and a second reference circuit from which a correct calculation result is obtained,
    The first reference circuit is an arithmetic circuit that performs addition,
    The second reference circuit is an arithmetic circuit that performs a logical negation to invert a bit value included in a bit string representing a value,
    The first reference arithmetic expression is an arithmetic expression for obtaining a value obtained by inverting the sign of the value X by obtaining the one's complement of the value X by logical negation and adding 1 to the one's complement of the value X. ,
    The diagnostic calculation unit calculates the first diagnostic calculation formula using the first diagnostic circuit,
    The first diagnostic circuit is an arithmetic circuit that performs sign inversion to invert a sign representing positive and negative,
    The arithmetic circuit diagnosis apparatus according to claim 1, wherein the first diagnosis arithmetic expression is an arithmetic expression for obtaining a value obtained by inverting the sign of the value X by sign inversion.
  4.  前記参照演算部は、前記第一の参照回路と正しい演算結果が得られる第二の参照回路とを用いて、前記第一の参照演算式を演算し、
     前記第一の参照回路は加算を行う演算回路であり、
     前記第二の参照回路は値を表すビット列に含まれるビット値を反転する論理否定を行う演算回路であり、
     前記第一の参照演算式は値Yの1の補数を論理否定によって求めて、前記値Yの1の補数に1を加算することによって前記値Yの符号を反転した値を求めて、値Xに前記値Yの符号を反転した値を加算することによって前記値Xから前記値Yを引いた値を求める演算式であり、
     前記診断演算部は、前記第一の診断回路を用いて、前記第一の診断演算式を演算し、
     前記第一の診断回路は減算を行う演算回路であり、
     前記第一の診断演算式は前記値Xから前記値Yを引いた値を減算によって求める演算式である
    ことを特徴とする請求項1に記載の演算回路診断装置。
    The reference calculation unit calculates the first reference calculation expression using the first reference circuit and a second reference circuit from which a correct calculation result is obtained,
    The first reference circuit is an arithmetic circuit that performs addition,
    The second reference circuit is an arithmetic circuit that performs a logical negation to invert a bit value included in a bit string representing a value,
    The first reference arithmetic expression obtains the one's complement of the value Y by logical negation, obtains a value obtained by inverting the sign of the value Y by adding 1 to the one's complement of the value Y, and obtains the value X Is an arithmetic expression for obtaining a value obtained by subtracting the value Y from the value X by adding a value obtained by inverting the sign of the value Y to
    The diagnostic calculation unit calculates the first diagnostic calculation formula using the first diagnostic circuit,
    The first diagnostic circuit is an arithmetic circuit that performs subtraction,
    2. The arithmetic circuit diagnosis apparatus according to claim 1, wherein the first diagnostic arithmetic expression is an arithmetic expression for subtracting a value obtained by subtracting the value Y from the value X. 3.
  5.  前記参照演算部は、前記第一の参照回路と正しい演算結果が得られる第二の参照回路とを用いて、前記第一の参照演算式を演算し、
     前記第一の参照回路は値を表すビット列に含まれるビット値を反転する論理否定を行う演算回路であり、
     前記第二の参照回路は論理和を求める演算回路であり、
     前記第一の参照演算式は値Xを表すXビット列と値Yを表すYビット列との論理和を求めて、求めた論理和を表す論理和ビット列に含まれるビット値を反転したビット列を論理否定によって求める演算式であり、
     前記診断演算部は、前記第一の参照回路と前記第一の診断回路とを用いて、前記第一の診断演算式を演算し、
     前記第一の診断回路は論理積を求める演算回路であり、
     前記第一の診断演算式は前記Xビット列に含まれるビット値を反転した反転Xビット列と前記Yビット列に含まれるビット値を反転した反転Yビット列とを論理否定によって求めて、前記反転Xビット列と前記反転Yビット列との論理積を求める演算式である
    ことを特徴とする請求項1に記載の演算回路診断装置。
    The reference calculation unit calculates the first reference calculation expression using the first reference circuit and a second reference circuit from which a correct calculation result is obtained,
    The first reference circuit is an arithmetic circuit that performs a logical negation to invert a bit value included in a bit string representing a value,
    The second reference circuit is an arithmetic circuit for obtaining a logical sum,
    The first reference arithmetic expression obtains a logical sum of an X bit string representing the value X and a Y bit string representing the value Y, and logically negates the bit string obtained by inverting the bit value included in the obtained logical sum bit string. Is an arithmetic expression obtained by
    The diagnostic calculation unit calculates the first diagnostic calculation expression using the first reference circuit and the first diagnostic circuit,
    The first diagnostic circuit is an arithmetic circuit for obtaining a logical product,
    The first diagnostic arithmetic expression obtains an inverted X bit string obtained by inverting the bit value included in the X bit string and an inverted Y bit string obtained by inverting the bit value included in the Y bit string by logical negation, and The arithmetic circuit diagnosis apparatus according to claim 1, wherein the arithmetic circuit diagnosis apparatus calculates a logical product with the inverted Y bit string.
  6.  前記参照演算部は、前記演算回路診断部によって前記第一の診断回路が正しい演算結果が得られる演算回路であると判定された場合、前記第一の診断回路を用いて、第二の参照演算式を演算し、
     前記診断演算部は、診断される第二の診断回路を用いて、前記第二の参照演算式と同じ演算結果が求まる第二の診断演算式を演算し、
     前記演算回路診断部は、前記診断演算部によって演算された前記第二の診断演算式の演算結果を前記参照演算部によって演算された前記第二の参照演算式の演算結果と比較し、比較結果に基づいて前記第二の診断回路が正しい演算結果が得られる演算回路であるか判定する
    ことを特徴とする請求項1に記載の演算回路診断装置。
    In the case where the arithmetic circuit diagnosis unit determines that the first diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result, the reference arithmetic unit uses the first diagnostic circuit to perform a second reference arithmetic operation. Calculate the expression,
    The diagnostic calculation unit uses a second diagnostic circuit to be diagnosed to calculate a second diagnostic calculation formula that obtains the same calculation result as the second reference calculation formula,
    The arithmetic circuit diagnosis unit compares the operation result of the second diagnostic operation expression calculated by the diagnosis operation unit with the operation result of the second reference operation expression calculated by the reference operation unit, and compares the result. The arithmetic circuit diagnosis apparatus according to claim 1, wherein the second diagnostic circuit determines whether or not the second diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result.
  7.  前記第一の診断回路は乗算を行う演算回路であり、
     前記第二の参照演算式は2のY乗を乗算によって求めて、値Xに2のY乗を掛けた値を乗算によって求める演算式であり、
     前記第二の診断回路はビット列を左にシフトする左シフトを行う演算回路であり、
     前記第二の診断演算式は値Xを表すビット列を左にYビットシフトしたビット列が表す値を左シフトによって求める演算式である
    ことを特徴とする請求項6に記載の演算回路診断装置。
    The first diagnostic circuit is an arithmetic circuit that performs multiplication,
    The second reference arithmetic expression is an arithmetic expression that obtains a value obtained by multiplying a value X by a power of 2 to the value obtained by multiplying the value X by the power of 2 to the Y power,
    The second diagnostic circuit is an arithmetic circuit that performs a left shift to shift a bit string to the left,
    7. The arithmetic circuit diagnosis apparatus according to claim 6, wherein the second diagnostic arithmetic expression is an arithmetic expression for obtaining a value represented by a bit string obtained by shifting a bit string representing a value X by Y bits to the left by left shifting.
  8.  前記第一の診断回路は減算を行う演算回路であり、
     前記第二の参照演算式は値Xから値Yを引ける回数を表す値を減算によって求める演算式であり、
     前記第二の診断回路は除算を行う演算回路であり、
     前記第二の診断演算式は前記値Xを前記値Yで割った商を除算によって求める演算式である
    ことを特徴とする請求項6に記載の演算回路診断装置。
    The first diagnostic circuit is an arithmetic circuit that performs subtraction,
    The second reference arithmetic expression is an arithmetic expression for obtaining a value representing the number of times the value Y can be subtracted from the value X by subtraction,
    The second diagnostic circuit is an arithmetic circuit that performs division,
    The arithmetic circuit diagnosis apparatus according to claim 6, wherein the second diagnostic arithmetic expression is an arithmetic expression for obtaining a quotient obtained by dividing the value X by the value Y by division.
  9.  前記参照演算部は、前記第一の診断回路と前記第一の参照回路と正しい演算結果が得られる第二の参照回路とを用いて、前記第二の参照演算式を演算し、
     前記第一の診断回路は論理積を求める演算回路であり、
     前記第一の参照回路はビット値を反転する論理否定を行う演算回路であり、
     前記第二の参照回路は論理和を求める演算回路であり、
     前記第二の参照演算式は値Xを表すXビット列に含まれるビット値を反転した反転Xビット列と値Yを表すYビット列に含まれるビット値を反転した反転Yビット列とを論理否定によって求めて、前記Xビット列と前記反転Yビット列との論理積を表す第一の論理積ビット列と前記反転Xビット列と前記Yビット列との論理積を表す第二の論理積ビット列とを求めて、前記第一の論理積ビット列と前記第二の論理積ビット列との論理和を求める演算式であり、
     前記診断演算部は、前記第二の診断回路を用いて、前記第二の診断演算式を演算し、
     前記第二の診断回路は排他的論理和を求める演算回路であり、
     前記第二の診断演算式は前記Xビット列と前記Yビット列との排他的論理和を求める演算式である
    ことを特徴とする請求項6に記載の演算回路診断装置。
    The reference calculation unit calculates the second reference calculation expression using the first diagnostic circuit, the first reference circuit, and a second reference circuit that obtains a correct calculation result,
    The first diagnostic circuit is an arithmetic circuit for obtaining a logical product,
    The first reference circuit is an arithmetic circuit that performs a logical negation to invert a bit value,
    The second reference circuit is an arithmetic circuit for obtaining a logical sum,
    The second reference arithmetic expression is obtained by logically negating an inverted X bit string obtained by inverting the bit value included in the X bit string representing the value X and an inverted Y bit string obtained by inverting the bit value included in the Y bit string representing the value Y. A first logical product bit string representing a logical product of the X bit string and the inverted Y bit string, and a second logical product bit string representing a logical product of the inverted X bit string and the Y bit string; Is an arithmetic expression for obtaining a logical sum of the logical product bit string and the second logical product bit string,
    The diagnostic calculation unit calculates the second diagnostic calculation formula using the second diagnostic circuit,
    The second diagnostic circuit is an arithmetic circuit for obtaining an exclusive OR,
    The arithmetic circuit diagnosis device according to claim 6, wherein the second diagnostic arithmetic expression is an arithmetic expression for obtaining an exclusive OR of the X bit string and the Y bit string.
  10.  前記参照演算部は、前記演算回路診断部によって前記第二の診断回路が正しい演算結果が得られる演算回路であると判定された場合、前記第二の診断回路を用いて、第三の参照演算式を演算し、
     前記診断演算部は、診断される第三の診断回路を用いて、前記第三の参照演算式と同じ演算結果が求まる第三の診断演算式を演算し、
     前記演算回路診断部は、前記診断演算部によって演算された前記第三の診断演算式の演算結果を前記参照演算部によって演算された前記第三の参照演算式の演算結果と比較し、比較結果に基づいて前記第三の診断回路が正しい演算結果が得られる演算回路であるか判定する
    ことを特徴とする請求項6に記載の演算回路診断装置。
    The reference arithmetic unit uses the second diagnostic circuit to determine a third reference arithmetic operation when the arithmetic circuit diagnostic unit determines that the second diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result. Calculate the expression,
    The diagnostic calculation unit uses a third diagnostic circuit to be diagnosed to calculate a third diagnostic calculation formula that obtains the same calculation result as the third reference calculation formula,
    The arithmetic circuit diagnosis unit compares the operation result of the third diagnostic operation expression calculated by the diagnosis operation unit with the operation result of the third reference operation expression calculated by the reference operation unit, and compares the result. The arithmetic circuit diagnosis device according to claim 6, wherein the third diagnostic circuit determines whether the arithmetic circuit can obtain a correct arithmetic result based on the calculation result.
  11.  前記参照演算部は、前記第二の診断回路と正しい演算結果が得られる正常演算回路とを用いて、前記第三の参照演算式を演算し、
     前記第二の診断回路は除算を行う演算回路であり、
     前記正常演算回路は乗算を行う演算回路であり、
     前記第三の参照演算式は2のY乗を乗算によって求めて、値Xを2のY乗で割った商を除算によって求める演算式であり、
     前記診断演算部は、前記第三の診断回路を用いて、前記第三の診断演算式を演算し、
     前記第三の診断回路は符号を表す符号ビットを含むビット列を前記符号ビットを除いて右にシフトする算術右シフトを行う演算回路であり、
     前記第三の診断演算式は前記値Xを表すビット列を前記値Xの符号を表す符号ビットを除いて右にYビットシフトしたビット列が表す値を算術右シフトによって求める演算式である
    ことを特徴とする請求項10に記載の演算回路診断装置。
    The reference calculation unit calculates the third reference calculation expression using the second diagnostic circuit and a normal calculation circuit that obtains a correct calculation result,
    The second diagnostic circuit is an arithmetic circuit that performs division,
    The normal arithmetic circuit is an arithmetic circuit that performs multiplication,
    The third reference arithmetic expression is an arithmetic expression that obtains the quotient obtained by dividing the value X by 2 to the Y power, and obtains the quotient obtained by dividing the value X by the power of 2 Y,
    The diagnostic calculation unit calculates the third diagnostic calculation expression using the third diagnostic circuit,
    The third diagnostic circuit is an arithmetic circuit that performs an arithmetic right shift to shift a bit string including a sign bit representing a sign to the right except for the sign bit,
    The third diagnostic arithmetic expression is an arithmetic expression for obtaining, by arithmetic right shift, a value represented by a bit string obtained by shifting a bit string representing the value X to the right by Y bits except for a sign bit representing the sign of the value X. The arithmetic circuit diagnosis apparatus according to claim 10.
  12.  前記参照演算部は、前記演算回路診断部によって前記第三の診断回路が正しい演算結果が得られる演算回路であると判定された場合、前記第三の診断回路を用いて、第四の参照演算式を演算し、
     前記診断演算部は、診断される第四の診断回路を用いて、前記第四の参照演算式と同じ演算結果が求まる第四の診断演算式を演算し、
     前記演算回路診断部は、前記診断演算部によって演算された前記第四の診断演算式の演算結果を前記参照演算部によって演算された前記第四の参照演算式の演算結果と比較し、比較結果に基づいて前記第四の診断回路が正しい演算結果が得られる演算回路であるか判定する
    ことを特徴とする請求項10に記載の演算回路診断装置。
    When the arithmetic circuit diagnosis unit determines that the third diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result, the reference arithmetic unit uses the third diagnostic circuit to perform a fourth reference arithmetic operation. Calculate the expression,
    The diagnostic calculation unit uses a fourth diagnostic circuit to be diagnosed to calculate a fourth diagnostic calculation formula that obtains the same calculation result as the fourth reference calculation formula,
    The arithmetic circuit diagnosis unit compares the operation result of the fourth diagnostic operation expression calculated by the diagnosis operation unit with the operation result of the fourth reference operation expression calculated by the reference operation unit, and compares the result. The arithmetic circuit diagnosis apparatus according to claim 10, wherein the fourth diagnostic circuit determines whether the arithmetic circuit can obtain a correct arithmetic result based on the calculation result.
  13.  前記参照演算部は、前記第三の診断回路と正しい演算結果が得られる正常演算回路とを用いて、前記第四の参照演算式を演算し、
     前記第三の診断回路は符号を表す符号ビットを含むビット列を前記符号ビットを除いて右にシフトする算術右シフトを行う演算回路であり、
     前記正常演算回路は論理積を求める演算回路であり、
     前記第四の参照演算式は値Xを表すXビット列を前記値Xの符号を表すX符号ビットを除いて右にYビットシフトしたシフトビット列を算術右シフトによって求めて、ビット値が0である符号ビットとビット値が1である他のビットとから成るビット列と前記シフトビット列との論理積を求める演算式であり、
     前記診断演算部は、前記第四の診断回路を用いて、前記第四の診断演算式を演算し、
     前記第四の診断回路は符号を表す符号ビットを含めてビット列を右にシフトする論理右シフトを行う演算回路であり、
     前記第四の診断演算式は前記Xビット列を前記X符号ビットを含めて右にYビットシフトしたビット列を論理右シフトによって求める演算式である
    ことを特徴とする請求項12に記載の演算回路診断装置。
    The reference calculation unit calculates the fourth reference calculation expression using the third diagnostic circuit and a normal calculation circuit that obtains a correct calculation result,
    The third diagnostic circuit is an arithmetic circuit that performs an arithmetic right shift to shift a bit string including a sign bit representing a sign to the right except for the sign bit,
    The normal arithmetic circuit is an arithmetic circuit for obtaining a logical product,
    The fourth reference arithmetic expression obtains a shift bit string obtained by shifting the X bit string representing the value X by Y bits to the right excluding the X sign bit representing the sign of the value X, and the bit value is 0. An arithmetic expression for obtaining a logical product of a bit string composed of a sign bit and another bit having a bit value of 1 and the shift bit string,
    The diagnostic computation unit computes the fourth diagnostic computation expression using the fourth diagnostic circuit,
    The fourth diagnostic circuit is an arithmetic circuit that performs a logical right shift that shifts a bit string to the right including a sign bit representing a sign,
    13. The arithmetic circuit diagnosis according to claim 12, wherein the fourth diagnostic arithmetic expression is an arithmetic expression for obtaining a bit string obtained by shifting the X bit string including the X sign bit to the right by Y bits to the right by a logical right shift. apparatus.
  14.  正しい演算結果が得られる演算回路である第一の参照回路を用いて、第一の参照演算式を演算する参照演算処理と、
     診断される演算回路である第一の診断回路を用いて、前記第一の参照演算式と同じ演算結果が求まる第一の診断演算式を演算する診断演算処理と、
     前記診断演算処理によって演算された前記第一の診断演算式の演算結果を前記参照演算処理によって演算された前記第一の参照演算式の演算結果と比較し、比較結果に基づいて前記第一の診断回路が正しい演算結果が得られる演算回路であるか判定する演算回路診断処理と
    をコンピュータに実行させるための演算回路診断プログラム。
    Using a first reference circuit, which is an arithmetic circuit that obtains a correct calculation result, a reference calculation process for calculating a first reference calculation expression;
    Using a first diagnostic circuit, which is an arithmetic circuit to be diagnosed, a diagnostic arithmetic process for calculating a first diagnostic arithmetic expression that obtains the same arithmetic result as the first reference arithmetic expression;
    The operation result of the first diagnostic operation expression calculated by the diagnosis operation process is compared with the operation result of the first reference operation expression calculated by the reference operation process, and the first result is calculated based on the comparison result. An arithmetic circuit diagnosis program for causing a computer to execute arithmetic circuit diagnosis processing for determining whether the diagnostic circuit is an arithmetic circuit that can obtain a correct arithmetic result.
PCT/JP2014/064598 2014-06-02 2014-06-02 Calculation circuit diagnostic device and calculation circuit diagnostic program WO2015186170A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/064598 WO2015186170A1 (en) 2014-06-02 2014-06-02 Calculation circuit diagnostic device and calculation circuit diagnostic program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/064598 WO2015186170A1 (en) 2014-06-02 2014-06-02 Calculation circuit diagnostic device and calculation circuit diagnostic program

Publications (1)

Publication Number Publication Date
WO2015186170A1 true WO2015186170A1 (en) 2015-12-10

Family

ID=54766274

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/064598 WO2015186170A1 (en) 2014-06-02 2014-06-02 Calculation circuit diagnostic device and calculation circuit diagnostic program

Country Status (1)

Country Link
WO (1) WO2015186170A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001154870A (en) * 1999-11-25 2001-06-08 Hitachi Ltd Information processor
JP2002099447A (en) * 2000-09-22 2002-04-05 Fujitsu Ltd Processor
JP2003167755A (en) * 2001-11-30 2003-06-13 Nippon Signal Co Ltd:The Fault diagnostic method and device for signal processing system
JP2012059127A (en) * 2010-09-10 2012-03-22 Toyota Motor Corp Information processor, watch dog timer and abnormality detection method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001154870A (en) * 1999-11-25 2001-06-08 Hitachi Ltd Information processor
JP2002099447A (en) * 2000-09-22 2002-04-05 Fujitsu Ltd Processor
JP2003167755A (en) * 2001-11-30 2003-06-13 Nippon Signal Co Ltd:The Fault diagnostic method and device for signal processing system
JP2012059127A (en) * 2010-09-10 2012-03-22 Toyota Motor Corp Information processor, watch dog timer and abnormality detection method

Similar Documents

Publication Publication Date Title
JP6407001B2 (en) Electronic device and system for converting floating point number to integer and method for operating the same
EP2660796B1 (en) Arithmetical device, arithmetical device elliptical scalar multiplication method and elliptical scalar multiplication program, arithmetical device multiplicative operation method and multiplicative operation program, as well as arithmetical device zero determination method and zero determination program
JP5640081B2 (en) Integer and multiply-add operations with saturation
CN110851113A (en) Method and device for detecting randomness of byte sequence, storage medium and electronic equipment
WO2015186170A1 (en) Calculation circuit diagnostic device and calculation circuit diagnostic program
JP7044528B2 (en) Leading Zero Forecast
JP5175983B2 (en) Arithmetic unit
US9448767B2 (en) Three-term predictive adder and/or subtracter
TWI630545B (en) Non-modular multiplier, method for non-modular multiplication and computational device
Piestrak Design of multi-residue generators using shared logic
CN112394904B (en) Floating point data processing method, arithmetic unit and electronic equipment
KR102528467B1 (en) Method, device and recording medium for processing division operation
JP2006286015A (en) Arithmetic processing unit and its self-diagnostic method
JP6519530B2 (en) Verification apparatus, verification program, and verification method
JP6494887B1 (en) Inspection apparatus, inspection method and inspection program
CN115729554A (en) Formalized verification constraint solving method and related equipment
JP4159565B2 (en) Vector product-sum operation circuit
JP6932296B2 (en) Mapping system, mapping method and mapping program
KR101918741B1 (en) Method for distinction of safe prime number
US10133624B2 (en) Fault localization and error correction method for self-checking binary signed-digit adder and digital logic circuit for the method
JP3239866B2 (en) Data inspection method and apparatus based on CRC and recording medium
WO2011142015A1 (en) Operator anomaly assessment device and method
JP5316096B2 (en) Arithmetic circuit with error detection function and error detection method of arithmetic circuit
JP2005182294A (en) Mean value calculating device and method
JP6193674B2 (en) CONVERSION CIRCUIT DESIGN DEVICE, CONVERSION CIRCUIT DESIGN PROGRAM, AND CONVERSION CIRCUIT DESIGN METHOD

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14893869

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14893869

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP