METHOD FOR TESTING AN ELECTRONIC CONTROL UNIT WITH A SIMULATOR

DE502024000635D1Active Publication Date: 2026-02-19DSPACE DIGITAL SIGNAL PROCESSING & CONTROL ENGINEERING GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
DE502024000635
Authority / Receiving Office
DE · DE
Patent Type
Patents
Current Assignee / Owner
Priority Date
2023-06-29
Filing Date
2024-06-11
Publication Date
2026-02-19
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

Existing methods for matrix-vector multiplication in hardware-in-the-loop simulations, particularly using FPGAs, are inefficient due to the need for numerous elementary additions, leading to high computational overhead and difficulty in achieving real-time calculations for complex systems like electric drives.

Method used

The method decomposes matrix-vector multiplication into a sequence of summations by prioritizing matrix elements with the highest summation usability and reusing identical products and sums, using a sequence determination step and residual matrices to optimize the calculation process.

Benefits of technology

This optimization significantly reduces computational effort, enabling real-time simulation of complex environment models that were previously unfeasible, optimizing hardware resource utilization and improving calculation speed.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The invention relates to a computer-implemented method for testing an electronic control unit with a simulator, wherein the simulator numerically calculates a mathematical environment model on a computing unit, wherein the environment model at least partially simulates the environment of the control unit, wherein the control unit and the simulator are coupled to each other via corresponding I / O interfaces and interact with each other, wherein a matrix-vector multiplication is performed during the numerical calculation of the environment model on the simulator, in which a matrix is ​​multiplied by a vector to form a result vector, wherein the matrix-vector multiplication is decomposed into a sequence of summations of two summands, wherein each summand is a product of two factors, one factor being an element of the matrix and the other factor being an element of the vector.

[0002] The computer-implemented methods discussed here come from the field of hardware-in-the-loop (HIL) simulation, in which the environment of an electronic control unit (ECU) is simulated—partially or completely. This makes it possible to safely test and evaluate the ECU in a simulated environment, rather than in the actual physical process in which it will later be used. A typical example is an ECU for an electric drive, for instance, from the automotive sector, whose environment—that is, the electric drive and, if applicable, other environmental components (such as the vehicle chassis)—is simulated using the simulator. For this purpose, the ECU is connected via its I / O interface to a corresponding I / O interface of the simulator, so that relevant signals (power signals from semiconductor bridges, sensor signals, etc.) can be exchanged as they would be in the actual operation of the ECU.In the case of the control unit for an electric drive mentioned as an example, the simulator also includes suitable power electronics modules to simulate corresponding electrical loads for the control unit.

[0003] The control unit can exist in different forms: as a development control unit, which still differs from the final hardware implementation; as a final production control unit; or as a virtual control unit, which exists as a software replica. Even in the latter case, the simulator and the control unit are connected via corresponding I / O interfaces, although these are implemented only in a data-based manner.

[0004] The test of the control unit consists of operating it in conjunction with the simulator. This allows for determining whether the control unit and the control system implemented on it achieve the expected behavior. In other words, a comparison is made between the expected target behavior and the actual behavior observed in the simulation. For this to work, it is not only necessary that the mathematical environment model be calculated numerically as accurately as possible, but also that it be calculated in real time for real-time simulations: The calculation of the system behavior within a one-second simulation interval must therefore be completed within a maximum of one second of physical real time.Simulating power electronic systems with fast-switching semiconductors is particularly challenging because these systems often exhibit large eigenvalues ​​and thus high rates of change in their state variables, especially compared to mechanical systems. Significant efforts are being made to improve the numerical handling of simulations to meet real-time requirements, and / or specialized hardware is being used to enable fast computations, such as programmable logic devices, often in the form of FPGAs (Field Programmable Gate Arrays).

[0005] The numerical calculation of systems of differential equations practically always boils down to matrix operations, often in the form of matrix-vector multiplications, which is immediately obvious when, for example, the state space description of a system is considered after time discretization – which is carried out using numerical methods (see, for example, WO 2020 / 099659 A1).

