1 / 20

Study of Simulink ™ Discrete System MOC with Metropolis

Study of Simulink ™ Discrete System MOC with Metropolis. Haiyang Zheng hyzheng@eecs.berkeley.edu Mentors: Luciano Lavagno luciano@cadence.com Felice Balarin  felice@cadence.com. Outline. Motivation and Introduction Simulink Discrete System MOC MOC Implementation in Metropolis

kohana
Download Presentation

Study of Simulink ™ Discrete System MOC with Metropolis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Study of Simulink™ Discrete System MOC with Metropolis Haiyang Zheng hyzheng@eecs.berkeley.edu Mentors: Luciano Lavagno luciano@cadence.com Felice Balarin  felice@cadence.com

  2. Outline • Motivation and Introduction • Simulink Discrete System MOC • MOC Implementation in Metropolis • A tool for automatic transformation of Simulink models into Metropolis models • Simulation Demos • Acknowledgement and Conclusion

  3. Motivation • Simulink MOC is a heterogeneous one. A non-trivial model contains both discrete and continuous models. • A complex mixture model is usually hard to design, understand, and maintain. • A better way is to use some simpler, better defined MOCs to model different parts of the complex system.

  4. Discrete time points x = 4, y = x - 2 t0 t1 t2 t3 t dy / dt = x + 1 Continuous time interval Introduction • Discrete time points • Continuous time intervals • We choose purely discrete (sampled data) system as the study object.

  5. Outline • Motivation and Introduction • Simulink Discrete System MOC • MOC Implementation in Metropolis • A tool for automatic transformation of Simulink models into Metropolis models • Simulation Demos • Acknowledgement and Conclusion

  6. T = 0.5 T = 0.25 T = 0.75 Discrete System in Simulink™ B A C • Each block in the block diagram has a sample time, the rate at which it executes during simulation. • Multi-rate discrete systems contain blocks sampled at different rates. • Simulator takes the simulation step as the fundamental sample time, the greatest common divisor of the system’s actual sample times.

  7. Outline • Motivation and Introduction • Simulink Discrete System MOC • MOC Implementation in Metropolis • A tool for automatic transformation of Simulink models into Metropolis models • Simulation Demos • Acknowledgement and Conclusion

  8. Metropolis meta-model • Netlist: design of model (aggregation of objects and ports) • Objects • Process: thread doing computation • Medium: • Media for communication between processes • State Media for communication between process and scheduler • Scheduler: defines policies to satisfy constraints • Port Interface • provides functions reference of other objects • Constraint

  9. Scheduler State Medium T = 0.5, State T = 1.0, State Process A Process B Read, Write Channel (Media) Discrete MOC in Metropolis I • Processes communicate through channels, the medium. • Each process has a period parameter, which is stored in the associated state medium.

  10. Scheduler P = T/T0 = 1 P = T/T0 = 2 A A T = 0.5 T = 1.0 T0 = 0.5 A A B B B Discrete MOC in Metropolis II • The scheduler calculates the schedule based on the sampled rates and invokes different processes periodically. • The scheduler forces the finish of execution of processes to ensure the data precedence. • The data dependency is not analyzed in the scheduler but in the model design phase.

  11. Outline • Motivation and Introduction • Simulink Discrete System MOC • MOC Implementation in Metropolis • A tool for automatic transformation of Simulink models into Metropolis models • Simulation Demos • Acknowledgement and Conclusion

  12. T = 1.0 2 1 4 3 T = 1.0 T = 1.0 T = 0.5 An Example Model

  13. Metropolis MMM Netlist public netlist simple { public simple (String name) { dtScheduler dtscheduler = new dtScheduler("dtscheduler", 4); addcomponent (dtscheduler, this); RampProcess DiscreteRamp = new RampProcess("DiscreteRamp", 0, 2); addcomponent(DiscreteRamp,this,"DiscreteRamp"); dtStateMedium s0 = new dtStateMedium("StateMedium0", 0.25); addcomponent (s0, this); connect (DiscreteRamp,smport,s0); connect (dtscheduler, StateMedium[0], s0); connect (dtscheduler, processPeriod[0], s0); …… dtchannel c0 = new dtchannel("c0"); addcomponent(c0,this,"channel0"); connect(DiscreteSubtract,outports[0],c0); connect(Scope,inports[0],c0); …… } }

  14. T = 1.0 2 1 4 3 T = 1.0 T = 1.0 T = 0.5 Comparison An automatic transformation from the block diagram representation to the text representation is necessary.

  15. Transformation from Simlink Models into XML representations using MatlabUDM, a tool from Vanderbilt University. Transformation from XML representations into Metropolis MMM netlists with XSLT based tool. Two contributions: It bridges the tools of Simulink and Metropolis with XML. It sorts the blocks based on data dependency analysis. A Tool for Transformation from Simulink models into Metropolis models

  16. A C B D OOOO OOOO OOOO T = 1.0 2 C D A C B 1 4 3 YOYO OOYO OOYO D B A YYYO YYYY (#) YYYO T = 1.0 T = 1.0 T = 0.5 Design of the Tool Data Dependency Analysis Given order of blocks as BCAD. The sorted block order is ABCD. • Conditions for processes to be ready to execute • There is no input. • All inputs are available. • Algorithm: • Construct a status array with length as the number of processes and initiate it with O indicating the process not scheduled. • Iterate the processes with given order, mark the ready process as Y, and schedule it. Repeat until all processes are marked and scheduled.

  17. Outline • Motivation and Introduction • Simulink Discrete System MOC • MOC Implementation in Metropolis • A tool for automatic transformation of Simulink models into Metropolis models • Simulation Demos • Acknowledgement and Conclusion

  18. Demos (Results) • A Simulink Model • Simulation result • A Metropolis Model • Simulation with code generated from SystemC Result of Ramp is: 1 Result of Ramp is: 2 Result of Gain is: 4 Result of Subtract is: 2 Outputis: 2 Result of Ramp is: 3 Result of Ramp is: 4 Result of Gain is: 8 Result of Subtract is: 4 Outputis: 4 Result of Ramp is: 5 Result of Ramp is: 6 Result of Gain is: 12 Result of Subtract is: 6 Outputis: 6

  19. Outline • Motivation and Introduction • Simulink Discrete System MOC • MOC Implementation in Metropolis • A tool for automatic transformation of Simulink models into Metropolis models • Simulation Demos • Acknowledgement and Conclusion

  20. Acknowledgement & Conclusion • Thanks to: • Advice from Luciano Lavagno and Felice Balarin. • Guang Yang’s help on the C-code generation of Metropolis models with SystemC. • ISIS of Vanderbilt University providing the MatlabUDM tool. • A Discrete (Sampled Data) MOC is implemented in Metropolis. • A transformation tool from Simulink XML models to Metropolis MMM netlists is implemented.

More Related