A fabric simulation acceleration system and method based on memristor in-memory computing architecture

Through the fabric simulation acceleration system based on the memristor in-memory computing architecture, the memristor array is used for simulation calculations to directly solve the linear equations, which solves the real-time and computing speed bottlenecks of the fabric simulation algorithm and achieves efficient fabric simulation acceleration.

CN119559031BActive Publication Date: 2025-09-26PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411599570.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-09-26
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

Existing cloth simulation algorithms have bottlenecks in real-time performance and computing speed, mainly due to low data transmission efficiency, high data dependence and high computational complexity. Traditional hardware acceleration strategies have limited improvement.

Method used

A memristor-based in-memory computing architecture is adopted, and memristor arrays are used for analog calculations to directly solve linear equations. Combined with the high parallel characteristics, the number of nodes and springs is used as the parallelism for calculation, avoiding frequent data transmission and iterative solutions.

Benefits of technology

Significantly improves the computational speed and efficiency of cloth simulations, applicable to all physically based cloth simulation problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559031B_ABST
    Figure CN119559031B_ABST
Patent Text Reader

Abstract

The present invention provides a fabric simulation acceleration system and method based on a memristor in-memory computing architecture, belonging to the fields of memristor in-memory computing technology and graphics hardware acceleration technology. The system includes a random access memory (RAM) composed of a memristor array, a content-addressable memory (CAM), a general computing unit, an equation solving unit, a digital-to-analog conversion module, a transimpedance amplifier, and a controller module. The system utilizes the memristor in-memory computing architecture to perform calculations in memory, avoiding frequent data reading. Simultaneously, the memristor array is used for analog calculations, directly solving linear equations and avoiding iterative solutions. The system utilizes the high parallelism of in-memory computing to simultaneously process a large number of nodes and springs, thereby greatly improving the speed of fabric simulation and having broad application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical fields of memristor in-memory computing and graphics hardware acceleration, and particularly relates to a cloth simulation acceleration system and method based on a memristor in-memory computing architecture. Background Art

[0002] Over the past few decades, with the rise of the video game, virtual reality, and animation industries, high-speed, real-time, and high-precision computer graphics computing technologies have rapidly developed, significantly increasing the demand for computing power. As one of the most common algorithms in the field of graphics, cloth simulation algorithms play an important role in multiple application areas, including fashion design, video games, animation, and virtual reality. However, with the rapid development of technologies such as game production, the main challenge facing cloth simulation algorithms has gradually shifted to real-time performance. Simulating the complex surface textures and realistic physical motion of cloth requires a significant amount of computing resources and time, which has become a bottleneck in technological development and limits the ability to meet the modern user's pursuit of real-time realism.

[0003] There are many difficulties in increasing the computational speed of current cloth simulation algorithms. First, large amounts of data need to be frequently transferred between the memory and the processor. However, due to the bandwidth limitations of the data bus, a large amount of time and energy is wasted in the data transmission process, seriously affecting computational efficiency and performance. Secondly, in cloth simulation, most calculations are highly data-dependent and need to be executed sequentially, which limits traditional parallel acceleration strategies. Furthermore, the physical and mathematical models involved in cloth simulation are complex, which not only increases the difficulty of calculations but also affects the computational speed. The calculation involves solving a system of equations, which not only requires a large amount of data processing and high data dependency, but also increases the computational complexity as the number of variables to be solved increases, making it very difficult for GPUs and CPUs to accelerate the solution.

[0004] In the past, researchers have proposed a variety of high-performance acceleration strategies based on GPUs and software optimization. For example, optimized data structures and memory access patterns, parallel computing using CUDA or OpenCL, and parallelized algorithms designed specifically for multi-core processors. However, due to the limitations of traditional hardware structures, these methods have limited improvements in computing speed and energy consumption. In-memory computing architectures allow data to be calculated in memory, fundamentally reducing the problems caused by large amounts of data transmission and handling. In addition, by using memristor arrays and analog computing methods, linear equations can be solved directly in one step, greatly reducing the computational complexity of solving the equations. Therefore, it is of great significance to study a fabric simulation acceleration system and method based on a memristor in-memory computing architecture. Summary of the Invention

[0005] In response to the problems existing in the above-mentioned prior art, the present invention proposes a fabric simulation acceleration system and method based on a memristor in-memory computing architecture. The memristor in-memory computing architecture is used to perform calculations in memory, avoiding frequent data reading. At the same time, the memristor array is used for simulation calculations to directly solve the linear equations, avoiding the iterative solution of the equations. The high parallel characteristics of in-memory computing are used to process a large number of nodes and springs at the same time, greatly improving the calculation speed of fabric simulation.

[0006] The technical solutions of the present invention are as follows:

