210 likes | 421 Views
SystemC -AMS(CUDA). Ruru 2012 8/14. Outline. Introduction Modeling Formalisms ELN(Electrical Linear Networks ) Solve Ordinary Differential Equation Solve Eln -Cluster Workflow SystemC Kernel Solver Performance. Introduction. Positioning SystemC AMS Extensions. Introduction.
E N D
SystemC-AMS(CUDA) Ruru2012 8/14
Outline • Introduction • Modeling Formalisms • ELN(Electrical Linear Networks) • Solve Ordinary Differential Equation • Solve Eln-Cluster Workflow • SystemC Kernel Solver • Performance
Introduction • Positioning SystemC AMS Extensions
Introduction • Modeling formalisms and use cases
Electrical Linear Networks • Setup of the equation system Kirchhoff’s current law(KCL)
Electrical Linear Networks • ELN elaboration and simulation phases
Problem : Thermo Model • Thermo Model : • RLC model • Solve ELN equation • Purpose • Using CUDA to Speedup
Solve Ordinary Differential Equation • Euler’s Method • Backward Euler Method
SystemC Kernel Solver • Eln-cluster Initialization • Module(r, l, c …) : modules • Node(sca_terminal, sca_node …) : equations • Sparse Matrix • Spcode
Solve Eln-Cluster Workflow Solve Differential Equation ana_solv … DATA (Sdata, R, X) Cluster? Next Cluster Timestamp? Next Timestamp
Modify ana_solv to GPU • Every eln-cluster • Every time stamp • Workflow • Copy matrix data to GPU • Execute ana_solv by GPU • Copy result data to host ana_solv DATA (Sdata, R, X) GPU ana_solv DATA (Sdata, R, X)
Solve Eln-Cluster Workflow Solve Differential Equation ana_solv … DATA (Sdata, R, X) GPU ana_solv Cluster? Next Cluster DATA (Sdata, R, X) Timestamp? Next Timestamp
Performance • The result is correct • No speed up • 200 module of one cluster : 75 ms (CPU) • 200 module of one cluster : 165 ms(GPU)
Euler’s Method • Question : y’ = f(x, y) , x0 < x < b , y(x0) = y0 , h is constant • xi = x0 + i*h ; (i = 0 1 2 ….) • yi = y(xi) ~ Yi (Yi is result) • yn+1 = yn + h*f(yn, xn) • Example : y’ = y , y(0) = 1 , h = 0.5 • Solve : • y1 = y(0) + y’(0)*h = 1 + 1*0.5 = 1.5 • y2 = … • Yi = exp(x) => Y(0.5) = 1.649… • 1.5 vs1.649
Backward Euler Method • Question : y’ = f(x, y) , x0 < x < b , y(x0) = y0 , h is constant • xi = x0 + i*h ; (i = 0 1 2 ….) • yi = y(xi) ~ Yi (Yi is result) • yn+1 = yn + h*f(yn, xn) • Example : y’ = -y^3 , y(0) = 1 , h = 0.5 • Solve : • y1 = y(0) + f(x1, y1)*h = 1 - 0.5*y1^3 • First => y1 = y(0) + f(x0, y0)*h = 1-0.5*y0^3 = 0.5 • Then recursive… • y1 = 0.9375 => 0.588 => 0.898 … => 0.7709