[0006] German patent application DE 102021131391 A1 describes a computer-implemented method for the real-time simulation of electrical circuits, in particular for testing real electronic control units (ECUs) using a simulator. The simulator uses a mathematical environment model that is numerically computed on a processing unit – typically an FPGA. Communication between the ECU and the simulator takes place via I / O interfaces, with sensor signals being simulated and processed. The patent application mentions the use of matrix operations, including matrix-vector multiplications, but without providing further details on the specific computational methods within the matrix calculation blocks.

[0007] The journal article by Qasim et al., IJCSNS International Journal of Computer Science and Network Security, COL. 10 No. 2, February 2010, entitled "FPGA Design and Implementation of Matrix Multiplier Architectures for Image and Signal Processing Applications," describes the implementation of matrix multiplication architectures on FPGAs for image and signal processing applications. The focus is on a multiply-accumulate unit in which matrix and vector elements are multiplied pairwise, and the results are successively summed. The architecture utilizes feedback from the adder output to efficiently calculate ongoing subtotals. The article provides a concrete hardware description but does not address optimization of the computation sequence or reuse of subtotals to reduce computational overhead.

[0008] Especially when using FPGAs, it is usually necessary to work with elementary adders, which can only add two terms to a sum. Matrix-vector multiplication often results in sums with a large number of terms, namely at most equal to the number of row elements in a row of the matrix involved. Therefore, the sum must be decomposed into partial sums, i.e., into the aforementioned sequence of summations of two terms. The object of the present invention is to further improve such matrix-vector multiplication.

[0009] The previously derived problem is solved in the method described at the outset for testing an electronic control unit with a simulator by the features of the characterizing part of independent claim 1, namely by determining, in a sequence determination step, the next sum in the sequence whose summands depend on matrix elements from the most populated row of the matrix, wherein the matrix elements from the most populated row are selected that have the highest summation usability. It is advantageous to use matrix elements from the most populated row with high priority, since the most two-additions have to be performed in a row with the most populated elements until the final row sum is finally calculated. Furthermore, it is advantageous to start with those elements from this row that have the highest summation usability, i.e.,These elements allow, firstly, the formation of summand pairs, and secondly, the formation of summand pairs that also appear in another row of the matrix. Both contribute to the summability of a matrix element. Sumability is therefore also a measure of the reusability of a summand pair when calculating the matrix-vector product.

[0010] Furthermore, the sequence determination step is repeated with a residual matrix instead of the matrix until the residual matrix no longer contains any non-zero matrix elements. The residual matrix is ​​derived from the matrix by setting all matrix elements to zero that are involved in a sum already planned in the sequence. The residual matrix therefore contains all matrix elements for which no sum has yet been planned.

[0011] Finally, the summations are performed in the planned sequence, with the product operations for calculating the addends being carried out in the sequence required for the summation. The product operations between a matrix element of the matrix and a vector element of the vector follow the planned summation sequence; that is, the products are calculated when they are needed for a summation.

[0012] In a final summation step, the sums resulting from the previous summation are calculated in each row of the result vector by successive pairwise addition.

[0013] In a further development of the method, the matrix is ​​examined for elements with the same absolute value in a given column, since identical products must be calculated at these matrix positions. The corresponding product of the absolute value of one of the identical matrix elements and the absolute value of a corresponding vector element is calculated only once. The result of the calculation for the product at the other matrix positions with identical elements is then retrieved and not recalculated. This specifically reduces the computational effort required to calculate the matrix-vector product. Preferably, if the matrix element and the corresponding vector element have different signs, only a sign bit of the pre-calculated absolute value product is set, which further reduces the computational effort.