[0007] A fabric simulation acceleration system based on a memristor in-memory computing architecture includes a random access memory (RAM), a content addressable memory (CAM), a universal computing unit (UCU), an equation solving unit (ESU), a digital-to-analog conversion module (ADC / DAC), a transimpedance amplifier (TIA), and a controller module (Controller). The random access memory is composed of a memristor array and is used to store spring information and temporary data. The content addressable memory is composed of a memristor array and is used to store a node position matrix X and a velocity matrix V. The universal computing unit is composed of a memristor array and is used to perform general computing tasks, including four arithmetic operations, vector dot multiplication, and cross multiplication. The equation solving unit includes a memristor array and an operational amplifier portion and is used to perform equation solving computing tasks. The analog computing method is used to calculate the solution of the equation in one step using the analog characteristics of the memristor array. The memristor array is used to store the mass matrix M, the force matrix F, and the Jacobian matrix K. The digital-to-analog conversion module is used to convert between analog signals and digital signals. The transimpedance amplifier is used to convert between current signals and voltage signals. The controller is used to control the operation process of the circuit.

[0008] The equation solving unit ESU, the universal computing unit UCU and the transimpedance amplifier TIA constitute a node computing unit point core, which is used in the implicit integral solution and collision detection stages of the cloth simulation algorithm with the number of nodes as the parallelism. During calculation, the data required for each node calculation is first written into a node computing unit point core. In the implicit integral solution stage, the calculated data is written into the equation solving unit ESU. In the collision detection stage, the calculated data is written into the universal computing unit UCU. Then, the calculations are performed in parallel. After the calculations are completed, they are converted by the TIA and written into the CAM.

[0009] The transimpedance amplifier (TIA) and multiple universal computing units (UCU) form a spring calculation unit (spring core), which is used in the force calculation phase and the applied inverse dynamics phase of the cloth simulation algorithm, where the number of springs is used as the parallelism. During calculation, the spring data corresponding to adjacent nodes is first written into a spring calculation unit (spring core), that is, the calculated data is written into the universal computing unit (UCU), and then the calculation is performed in parallel. After the calculation is completed, it is converted by the TIA and written into the ESU or CAM.

[0010] Furthermore, in the spring core, the number of universal computing units UCU in each spring core is 6.

[0011] Furthermore, the number of the general computing units is greater than the number of springs, the number of the equation solving units is greater than the number of nodes, and the number of springs is greater than the number of nodes.

[0012] Furthermore, the controller controls the calculation process of all modules: the data in the RAM can be used to index the data in the CAM, the indexed value in the CAM will be sent to the ESU or UCU for calculation, the calculation result in the UCU is written into the ESU or written back to the CAM after TIA conversion, and the calculation result of the ESU is written back to the CAM after TIA conversion.

[0013] Furthermore, the analog calculation method is used. The output of all modules in the circuit is in the form of current, which is converted into voltage by the transimpedance amplifier TIA and used as the write voltage of the lower module memristor. During the circuit calculation process, the calculation result will be input by a certain read voltage V read , the data is transferred from the memristor with a current I out The signal is read out in the form of a voltage signal, converted into a voltage signal by TIA, and rewritten into the memristor.

[0014] The present invention also provides a fabric simulation acceleration method based on a memristor in-memory computing architecture. The calculation process is divided into fabric image frames, and each frame image is calculated multiple times according to the step size. The calculation of each step size includes the following steps:

[0015] S1. Initialize the cloth. Based on the given cloth position and motion state, determine the initial position matrix X and velocity matrix V for all nodes. Initialize the spring matrix "spring" based on the cloth material information. Write the spring matrix "spring" to the random access memory (RAM) and the position matrix X and velocity matrix V to the content-addressable memory (CAM). The spring matrix "spring" includes the elastic coefficient of each spring, the original length of the spring, and the position information of the nodes at both ends of the spring.

[0016] S2. In the force calculation phase, the number of springs is used as the degree of parallelism. Each spring is assigned to a universal computing unit (UCU). The forces on all springs are calculated simultaneously. For a single spring, the position vector Δx between the two nodes of the spring is first obtained by indexing from the RAM and CAM. f and velocity vector Δv f The readout signal exists in the form of current. After being converted by the transimpedance amplifier TIA, it is sent to the universal calculation unit UCU for calculation to obtain the force matrix F and the Jacobian matrix K. The calculation result is output from the universal calculation unit UCU in the form of current. After the result is converted into voltage by the transimpedance amplifier TIA, the force matrix F and the Jacobian matrix K are sent to the equation solving unit ESU;

[0017] S3. In the implicit integral solution phase, the number of nodes is used as the parallelism. For each node, an equation solving unit (ESU) is assigned to solve the displacement and velocity changes of all nodes simultaneously. For a single node, the velocity vector v of the node is first obtained by indexing from the CAM. i , then divide the physical equations for each node, solve the physical equations of the corresponding node in the equation solving unit ESU, use the memristor array in the equation solving unit ESU to build an analog circuit, directly solve the solution of the linear equations, and calculate the position adjustment Δx required at this time i and speed adjustment Δv i , and finally adjust the position Δx i and speed adjustment Δv i Write back the position matrix X and velocity matrix V in CAM;

