020L: Superior SH2A Design Process using Model Based Design (MBD), Virtualization and Hardware-in- Loop (HIL) Systems Lab Renesas Electronics America Inc. Mark Ramseyer Staff Application Engineer 13 October 2010 Rev. 1.3
Mr. Mark Ramseyer 2 Powertrain Applications Engineer Model Based Development (MBD) Virtualization Co-simulation HIL simulation 20 Years Embedded Microcontroller Development Microcontroller specification IC design and verification IC simulation and timing Controller system design Software and firmware development Compilers and software tools Calibration and data acquisition tools Ford Motor Co., Ford Microelectronics, Visteon, General Motors BS in Computer & Electrical Engineering from
Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * ASIC, ASSP & Memory Advanced and proven technologies Solutions for Innovation Analog and Power Devices #1 Market share in low-voltage MOSFET** * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 ** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis). 3
Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * ASIC, ASSP & Memory Advanced and proven technologies Solutions for Innovation Analog and Power Devices #1 Market share in low-voltage MOSFET** * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 ** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis). 4
Microcontroller and Microprocessor Line-up Superscalar, MMU, Multimedia Up to 1200 DMIPS, 45, 65 & 90nm process Video and audio processing on Linux Server, Industrial & Automotive High Performance CPU, Low Power Up to 500 DMIPS, 150 & 90nm process 600uA/MHz, 1.5 ua standby Medical, Automotive & Industrial High Performance CPU, FPU, DSC Up to 165 DMIPS, 90nm process 500uA/MHz, 2.5 ua standby Ethernet, CAN, USB, Motor Control, TFT Display Legacy Cores Next-generation migration to RX General Purpose Up to 10 DMIPS, 130nm process 350 ua/mhz, 1uA standby Capacitive touch Ultra Low Power Up to 25 DMIPS, 150nm process 190 ua/mhz, 0.3uA standby Application-specific integration Embedded Security Up to 25 DMIPS, 180, 90nm process 1mA/MHz, 100uA standby Crypto engine, Hardware security 5
MBD, Virtualization & HIL Simulation Superior Design Process The Space Station consists of 70 separate major components and hundreds of minor ones, all of which will be assembled for the first time in space. pbs.org 6 Intel Core 2 Duo 291M transistors PCB circuit simulation
MBD, Virtualization & HIL Simulation Model based development (MBD) is imperative. Virtualization is effective. Simulation is critical. Hardware in the Loop (HIL) systems are practical and compelling. Testing and Verification are safer and more efficient. These technologies are available now. 7
Agenda Introductions MBD, Virtualization & HIL Simulation Discussion Strategy Development Lab Code Generation Lab Verification on Virtual Platform Lab Verification on Real-time Platform Lab 8
Key Takeaways Understand benefits and efficiencies of model based development Appreciate capability and effectiveness of code generation tools Understand virtualization, co-simulation and HIL simulation methodologies Recognize the accuracy, visibility and savings from a virtual development platform Value the confidence and savings of a real-time development platform Appreciate the improved efficiency and controllability of testing and verification 9
Introductions Amrit Vivekanand Renesas Electronics America 011C: Velocity Lab Ecosystem Tues morning 52AP: Model Based Development Mon afternoon Bob Chamberlain Renesas Electronics America Rich Union Renesas Electronics America John Mills SimuQuest Chris Myers SimuQuest 024C: Auto Code Generation Tues afternoon 021L: Model Based Dev. & Auto Code Gen. using R8C Tues afternoon Ray Turin SimuQuest 023C: Model Based Control Design Tues morning Marcella Haghgooie Applied Dynamics, International 020C: Hardware in the Loop: System Testing without the System Wed morning Everett Lumpkin consultant 021C: Virtual Microcontroller and System Modeling Wed morn 10
MBD, Virtualization & HIL Simulation Discussion 11
Traditional Development Platform where we were Plant Controller Driver Code Strategy Code + drvr.c + + strat.c fuel & exhaust considerations fixed, inflexible innately hardware tied to micro tremendous family effort required real, functional loads debug required limitations detailed due interface to hard, knowledge implementation may obscure errors can be dangerous real time platform required strategy many interdependent limited systems visibility significant time or money to expensive prototypes create challenging repeatability 12
Typical Model Based Development Platform where we are Simulator running Plant Model Controller Driver Code Strategy Model in Simulink + drvr.c + + difficulties with physical same controller plant same are handwritten hardware driver implementation code at algorithm eliminated level real-time behavior is retained development costs are significantly reduced development hardware can be reused faster development easily simulated code generation is mature 13
Full Model Based and Virtualized Development Platform where we need to be Plant Model in Simulink Micro Model in VaST / ASTC / CoWare Generated Driver Code Strategy Model in Simulink + + + no physical plant cycle issues accurate production micro level model code same generation strategy model no hardware is required micro peripheral seamless interface models included with strategy model completely portable and configurable complete no visibility need for and detailed repeatability micro knowledge or spec completely portable and configurable complete access to all source same debugger GUI 14
Summary of Implementation Options Hardware Implementations Software Implementations Plant Controller Drivers Strategy Production type platform Production type platform Code Code Hardware real-time simulator Microprocessor Evaluation Board Tool / Code Generator Model Software (virtual) model Software (virtual) model A development platform includes at least a plant and strategy option, and may include a controller and driver option. 15
Effort Comparison Traditional Development - where we were Typical Model Based Development - where we are Full Model Based & Virtualized Development - where we need to be Plant (Test Env.) Plant on HIL sim. Fully generated drivers Virtual Plant Driver Code Virtual Controller HIL simulator Strat. Model Controller Virtual Verification Controller Driver Code Functional model instead of code Driver Code No API or driver integration Strategy Model Strategy Code Verification Verification HIL simulator instead of physical plant 16
Questions What are the main benefits of a model based design? What are the main benefits of a virtual development environment? What are the main benefits of an HIL simulation? Audience questions? 17
Benefits of MBD, Virtualization & HIL Simulation Shorter Development Schedule Less Development Expense Complete Configurability and Portability Focused on Strategy Algorithms, not implementation details Better Visibility, Controllability & Repeatability Fully Auto Coded Solutions Higher Reliability with More Confidence Virtual Development Platform Real-Time Development Platform Verification More Efficient and Controlled Testing and Verification 18
Strategy Development Lab 19
Strategy Development Lab Develop / Procure Plant Model Ignore Controller Details Ignore Micro Details (No Drivers) Develop / Procure Strategy Model Debug / Verify in Matlab / Simulink Plant Controller Drivers Strategy Production Production Code Code Real-time simulator Eval. Bd Tool / Code Gen. Model Software model Software model See Lab Procedure 20
Strategy Development Lab Results Vehicle Speed Scope in Matlab / Simulink Engine RPM Mass Air Flow Manifold Pressure Oxygen Sensor Throttle Position Active Gear Key On Signal 21
Strategy Development Lab Answers Final speed is ~ 13 MPH. The interface uses physical units like C, MPH, Pascals. The brake_pedal, average_torque, and throttle_characteristics models are actual algorithms and are not S-functions. spark = base_spark spark_corr fuel_pulse_width = base_fuel_pulse * fuel_trim_factor Changing the shifter logic via the saturation block forced the simulation to always be in 1 st gear. Audience questions? 22
Code Generation Lab 23
Code Generation Lab Plant Model N/A Controller N/A Configure / Generate Driver Code Strategy Model Compile / Link All in Matlab / Simulink GUI Plant Controller Drivers Strategy Production Production Code Code Real-time simulator Eval. Bd Tool / Code Gen. Model Software model Software model See Lab Procedure 24
Code Generation Lab - Results Matlab Command/Log Window Simulink Code Generation Report Compiling Linking Generated Driver Code Status (window displayed only if run manually) All in Matlab Completion / Simulink GUI 25
Code Generation Lab Answers digital input, engine state input, engine management task, fuel ouput spark output, PWM output, digital output conversion every 1.00 millisecond 8.05 microseconds to convert the group No register or bitfield info is required clocks are 20 MHz, 5MHz, 5MHz, 645.16219KHz can be selected by either QuantiPhi (auto) or the user (manual) Audience Questions? 26
Verify on Virtual Platform Lab 27
Verify on Virtual Platform Lab Plant Model in Simulink Micro Model in CoMET Configure / Generate Driver Code Strategy Model Simulink / CoMET Cosimulation CoMET Debug with Renesas HEW Plant Controller Drivers Strategy Virtual Platform Production Production Code Code Real-time simulator Eval. Bd Tool / Code Gen. Model Software model Software model See Lab Procedure 28
Verify on Virtual Platform Lab - Results Simulink scope of inputs to micro model Simulink scope of outputs from micro model Simulink scope overall co-simulation 29
Verify on Virtual Platform Lab Answers Input source is Enginuity plant model Enginuity uses physical units The signals go to the micro model The micro requires low level electrical signals The scaling is needed to interface between the real world and the digital world Spark 0 is connected to micro port F pin 0 (PF0). It is connected to Simulink input LogicPlantModelerIn[0] About 33 engine cycles were completed in the last 2 seconds of simulation Audience Questions? 30
Verify on Real-time Platform Lab 31
Verify on Real-time Platform Lab Plant Model in Simulink Micro Evaluation Board Configure / Generate Driver Code Strategy Model ADI rtx Simulator interface cable Debug with Renesas E10A/HEW Plant Controller Drivers Strategy Real-time Platform Production Production Code Code Real-time simulator Eval. Bd Tool / Code Gen. Model Software model Software model See Lab Procedure 32
Verify on Real-time Platform Lab - Results ADvantageVI Custom Panel Interface ADvantage SIMplotter Chart 33
Verify on Real-time Platform Lab Answers internal_control subsystem & external_control subsystem fuel_pulse_width is generated from the HIL simulator physically measuring the actual electrical signal created by the SH2A micro. (The previous control strategy is now executing on the SH2A micro.) The ADvantageDE build compiles the Simulink generated code and the HIL control software (which interacts with the HIL real-time operating system and HIL hardware I/O cards) together into a single executable for the HIL. 34
Verify on Real-time Platform Lab Answers (2) Block Diagram of HIL system: HIL Simulator Engine Plant Model External Strategy Interface Hardware I/O Cards Micro Eval Board Internal Strategy External Strategy SH2A Micro mux 35
Conclusion 36
Summary Full Model Based Development (MBD) is real and effective. Production I/O driver generation is real and effective. Virtualization has accuracy, visibility, controllability and repeatability. HIL simulation is hard real-time and a practical verification method. Full simulation is required and critical to today s designs. Simulation provides more efficient and controlled testing and verification. These technologies greatly reduce development effort and costs. These technologies offer better reliability with more confidence. These technologies are available now. Renesas pulls all of these technologies together with our partners into Velocity Lab. 37
Questions? 38
Feedback Form Please fill out the feedback form! Please raise your hand if you do not have one. 39
Appendix 40
Model Structures Strategy Development Plant Strategy physical values Code Generation Driver Strategy low level values physical values 41
Model Structures (2) Virtual Platform Sensor/ Actuator Micro Periph. Plant Driver Strategy physical values electrical signals low level values physical values Real-time Platform Sensor/ Actuator HIL Hardware Micro Periph. Plant Driver Strategy physical values signal characteristics electrical signals low level values physical values 42
Renesas Electronics America Inc.