[0014] To further reduce computational effort, a preferred embodiment of the method includes examining the matrix for multiple identical matrix elements in two different rows and identical columns. This corresponds to identical sums or subtotals in the result vector, where such a sum or subtotal is calculated only once. The calculation result in the other rows with identical sums or subtotals is simply retrieved and not recalculated for the purpose of calculating the result vector. Since matrix positions with high summation potential are given preferential treatment in the sequence determination step, identical duplicate calculations are identified at the beginning of the process, and the residual matrix is ​​thus quickly thinned. Care is also taken to ensure that the sums are equal in absolute value, as this also means that the sum only needs to be calculated once.A change of sign can be easily achieved by setting the sign bit accordingly.

[0015] The meaning of summability has been explained in general terms at the outset. There are various ways to implement the numerical calculation of the summability measure. In a preferred embodiment of the method, it has proven effective to assign a summability value of 1 to an element of the matrix with a non-zero element value if another element in the same row of the matrix also has a non-zero element value, meaning that the element is fundamentally involved in a summation within its row. The summability value increases by 1 for each conceivable pair of summands in that row of the matrix that has the same absolute value and appears in another row of the matrix.

[0016] If several rows of the matrix are equally occupied with the highest values, in a further development of the procedure, a summary sum usability is determined for each of these rows of the matrix in the sequence determination step, corresponding to the sum of the sum usabilities of the matrix elements of the corresponding row, and then the row with the highest summary sum usability is selected.

[0017] In the case of the existence of several rows in the matrix with the same highest number of entries and with the same summative sum usability, one of the following variants is implemented in preferred embodiments: One of the several rows is selected by chance, or by choosing the row with the smallest row number, or by choosing the row with the largest row number.

[0018] As previously explained, matrix-vector multiplication, when calculating an element of the result vector, requires sums with considerably more than two summands, depending on the size of the matrix and the size of the vector. If the matrix has n columns, there are at most n summands. Then the previously described steps must be repeated until all summations in each row have been represented by elementary additions of only two summands.

[0019] For the aforementioned reason, a further development of the procedure is characterized by the fact that in the final summation step an auxiliary matrix is ​​formed with a number of rows corresponding to the number of rows of the matrix and with a number of columns corresponding to the number of summations in the already determined sequence of summations, that a summation of the already determined sequence of summations is entered into each column, specifically in the row to which the summation contributes in the result vector, that the sequence determination step is carried out with the auxiliary matrix, and that the sequence determination step is repeated with an auxiliary residual matrix instead of the auxiliary matrix until the auxiliary residual matrix no longer contains any non-zero matrix elements.The auxiliary residual matrix is ​​derived from the auxiliary matrix by setting all matrix elements in the auxiliary matrix to zero that are involved in a sum already planned in the sequence. The sums are then performed in the now extended planned sequence. The sums resulting from the previous extended sum are calculated in each row of the result vector by successive pairwise addition.

[0020] Preferably, the described procedure step is repeated so often that the required number of summations for matrix-vector multiplication has been completely decomposed into a sequence of summations of two summands.

[0021] If the computing unit of the simulator is a programmable logic module, then in a further embodiment of the method, it is provided that the specific sequence for the summations in the calculation of the matrix-vector multiplication is based on the environment model and the environment model is transferred into a hardware description for the programmable logic module, whereby the programmable logic module is configured as the computing unit of the simulator with the hardware description.

[0022] The described method allows matrix-vector multiplications to be performed in an optimized manner, significantly increasing the speed of the environment model calculation. This makes it possible to run environment models on the simulator—especially in real time—that were previously impossible to run on the simulator, particularly in real time. The use of this method optimizes the utilization of hardware resources, especially when programmable logic devices are used as the simulator's processing unit.

[0023] The previously described task is also solved using a computer program with instructions which, when executed with the simulator or a simulation environment, cause the simulator or simulation environment to perform the previously described procedure.