[0018] S4. In the collision detection phase, the number of nodes is used as the degree of parallelism. For each node, a universal computing unit (UCU) is assigned to calculate the collision of all nodes at the same time. For a single node, the position vector x of the node is first obtained from the CAM index. c , calculate the collision distance in the universal computing unit UCU, compare and determine whether a collision occurs, and if so, continue to calculate the position adjustment amount Δx required at this time in the universal computing unit UCU c and speed adjustment Δv c , and finally adjust the position Δx c and speed adjustment Δv c Write back the position matrix X and velocity matrix V in the CAM; for points where no collision occurs, the collision adjustment amount is 0;

[0019] S5. In the inverse dynamics application phase, the number of springs is used as the degree of parallelism. Each spring is assigned to a universal computing unit (UCU). The forces on all springs are calculated simultaneously. For a single spring, the position vector Δx between the two nodes of the spring is first calculated. a The current length l of the spring is obtained from the CAM index and sent to the universal computing unit (UCU) to calculate the current length l of the spring. It is compared with the original length l0 of the spring read from the RAM to determine whether deformation has occurred. If so, the speed adjustment Δv required at this time is calculated in the universal computing unit UCU. a , and finally adjust the speed Δv a Write back the velocity matrix V in CAM; if no deformation occurs, Δv a is 0;

[0020] Steps S2-S5 complete the calculation of one step, and calculate the changes of the position matrix X and velocity matrix V of all nodes within one step. Multiple steps constitute a frame. Repeat steps S2-S5 multiple times to obtain a frame image, render and draw the cloth image, and realize cloth simulation acceleration.

[0021] Furthermore, in step S2, the position vector Δx between the two nodes of the spring is obtained by using the RAM and CAM indexes. f and velocity vector Δv f The method is as follows:

[0022] First, index the node numbers of each spring from the RAM. For the two end nodes p1 and p2 obtained by the index, find the corresponding points in the CAM according to the serial number information. By searching, the serial numbers i1 and i2 of the points corresponding to the two end nodes p1 and p2 are obtained. The position vectors x1 and x2 corresponding to the i1 and i2 rows in the CAM are obtained by indexing. At the same time, the position vector Δx between the two end nodes p1 and p2 is calculated by the universal computing unit UCU. f =x1-x2; in the same way, we can get the velocity vector Δv of the two end nodes f =v1-v2.

[0023] Furthermore, the method of using a memristor array to build an analog circuit to solve linear equations in step S3 uses a memristor array to solve the problem using analog calculations, specifically as follows: when calculating the adjustment amount of the i-th node, it is necessary to construct a linear equation system based on the node force and the Jacobian matrix to solve the position and velocity. The linear equation system is in the form of Ax+b=0, where A is a coefficient matrix, x is an unknown number, and b is a constant term; the coefficient matrix A is obtained in the following way: the mass matrix M is a 3x3 diagonal matrix, the diagonal elements are the masses of the nodes, and the other elements are 0, which is written into the memristor array in advance and is inverted and connected to the i-th Jacobian matrix K through an operational amplifier with an amplification factor of β. i , Ki It is a 3x3 diagonal matrix, and its elements represent the partial derivatives of the three-dimensional force components in the x, y, and z directions respectively. The memristor array formed at this time can be equivalent to the coefficient matrix A i =M-βK i , β is the amplifier gain; the constant term b can be obtained by multiplying the fixed matrix M by the velocity vector v of the i-th node i The resulting current, plus V read The current obtained by the i-th row of the voltage reading force matrix F is equivalent to the constant term I bi =M·v i +F i ; M and K i The output current of each column is added and connected to the input of the operational amplifier. Using the amplifier virtual short principle and the node current equation, we can get A i V out +I bi =0, where the output voltage V outi Is the unknown number in the original equation, representing the position adjustment Δx i , according to the kinetic formula The speed adjustment Δv can be obtained i , adjust the position by Δx i and speed adjustment Δv i Write back the position matrix X and velocity matrix V in the CAM respectively.

[0024] Furthermore, in step S5, the required speed change adjustment Δv is calculated. a The method is as follows:

[0025] First, get the current spring's two end nodes p1 and p2 from RAM, then get the corresponding position matrix from CAM, and calculate the position vector Δx between the two points through the universal computing unit UCU. a , and then the spring length l=||Δx is calculated by the universal calculation unit UCU a ||; If l is greater than the original length of the spring l0, you need to calculate the stretching distance and the speed adjustment: If node p1 is a fixed point or a boundary point, the adjustment amount is added to the velocity vector of another node p2. If node p2 is a fixed point or a boundary point, the adjustment amount is subtracted from the velocity vector of node p1. If neither node is a fixed point or a boundary point, the adjustment amount Δv is subtracted from the velocity vector of node p1. a , add the adjustment Δv to the velocity vector of node p2 a .

[0026] The technical effects of the present invention are as follows:

[0027] A fabric simulation acceleration method and system based on a memristor in-memory computing architecture. Based on a memristor analog computing circuit, this method directly solves a system of linear equations through analog computing, reducing computational complexity and increasing computational speed. Furthermore, it leverages the high parallelism of in-memory computing to simultaneously process a large number of nodes and springs, significantly increasing fabric simulation speed. The system is applicable to all physics-based fabric simulation problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 Schematic diagram of a fabric simulation acceleration system based on a memristor in-memory computing architecture according to the present invention;

[0029] Figure 2 This is an architecture diagram of the fabric simulation acceleration system based on the memristor in-memory computing architecture of the present invention;

[0030] Figure 3 This is a flow chart of the fabric simulation acceleration method based on the memristor in-memory computing architecture of the present invention;

[0031] Figure 4 This is a circuit diagram of the equation solving unit of the fabric simulation acceleration system based on the memristor in-memory computing architecture of the present invention. DETAILED DESCRIPTION

[0032] The present invention will be further clearly and completely described below through specific embodiments in conjunction with the accompanying drawings.

[0033] Traditional physics-based cloth simulation algorithms consist of four stages: force calculation, implicit integral solution, collision detection, and application of inverse dynamics, each of which involves different calculations. The mass-spring model is used to simulate cloth, dividing the cloth into a node grid connected by springs. First, the scene or user specifies the specific cloth position relationship and motion state, determines the initial position matrix X and velocity matrix V for all nodes, and initializes the spring matrix Spring based on the cloth material information. In the force solution stage, the force F acting on each spring node needs to be solved. i and the partial derivative of force with respect to position K i , the force F acting on all nodes i Form the force matrix F, the partial derivative K of all node forces with respect to position i The Jacobian matrix K is formed, and the force condition of the node can be solved according to Hooke's law, so that the force matrix F and Jacobian matrix K can be solved; in the implicit integral solution stage, according to the force matrix F and Jacobian matrix K solved previously, as well as the velocity V of each node i, we can obtain a linear equation group after implicit integral linearization. By solving the equation group, we can obtain the position adjustment Δx and velocity adjustment Δv caused by the action of the force. In the collision detection stage, the distance between the node and the colliding object is calculated through the position of each node. If the distance is less than a certain value (given by the system), it is judged that a collision has occurred. In the event of a collision, the position and velocity of the node need to be updated to simulate the collision process. In the application of inverse dynamics, according to the above calculation process, the node position will be updated again. According to the updated node position of each spring, the node velocity at both ends of the spring is calculated, and the node velocity is updated to simulate the spring stretching.

[0034] The present invention provides a fabric simulation acceleration system based on a memristor in-memory computing architecture. The system diagram is shown in FIG. Figure 1 As shown, it includes a random access memory (RAM), a content addressable memory (CAM), a universal computing unit (UCU), an equation solving unit (ESU), a digital-to-analog conversion module (ADC, DAC), a transimpedance amplifier (TIA) and a controller module; the random access memory (RAM) is composed of a memristor array and is used to store spring information and temporary data; the content addressable memory (CAM) is composed of a memristor array and is used to store the node position matrix X and the velocity matrix V; the universal computing unit (UCU) is composed of a memristor array and is used to perform general computing tasks. The system includes four arithmetic operations, vector dot multiplication, and cross multiplication. The equation solving unit (ESU), comprising a memristor array and an operational amplifier, is used to perform the equation solving calculation task. It uses an analog computing method and the analog characteristics of the memristor array to calculate the solution of the equation system in one step. The memristor array is used to store the mass matrix M, the force matrix F, and the Jacobian matrix K. The digital-to-analog conversion module (ADC, DAC) is used to convert between analog and digital signals. The transimpedance amplifier (TIA) is used to convert between current and voltage signals. The controller is used to control the circuit's operation process. In this system, the number of universal computing units (UCU) is greater than the number of springs, the number of equation solving units (ESU) is greater than the number of nodes, and the number of springs is always greater than the number of nodes.

[0035] The controller controls the calculation process of all modules: the data in the RAM can be used to index the data in the CAM, the indexed value in the CAM will be sent to the ESU or UCU for calculation, the calculation result in the UCU will be written into the ESU or written back to the CAM after TIA conversion, and the calculation result of the ESU will be written back to the CAM after TIA conversion.

[0036] The fabric simulation acceleration system adopts the analog calculation method. The output of all modules in the circuit is in the form of current, which is converted into voltage by the transimpedance amplifier TIA and used as the write voltage of the lower module memristor. During the circuit calculation process, the calculation result will be input by a certain read voltage V read (usually less than 1V), the data is transferred from the memristor with a current I out The signal is read out in the form of a voltage signal, converted into a voltage signal by TIA, and rewritten into the memristor.