[0024] In detail, there are numerous possibilities for elaborating and further developing the method according to the invention. Reference is made, on the one hand, to the claims subordinate to the independent claim, and on the other hand, to the following description of exemplary embodiments in conjunction with the drawing. The drawing shows Fig. 1 schematically shows a computer-implemented method for testing a control unit with a simulator, Fig. 2 schematically shows the method for testing a control unit using an example, employing a sequence determination step with the criteria of highest row occupancy and highest sum usability, as well as the application of a residual matrix, Fig. 3 shows the embodiment of the method according to Fig. 2 further using the residual matrix, Fig. 4 shows an embodiment of the method according to Fig. 2 and 3using an auxiliary matrix and an auxiliary residual matrix and Fig. 5, the calculation of the matrix-vector product based on the values ​​shown in the Fig. 2 bis 4 determined sequence of summations.

[0025] In the Fig. 1 bis 5 In various aspects, a computer-implemented procedure 1 for testing an electronic control unit 2 with a simulator 3 is presented.

[0026] Fig. 1 Figure 2 shows a typical device setup for testing control unit 2 within the framework of a so-called hardware-in-the-loop simulation. In this case, control unit 2 is a real development control unit. The simulator 3 has several processing units, some of which are implemented as field-programmable gate arrays (FPGAs). A mathematical environment model 4 is numerically calculated on one of the FPGA processing units, with the environment model 4 simulating the environment of control unit 2. In this specific case, control unit 2 is the control unit for a three-phase electric drive and has a corresponding power supply (not shown in detail) to enable it to drive the required power. Control unit 2 also includes power electronic half-bridge arrangements with fast-switching semiconductor switches.Simulator 3 features corresponding power electronic load modules with which the control unit 2 can be electrically loaded. In generator mode, the simulated loads can also feed energy into the control unit 2. The control unit 2 and Simulator 3 are physically coupled via corresponding I / O interfaces 5 and 6 and can interact with each other. Simulator 3 can be adapted to the hardware requirements of the environment model 4 and the desired test cases via plug-in modules 7.

[0027] By applying numerical solution methods, matrix-vector multiplications must be performed in the numerical calculation of the environment model 4 on the simulator 3. In a matrix-vector multiplication, a matrix M is multiplied by a vector v to produce a result vector r. In the top row of Fig. 2 Such a matrix-vector multiplication is illustrated using a concrete example. It is assumed that the matrix elements ki are non-zero, as are the vector elements vi. The right-hand term in the top row of Fig. 2 makes it clear that sums with a large number of summands occur in matrix-vector multiplication; it gives the mathematically correct implementation of matrix-vector multiplication without taking into account special features of the hardware architecture or the software implementation possibilities.

[0028] The use of FPGAs as computing units of Simulator 3 necessitates that matrix-vector multiplication be decomposed into a sequence of summations of two summands, where each summand is a product of two factors, one factor being an element ki of the matrix M and the other factor being an element vj of the vector v.

[0029] Based on the in the Fig. 2 bis 5 In the illustrated embodiment, method 1 is explained, which allows matrix-vector multiplication to be performed in a time-optimized manner, so that, for example, extensive environment models 4 can be calculated on the simulator 3 - especially under real-time conditions - which were previously not feasible without the application of method 1 - assuming the same hardware equipment.

[0030] The procedure described below is based on the fact that identical products and identical sums of two identical summands are recognized in the entire matrix M, that the frequency of matrix elements in their participation in recurring summands is recognized and prioritized, and thereby multiple calculations are avoided.

[0031] In Fig. 2 In the middle row, it can first be seen that in a sequence determination step 8, the next summation in the sequence is determined to be the summands whose summands depend on matrix elements ki from a row with the highest number of entries in the matrix M, whereby the matrix elements ki from the row with the highest number of entries are chosen.

[0032] The number of entries in a row of matrix M is represented by the vector s. The given values ​​simply indicate how many positions in a row of matrix M are occupied by a non-zero value. Correspondingly, there is also a corresponding number of possible sums (one fewer sum than the number of non-zero positions).