[0037] The schematic diagram of the fabric simulation acceleration system architecture based on the memristor in-memory computing architecture of the present invention is shown in the figure: Figure 2 As shown in the figure, the computing unit is divided into two parts. One part is the node computing unit point core, which is used for implicit integral solution and collision detection stage, including equation solving unit (ESU), universal computing unit (UCU), transimpedance amplifier (TIA); the other part is the spring computing unit spring core, which is used for force calculation and application of inverse dynamics stage, including multiple universal computing units (UCU) and transimpedance amplifier (TIA). When performing calculations with the number of nodes as the parallelism, that is, the implicit integral solution and collision detection stages, the data required for each node calculation will first be written into a node calculation unit point core. In the implicit integral solution, the calculation data will be written into the equation solution unit (ESU). In the collision detection stage, the calculation data will be written into the universal calculation unit (UCU), and then the calculations will be performed in parallel. After the calculation is completed, it will be written into the CAM through TIA conversion; when performing calculations with the number of springs as the parallelism, that is, the force calculation and application of inverse dynamics stages, the spring data corresponding to the adjacent nodes will first be written into a spring calculation unit spring core. Since a maximum of 6 springs are generated between adjacent nodes, the number of universal calculation units (UCU) in each spring calculation unit spring core is 6, and then the calculations will be performed in parallel. After the calculation is completed, it will be written into the ESU or CAM through TIA conversion.

[0038] The traditional physics-based cloth simulation algorithm is implemented in the cloth simulation acceleration system based on the memristor in-memory computing architecture to realize cloth simulation acceleration. The traditional physics-based cloth simulation algorithm includes four stages: force calculation, implicit integral solution, collision detection and application of inverse dynamics, each stage including its own different calculations; the mass-spring model is used to simulate the cloth, dividing the cloth into a node grid, and the nodes are connected by springs; the implicit integral solution is converted into a linear system of equations by linearization; the overall flow chart of the cloth simulation acceleration method based on the memristor in-memory computing architecture of the present invention is shown as follows Figure 3 As shown, the calculation process is divided into cloth image frames, and each frame image is calculated multiple times according to the step size. The calculation of each step size includes the following steps:

[0039] S1. Initialize the process. Based on the given cloth position and motion state, determine the initial position matrix X and velocity matrix V for all nodes. Initialize the spring matrix spring based on the cloth material information. Write the spring matrix spring to the random access memory (RAM), and write the position matrix X and velocity matrix V to the content addressable memory (CAM). The spring matrix spring includes the elastic coefficient of each spring, the original length of the spring, and the position information of the nodes at both ends of the spring.

[0040] S2. In the force calculation phase, the number of springs is used as the degree of parallelism. Each spring is assigned to a universal computing unit (UCU). The forces on all springs are calculated simultaneously. For a single spring, the position vector Δx between the two nodes of the spring is first obtained from the RAM and CAM indexes. f and velocity vector Δv f The readout signal exists in the form of current. After being converted by the transimpedance amplifier TIA, it is sent to the universal computing unit (UCU) for calculation to obtain the force matrix F and the Jacobian matrix K. The calculation result is output from the universal computing unit (UCU) in the form of current. After the result is converted into voltage by the transimpedance amplifier TIA, the force matrix F and the Jacobian matrix K are sent to the equation solving unit (ESU);

[0041] S3. In the implicit integral solution phase, the number of nodes is used as the degree of parallelism. For each node, an equation solving unit (ESU) is assigned to solve the displacement and velocity changes of all nodes simultaneously. For a single node, the velocity vector v of the node is first obtained by indexing from the CAM. i , then divide the physical equations for each node, solve the physical equations of the corresponding node in the equation solving unit (ESU), use the memristor array in the equation solving unit (ESU) to build an analog circuit, directly solve the solution of the linear equations, and calculate the position adjustment Δx required at this time i and speed adjustment Δv i , and finally adjust the position Δx i and speed adjustment Δv i Write back the position matrix X and velocity matrix V in CAM;

[0042] S4. In the collision detection phase, the number of nodes is used as the degree of parallelism. For each node, a universal computing unit (UCU) is assigned to calculate the collision of all nodes at the same time. For a single node, the position vector x of the node is first obtained from the CAM index. c, calculate the collision distance in the universal computing unit (UCU), compare and determine whether a collision occurs, and if so, continue to calculate the required position adjustment Δx in the universal computing unit (UCU) c and speed adjustment Δv c , and finally adjust the position Δx c and speed adjustment Δv c Write back the position matrix X and velocity matrix V in the CAM; for points where no collision occurs, the collision adjustment amount is 0.

[0043] S5. In the inverse dynamics application phase, the number of springs is used as the degree of parallelism. Each spring is assigned to a universal computing unit (UCU). The forces on all springs are calculated simultaneously. For a single spring, the position vector Δx between the two nodes of the spring is first calculated. a The index is obtained from the CAM and sent to the universal computing unit (UCU) to calculate the current length l of the spring. It is compared with the original length l0 of the spring read from the RAM to determine whether deformation has occurred. If so, the speed adjustment Δv required at this time is calculated in the universal computing unit (UCU) a , and finally adjust the speed Δv a Write back the velocity matrix V in CAM; if no deformation occurs, Δv a is 0.

[0044] Steps S2-S5 complete the calculation of one step, and calculate the changes of the position matrix X and velocity matrix V of all nodes within one step. Multiple steps constitute a frame. Repeat steps S2-S5 multiple times to obtain a frame image, render and draw the cloth image, and realize cloth simulation acceleration.

[0045] In step S2, the position vector Δx between the two nodes of the spring is obtained by using the RAM and CAM indexes. f and velocity vector Δv f The method is as follows:

[0046] First, index the node numbers of each spring from the RAM. For the two end nodes p1 and p2 obtained by the index, find the corresponding points in the CAM according to the sequence information. By searching, the sequence numbers i1 and i2 of the points corresponding to the two end nodes p1 and p2 are obtained. The position vectors x1 and x2 corresponding to the i1 and i2 rows in the CAM are obtained by indexing. At the same time, the position vector Δx between the two end nodes p1 and p2 is calculated by the universal computing unit (UCU). f =x1-x2; in the same way, we can get the velocity vector Δv of the two end nodes f =v1-v2.

[0047] The method of using a memristor array to build an analog circuit to solve the linear equation in step S3 is different from the traditional method based on gradient descent iteration. Here, a memristor array is used to solve the linear equation using analog calculation. The circuit of the analog calculation equation solving unit ESU is as follows: Figure 4 The specific simulation calculation method is as follows: When calculating the adjustment amount of the i-th node, it is necessary to construct a linear equation system based on the node force and the Jacobian matrix to solve the position and velocity. The linear equation system is in the form of Ax + b = 0, where A is the coefficient matrix, x is the unknown number, and b is the constant term. The coefficient matrix A can be obtained as follows: the mass matrix M is a 3x3 diagonal matrix with the diagonal elements representing the mass of the node and the other elements being 0. It is pre-written into the memristor array and connected inversely to the i-th Jacobian matrix K through an operational amplifier with a gain factor of β. i , K i It is a 3x3 diagonal matrix, and its elements represent the partial derivatives of the three-dimensional force components in the x, y, and z directions respectively. The memristor array formed at this time can be equivalent to the coefficient matrix A i =M-βK i , β is the amplifier gain; the constant term b can be obtained by multiplying the fixed matrix M by the velocity vector v of the i-th node i The resulting current, plus V read The current obtained from the i-th row of the voltage reading force matrix F can be equivalent to the constant term I bi =M·v i +F i . i The output current of each column is added and connected to the input of the operational amplifier. Using the amplifier virtual short principle and the node current equation, A can be obtained. i V out +I bi =0, where the output voltage V outi Is the unknown number in the original equation, representing the position adjustment amount Δx i , according to the kinetic formula The speed adjustment Δv can be obtained i , adjust the position by Δx i and speed adjustment Δv i Write back the position matrix X and velocity matrix V in the CAM respectively. At this point, the solution of the linear equations can be directly solved in one step through simulation calculation.

[0048] The step S4 of performing collision detection and collision processing on the nodes includes the following specific steps:

[0049] 1) First, the position vector x obtained by index c Transform the coordinates to the coordinate system of the ellipse center, that is, the x obtained by indexingc Multiply the vector by the elliptic matrix E to get x0;

[0050] 2) Calculate the position difference Δx = x0 - c between the node and the ellipse center c;

[0051] 3) Then calculate the distance between the node and the collision center by distance = ||Δx||, and determine whether a collision occurs if distance < 1;

[0052] 4) If a collision occurs, use the inverse E of the elliptic matrix -1 Solve for the position adjustment Δx c and speed adjustment Δv c ;

[0053] 5) Adjust the corresponding position by Δx c and speed adjustment Δv c Write back the position matrix X and velocity matrix V in the CAM.

[0054] In step S5, the required speed change adjustment Δv is calculated a The method is as follows:

[0055] First, get the current spring's two end nodes p1 and p2 from RAM, then get the corresponding position matrix from CAM, and calculate the position vector Δx between the two points through the universal computing unit (UCU) a , and then the spring length l=||Δx is calculated by the universal calculation unit (UCU) a If l is greater than the original length of the spring, l0, then the stretching distance needs to be calculated and the speed adjustment amount needs to be calculated: If node p1 is a fixed point or a boundary point, the adjustment amount is added to the velocity vector of another node p2. If node p2 is a fixed point or a boundary point, the adjustment amount is subtracted from the velocity vector of node p1. If neither node is a fixed point or a boundary point, the adjustment amount Δv is subtracted from the velocity vector of node p1. a , add the adjustment Δv to the velocity vector of node p2 a .

[0056] Table 1 List of variables and their meanings used in the present invention

[0057]

[0058] Finally, it should be noted that the purpose of disclosing the embodiments is to facilitate a further understanding of the present invention. However, those skilled in the art will appreciate that various substitutions and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the contents disclosed in the embodiments, and the scope of protection claimed by the present invention shall be determined by the scope defined in the claims.

Claims