[0033] The concept of sum applicability P requires some explanation. In the middle row of Fig. 2 The matrix P is given, which indicates the summability of each corresponding element of matrix M. For an element ki of matrix M at a position Mij of matrix M, having the highest possible summability means, firstly, that in the row Mi of element Mij, there are other non-zero elements Mij of matrix M with which, in principle, pairs of summands can be formed, and secondly, that pairs of summands can be formed with these other elements that also appear in another row of matrix M. Both of these factors contribute to the summability Pij of a matrix element Mij. The summability Pij is therefore also a measure of the reusability of a matrix element Mij as part of a pair of summands when calculating the matrix-vector product.

[0034] There are many ways to implement this evaluation measure numerically. One particularly simple method, which has been applied here, is to assign a value of 1 to the summation utility Pij of an element Mij of matrix M if its element magnitude is not zero and if another element Mij in the same row Mi of matrix M also has a non-zero element magnitude, thus ensuring that element Mij is always involved in summing within its row. Furthermore, the summation utility Pij increases by 1 for each conceivable pair of summands in row Mi of matrix M that has the same absolute value and appears in another row of matrix M.

[0035] If, for example, the summation utility P11 of matrix element M11 is evaluated according to this scheme, it must first be noted that two elements in row M1 of matrix M are non-zero, which contributes a value of 1 to the summation utility P11 of matrix element M11. Furthermore, it must be noted that the pair of summands in row M1 of matrix M, consisting of matrix elements M11 and M12 (with the values ​​-k1 and -k2), is identically found in row 2 in columns 1 and 2 of matrix M, except for the reversed signs of matrix elements M21 and M22. This also leads to an increase of 1 in the summation utility P11 of matrix element M11. Therefore, the summation utility P11 of matrix element M11 has a value of 2.

[0036] As an example, let's determine the summation value P21 of the matrix element M21. In the second row of matrix M, which also contains matrix element P21, there are two other non-zero matrix elements with the values ​​k2 and k4. This contributes 1 to the summation value P21 of matrix element M21. Furthermore, a sum can be formed with matrix element M23 (with the value k4). This sum has a corresponding entry, with the opposite sign, in row M3 of matrix M. Additionally, there is a sum of matrix elements M21 and M22 that corresponds to matrix elements -k1 and -k2 in the first row M1. These two corresponding pairs of summands each contribute 1 to the summation value P21 of matrix element M21. Therefore, the summation value P21 of matrix element M21 is 3.Following this principle, the other sum uses Pij of the other matrix elements Mij in the matrix M can be determined. Fig. 2 comprehend.

[0037] In the embodiment according to Fig. 2 Rows M2 and M3 of matrix M are equally populated, each with 3 elements (see the occupancy level s in rows two and three). In this case, it is questionable from which row Mi of matrix M the matrix elements Mij from matrix M should be used for the summation. In the illustrated embodiment, in sequence determination step 8, if there are several equally populated rows Mi of matrix M, a summational summation value qi is determined for each of these rows Mi of matrix M, see the vector q, corresponding to the sum of the summation values ​​Pi of the matrix elements Mi of the corresponding row Mi. The row Mi with the highest summational summation value qi is then selected. In the illustrated case, row 2 has the highest summational summation value of 7 (i.e., the sum of all summation values ​​in row two (3+2+2=7)).Therefore, the sum is calculated using the matrix positions M21 and M22.

[0038] Simultaneously, two further measures are taken: The system checks whether products or sums with identical absolute values ​​appear again in the matrix or in the calculation of the matrix-vector product. These products or sums are noted and then retrieved and used at the appropriate position, but not recalculated.

[0039] In detail, this means that in method 1, the matrix M is examined for matrix elements ki of equal absolute value in a column Mj of the matrix M. Since identical products of equal absolute value are to be calculated at these matrix positions with identical matrix elements ki in a column Mj, a corresponding product of the absolute value of one of the identical matrix elements ki and the absolute value of a corresponding vector element vj of the vector v is calculated only once. The result of the calculation for the product at the other matrix positions with identical matrix elements is only retrieved and not recalculated. In particular, if the matrix element ki and the corresponding vector element vj have different signs, a sign bit of the pre-calculated absolute value product is set accordingly. This applies, for example, to position M31 with the value -k1.The product k1*v1 can be used a total of three times, also at positions M11 and M21, there in connection with identical sums.