1. A fabric simulation acceleration system based on a memristor in-memory computing architecture, characterized in that: The system comprises a random access memory (RAM), a content addressable memory (CAM), a universal computing unit (UCU), an equation solving unit (ESU), a digital-to-analog conversion module (ADC / DAC), a transimpedance amplifier (TIA), and a controller module (Controller); the random access memory is composed of a memristor array and is used to store spring information and temporary data; the content addressable memory is composed of a memristor array and is used to store a node position matrix X and a velocity matrix V; the universal computing unit is composed of a memristor array and is used to perform general computing tasks, including four arithmetic operations, vector dot multiplication, and cross multiplication; the equation solving unit comprises a memristor array and an operational amplifier part, and is used to perform equation solving computing tasks, adopts an analog computing method, and uses the analog characteristics of the memristor array to calculate the solution of the equation in one step, and the memristor array is used to store the mass matrix M, the force matrix F, and the Jacobian matrix K; the digital-to-analog conversion module is used to convert between analog signals and digital signals; the transimpedance amplifier is used to convert between current signals and voltage signals; and the controller is used to control the computing process of the circuit. The equation solving unit ESU, the universal computing unit UCU and the transimpedance amplifier TIA form a node computing unit pointcore, which is used in the implicit integral solution and collision detection stages of the cloth simulation algorithm with the number of nodes as the parallelism. During calculation, the data required for each node calculation is first written into a node computing unit pointcore. In the implicit integral solution stage, the calculated data is written into the equation solving unit ESU. In the collision detection stage, the calculated data is written into the universal computing unit UCU. Then, the calculations are performed in parallel. After the calculations are completed, they are converted by the TIA and written into the CAM. The transimpedance amplifier (TIA) and multiple universal computing units (UCU) form a spring calculation unit (spring core), which is used in the force calculation phase and the applied inverse dynamics phase of the cloth simulation algorithm, where the number of springs is used as the parallelism. During calculation, the spring data corresponding to adjacent nodes is first written into a spring calculation unit (spring core), that is, the calculated data is written into the universal computing unit (UCU), and then the calculation is performed in parallel. After the calculation is completed, it is converted by the TIA and written into the ESU or CAM.

2. The fabric simulation acceleration system based on the memristor in-memory computing architecture according to claim 1, characterized in that: In the spring core, each spring core has six universal computing units (UCUs).

3. The fabric simulation acceleration system based on the memristor in-memory computing architecture according to claim 1, characterized in that: The number of the general computing units is greater than the number of springs, the number of the equation solving units is greater than the number of nodes, and the number of springs is greater than the number of nodes.

4. The fabric simulation acceleration system based on the memristor in-memory computing architecture according to claim 1, characterized in that: The controller controls the calculation process of all modules: the data in the RAM can be used to index the data in the CAM, the indexed value in the CAM will be sent to the ESU or UCU for calculation, the calculation result in the UCU is written into the ESU or written back to the CAM after TIA conversion, and the calculation result of the ESU is written back to the CAM after TIA conversion.

5. The fabric simulation acceleration system based on memristor in-memory computing architecture according to claim 1, characterized in that: Using the analog calculation method, the output of all modules in the circuit is in the form of current, which is converted into voltage by the transimpedance amplifier TIA and used as the write voltage of the lower module memristor. During the circuit calculation process, the calculation result will be calculated by inputting a certain read voltage V read , the data is transferred from the memristor with a current I out The signal is read out in the form of a voltage signal, converted into a voltage signal by TIA, and rewritten into the memristor.

6. A fabric simulation acceleration method based on a memristor in-memory computing architecture, wherein the calculation process is divided into fabric image frames, and each frame image is calculated multiple times according to the step size, characterized in that: The calculation of each step size includes the following steps: S1. Initialize the cloth. Based on the given cloth position and motion state, determine the initial position matrix X and velocity matrix V for all nodes. Initialize the spring matrix "spring" based on the cloth material information. Write the spring matrix "spring" to the random access memory (RAM) and the position matrix X and velocity matrix V to the content-addressable memory (CAM). The spring matrix "spring" includes the elastic coefficient of each spring, the original length of the spring, and the position information of the nodes at both ends of the spring. S2. In the force calculation phase, the number of springs is used as the degree of parallelism. Each spring is assigned to a universal computing unit (UCU). The forces on all springs are calculated simultaneously. For a single spring, the position vector Δx between the two nodes of the spring is first obtained by indexing from the RAM and CAM. f and velocity vector Δv f The readout signal exists in the form of current. After being converted by the transimpedance amplifier TIA, it is sent to the universal calculation unit UCU for calculation to obtain the force matrix F and the Jacobian matrix K. The calculation result is output from the universal calculation unit UCU in the form of current. After the result is converted into voltage by the transimpedance amplifier TIA, the force matrix F and the Jacobian matrix K are sent to the equation solving unit ESU; S3. In the implicit integral solution phase, the number of nodes is used as the parallelism. For each node, an equation solving unit (ESU) is assigned to solve the displacement and velocity changes of all nodes simultaneously. For a single node, the velocity vector v of the node is first obtained by indexing from the CAM. i , then divide the physical equations for each node, solve the physical equations of the corresponding node in the equation solving unit ESU, use the memristor array in the equation solving unit ESU to build an analog circuit, directly solve the solution of the linear equations, and calculate the position adjustment Δx required at this time i and speed adjustment Δv i , and finally adjust the position Δx i and speed adjustment Δv i Write back the position matrix X and velocity matrix V in CAM; S4. In the collision detection phase, the number of nodes is used as the degree of parallelism. For each node, a universal computing unit (UCU) is assigned to calculate the collision of all nodes at the same time. For a single node, the position vector x of the node is first obtained from the CAM index. c , calculate the collision distance in the universal computing unit UCU, compare and determine whether a collision occurs, and if so, continue to calculate the position adjustment amount Δx required at this time in the universal computing unit UCU c and speed adjustment Δv c , and finally adjust the position Δx c and speed adjustment Δv c Write back the position matrix X and velocity matrix V in the CAM; for points where no collision occurs, the collision adjustment amount is 0; S5. In the inverse dynamics application phase, the number of springs is used as the degree of parallelism. Each spring is assigned to a universal computing unit (UCU). The forces on all springs are calculated simultaneously. For a single spring, the position vector Δx between the two nodes of the spring is first calculated. a The current length l of the spring is obtained from the CAM index and sent to the universal computing unit (UCU) to calculate the current length l of the spring. It is compared with the original length l0 of the spring read from the RAM to determine whether deformation has occurred. If so, the speed adjustment Δv required at this time is calculated in the universal computing unit UCU. a , and finally adjust the speed Δv a Write back the velocity matrix V in CAM; if no deformation occurs, Δv a is 0; Steps S2-S5 complete the calculation of one step, and calculate the changes of the position matrix X and velocity matrix V of all nodes within one step. Multiple steps constitute a frame. Repeat steps S2-S5 multiple times to obtain a frame image, render and draw the cloth image, and realize cloth simulation acceleration.