[0040] With regard to sums, the principle described above means that in procedure 1, the matrix M is examined for multiple identical matrix elements Mij in two different rows Mi and in identical columns Mj of the matrix M, since this corresponds to identical sums or subtotals in the result vector r. Such a sum or subtotal is calculated only once, and the result of the calculation in the other rows with identical sums or subtotals is merely retrieved and not recalculated for the calculation of the result vector r. In rows one and two of the matrix M, there are sums identical in magnitude, namely k1*v1+k2*v2. This sum is calculated only once and merely retrieved the second time. Here too, if completely negated signs are present, only the sign bit of the result value is inverted.

[0041] Applying the principles of "prioritizing terms with high summability" and "repeated use of products and sums with identical absolute values" leads to an initial sequence of sums with two addends. The necessary product calculations are then determined by these sums. The sums k1*v1+k2*v2 and - (k1*v1+k2*v2) require the calculation of the products k1*v1 and k2*v2, respectively.

[0042] In line three of Fig. 2 It can be seen that the matrix M becomes a purified residual matrix M'. Sequence determination step 8 is repeated with a residual matrix M' instead of the matrix M until the residual matrix M' no longer contains any non-zero matrix elements. The residual matrix M' is derived from the matrix M by setting all matrix elements Mij in the matrix M to zero that are involved in a sum calculation b already planned in the sequence. The already planned sum calculations and multiple product calculations are thus recorded in the vector b; only the uncalculated positions of the matrix M remain in the residual matrix M'.

[0043] In Fig. 3 This procedure is shown. In the top row, the residual matrix M', or rather each element M'ij of the residual matrix M', which is identical to the residual matrix M' in the third row, is shown. Fig. 2 , the sum usability is determined, see matrix P, first row in Fig. 3 The elements of the summation are M32 and M33 with the values ​​k3 and -k4, where the product k4*v3 can also be used at position M23 and is accordingly reserved and only retrieved but not calculated. The result of this first sequence determination step 8 is the decomposition of the summation into the summations b1 and b2.

[0044] In procedure 1, the summations b1, 2 are performed in the planned sequence, with the product calculations for calculating the addends being carried out in the sequence required for the summation; thus, the product calculation follows the sum calculation. In a final summation step 9, the sums resulting from the previous summation are calculated in each row of the result vector r by successive pairwise addition.

[0045] In this example, the question arises as to how to handle the remaining summations, since only summations b1 and b2 are available so far, but these still need to be added to the result vector r. If the formation of elementary additions with only two summands is completely mandatory, the additions associated with these summands will also be optimally planned. This is in Fig. 4 depicted.

[0046] In the final summation step 9, an auxiliary matrix M" is formed with a number of rows corresponding to the number of rows of matrix M and with a number of columns corresponding to the number of summations in the already determined sequence of summations bi, i.e., b1, b2 from Fig. 3 In each column, a sum of the already determined sequence of sums is entered, specifically in the row to which the sum contributes in the result vector r. Using the auxiliary matrix M" , sequence determination step 8 is performed, and this step is repeated with an auxiliary residual matrix M' instead of the auxiliary matrix M" until the auxiliary residual matrix M' no longer contains any non-zero elements. The matrix P, in which the summation possibilities of the elements of the auxiliary matrix M" are noted (top row in Fig. 4 The matrix M" has only entries with the value 1, since while summations are still being calculated in one row, there are no longer any (absolutely) identical summations in other rows of the auxiliary matrix M". Because the values ​​P, s, and q are the same for rows two and three of the auxiliary matrix M", the lowest row number is used for the next summation (k1*v1+k2*v2)+k4*v3. Furthermore, it is taken into account that there are absolutely identical entries at positions M"11 and M"21.

[0047] The auxiliary residual matrix M‴ is obtained from the auxiliary matrix M" by setting all matrix elements M"ij in the auxiliary matrix M" to zero that are involved in a summation b1 already planned in the sequence. Fig. 4 are involved, see line two in Fig. 4 The elements of the auxiliary residual matrix M‴ are also evaluated with regard to their suitability for summation (matrix P in row two of Fig. 4 ), this results in a further summation b2 in Fig. 4 , the auxiliary residual matrix M‴ is then completely cleared, see line three in Fig. 4 Finally, the sums b1, b2 are in Fig. 4 in the now extended planned sequence (in addition to the sums b1 and b2 from Fig. 3 ), and the sums resulting from the preceding extended summation are calculated in each row of the result vector r by successive pairwise addition.

[0048] For larger matrices, it may of course be necessary to repeat this process by repeating the previously described procedure step so often that the required number of summations for the matrix-vector multiplication has been completely decomposed into a sequence of summations of two summands.

[0049] The result of procedure 1 is that the following sequence of summations with the resulting product formations is planned and implemented: k1*v1, k2*v2 führt zu k1*v1 + k2*v2 k3*v2, k4*v3 führt zu k3*v2+(-k4*v3) (k1*v1+k2*v2)+k4*v3 (k3*v2-k4*v3)+(-k1*v1)

[0050] This result is in Fig. 5 The calculation has been reduced to four multiplications and four additions. This allows the calculations to be performed as quickly as possible based on the available FPGA resources. Bezugszeichen

[0051] 1 Computer-implemented method 2 Electronic control unit 3 Simulator 4 Mathematical environment model 5 Simulator I / O interface 6 Control unit I / O interface 7 Plug-in module 8 Sequence determination step 9 Final summation step MMatrix vVector rResult vector kiElement of the matrix vjElement of the vector bSummations PMatrix of sum uses sVector of row assignment qVector of summative sum use M'Residual matrix M"Auxiliary matrix M‴Auxiliary residual matrix

Claims