7. The method for accelerating fabric simulation based on a memristor in-memory computing architecture according to claim 6, wherein: In step S2, the position vector Δx between the two nodes of the spring is obtained by using the RAM and CAM indexes. f and velocity vector Δv f The method is as follows: First, index the node numbers of each spring from the RAM. For the two end nodes p1 and p2 obtained by the index, find the corresponding points in the CAM according to the serial number information. By searching, the serial numbers i1 and i2 of the points corresponding to the two end nodes p1 and p2 are obtained. The position vectors x1 and x2 corresponding to the i1 and i2 rows in the CAM are obtained by indexing. At the same time, the position vector Δx between the two end nodes p1 and p2 is calculated by the universal computing unit UCU. f =x1-x2; in the same way, we can get the velocity vector Δv of the two end nodes f =v1-v2.

8. The method for accelerating fabric simulation based on a memristor in-memory computing architecture according to claim 6, wherein: The method of using a memristor array to build an analog circuit to solve linear equations in step S3 adopts a memristor array to solve the problem by analog calculation, specifically as follows: when calculating the adjustment amount of the i-th node, it is necessary to construct a linear equation system based on the node force and the Jacobian matrix to solve the position and velocity. The linear equation system is in the form of Ax+b=0, where A is a coefficient matrix, x is an unknown number, and b is a constant term; the coefficient matrix A is obtained in the following way: the mass matrix M is a 3x3 diagonal matrix, the diagonal elements are the masses of the nodes, and the other elements are 0, which is written into the memristor array in advance and is inverted and connected to the i-th Jacobian matrix K through an operational amplifier with an amplification factor of β. i , K i It is a 3x3 diagonal matrix, and its elements represent the partial derivatives of the three-dimensional force components in the x, y, and z directions respectively. The memristor array formed at this time can be equivalent to the coefficient matrix A i =M-βK i , β is the amplifier gain; the constant term b can be obtained by multiplying the fixed matrix M by the velocity vector v of the i-th node i The resulting current, plus V read The current obtained by the i-th row of the voltage reading force matrix F is equivalent to the constant term I bi =M·v i +F i ; M and K i The output current of each column is added and connected to the input of the operational amplifier. Using the amplifier virtual short principle and the node current equation, we can get A i V out +I bi =0, where the output voltage V outi Is the unknown number in the original equation, representing the position adjustment Δx i , according to the kinetic formula The speed adjustment Δv can be obtained i , adjust the position by Δx i and speed adjustment Δv i Write back the position matrix X and velocity matrix V in the CAM respectively.

9. The method for accelerating fabric simulation based on a memristor in-memory computing architecture according to claim 6, wherein: In step S5, the required speed change adjustment Δv is calculated a The method is as follows: First, get the current spring's two end nodes p1 and p2 from RAM, then get the corresponding position matrix from CAM, and calculate the position vector Δx between the two points through the universal computing unit UCU. a , and then the spring length l=||Δx is calculated by the universal calculation unit UCU a ||; If l is greater than the original length of the spring l0, you need to calculate the stretching distance and the speed adjustment: If node p1 is a fixed point or a boundary point, the adjustment amount is added to the velocity vector of another node p2. If node p2 is a fixed point or a boundary point, the adjustment amount is subtracted from the velocity vector of node p1. If neither node is a fixed point or a boundary point, the adjustment amount Δv is subtracted from the velocity vector of node p1. a , add the adjustment Δv to the velocity vector of node p2 a .

Citation Information

Patent Citations

  • Equation set solver based on memristor linear neural network and operation method of equation set solver

    CN111460365A

  • General programmable multivariate matrix equation memristor circuit implementation method and circuit

    CN118227933A