1. Computer-implemented method (1) for testing an electronic control unit (2) with a simulator (3), wherein the simulator (3) numerically calculates a mathematical environment model (4) on a computing unit, wherein the computing unit has an FPGA with elementary adders which can each process only two summands simultaneously, wherein the environment model (4) at least partially simulates the environment of the control unit (2), wherein the control unit (2) and the simulator (3) are coupled to one another via corresponding I / O interfaces (5, 6) are coupled to one another and interact with one another, a matrix-vector multiplication being carried out on the simulator (3) during the numerical calculation of the environment model (4), in which a matrix (M) is multiplied by a vector (v) to form a result vector (r), the matrix-vector multiplication being broken down into a sequence of summations (b) of two summands, each summand being a product of two factors, one factor being an element (ki) of the matrix (M) and the other factor being an element (vj) of the vector (v), characterised in that, in a sequence determination step (8), that summation (b) is determined as the next summation in the sequence whose summands depend on matrix elements (ki) from a most highly occupied row (s) of the matrix (M), the matrix elements (ki) from the most highly occupied row (s) which have the highest summation usability (P) being selected, in that the sequence determination step (8) is repeated with a residual matrix (M') instead of the matrix (M) until the residual matrix (M') no longer has any non-zero matrix elements, the residual matrix (M') emerging from the matrix (M) by setting to zero all matrix elements (Mij) in the matrix (M) which are involved in a summation (b) already scheduled in the sequence, in that the summations (b) are performed in the planned sequence, with the product formations for calculating the summands being performed in the sequence in which the summands are required for performing the summation (b), and in that, in a final summation step (9), the sums resulting from the preceding summation (b) are calculated in each row of the result vector (r) by successive pairwise addition, in that the matrix (M) is examined for a plurality of identical matrix elements (Mij) in two different rows (Mi) and in identical columns (Mj) of the matrix (M), since this corresponds to identical sums or partial sums in the result vector (r), such a sum or partial sum being calculated only once, and the calculation result in the other rows with identical sums or partial sums for calculating the result vector (r) only being called up and not recalculated, in that the sum usability (Pij) of an element (Mij) of the matrix (M) is evaluated as 1 in the case of an element amount not equal to 0 if in the same row (Mi) of the matrix (M) another element (Mij) of the matrix (M) has an element amount not equal to 0 and thus the element (Mij) is basically involved in a sum formation in its row, wherein the summation usability (Pij) increases by the value 1 in each case with each conceivable summand pair in the row (Mi) of the matrix (M) which occurs identically in terms of order in another row of the matrix (M), in that, in the final summation step (9), an auxiliary matrix (M") is formed with a number of rows corresponding to the number of rows of the matrix (M) and with a number of columns corresponding to the number of summations (b) in the already determined sequence of summations (b), in that a summation (b) of the already determined sequence of summations (b) is entered in each column, in the row to which the summation (b) makes a contribution in the result vector (r), in that the sequence determination step (8) is carried out with the auxiliary matrix (M") and in that the sequence determination step (8) is repeated with an auxiliary residual matrix (M‴) instead of the auxiliary matrix (M") as often as necessary, until the auxiliary residual matrix (M"') no longer has any non-zero matrix elements, the auxiliary residual matrix (M‴) being derived from the auxiliary matrix (M") by setting to zero all matrix elements (M"ij) in the auxiliary matrix (M") which are involved in a summation (b) already scheduled in the sequence, in that the summations (b) are carried out in the now extended planned sequence, and in that the sums resulting in the preceding extended summation (b) are calculated in each row of the result vector (r) by successive pairwise addition.

2. Method (1) according to claim 1, characterised in that the matrix (M) is examined for matrix elements (ki) of the same magnitude in a column (Mj) of the matrix (M), since products of identical magnitude are to be calculated at these matrix positions with identical matrix elements (ki) in a column (Mj), in that a corresponding product of the magnitude of one of the matrix elements (ki) with identical magnitudes and the magnitude of a corresponding vector element (vj) of the vector (v) is calculated only once and the calculation result for the product at the other matrix positions with matrix elements with identical magnitudes is only retrieved and not recalculated, in particular, if the matrix element (ki) and the corresponding vector element (vj) have different signs, a sign bit of the pre-calculated magnitude product is set accordingly.

3. Method (1) according to one of claims 1 and 2, characterised in that in the sequence determination step (8), in the presence of a plurality of equally highest occupied rows (Mi) of the matrix (M), a summary sum usability (qi) is determined for each of these rows (Mi) of the matrix (M), corresponding to the sum of the sum usabilities (Pij) of the matrix elements (Mij) of the corresponding row (Mi), and the row (Mi) with the highest summary sum usability (qi) is selected.

4. Method (1) according to claim 3, characterised in that, in the case of the existence of a plurality of rows (Mi) in the matrix (M) with the same highest occupancy (si) and with the same summary sum usability (qi), one of these plurality of rows (Mi) is selected at random or by selecting the row with the smallest row number or by selecting the row with the largest row number.

5. Method (1) according to claim 1, characterised in that the method step according to claim 1 is repeated until the required number of summations (b) for the matrix-vector multiplication has been completely broken down into a sequence of summations (b) of two summands.

6. Method (1) according to one of claims 1 to 5, characterised in that the control unit (2) is a real electronic control unit (2) or a virtual electronic control unit (2).

7. Method (1) according to one of claims 1 to 6, characterised in that the determined sequence for the summations (b) is used as the basis for the calculation of the matrix-vector multiplication within the framework of the environment model (4) and the environment model (4) is transferred into a hardware description for a programmable logic module, the programmable logic module being the computing unit of the simulator (3) and being configured with the hardware description.

8. Computer program comprising instructions which, when executed with a simulator (3), cause the simulator (3) to execute the method (1) according to any one of claims 1 to 7.