A 10 years journey of Medical Device Development Other Cool Stuff together with Eclipse and Modelling Carsten Gosvig SW Tools Architect 20 March 2017
2 Requirements Why do we use modelling? Research Digital HW Development Highway Platform Avenue FW Domain Access Embedded SW Fitting SW C#/.NET Service C#/.NET Analog HW Application Audiology Street Production Labview Product Matlab Fitting SW Audiology Matlab DSP Algorithm Production___ C o m DSP Algorithm Matlab p l A e l Product t l i e o y n eSW Matlab FW Java Service HW Java
3 Requirements Parameter Abstraction Levels 1 parameter LP3 Audiology LP2 Transformations: Matlab, C#, DSL LP1 Filter = LP2 f 3dB f 3dB PC only f 3dB 2 parameters DSP Algorithm Type = LP LP f 3dB = 1.5 kHz f 3dB 6 coefficients Input + + s0 b0 PC and Device D eSW a 1 = 0.125 a 2 = 0.375 + + a1 b1 b 0 = 1.0 b 1 = 0.5 b 1 = 1.0 D s 0 = 0.75 a2 b2 data_in Register file w2 MUX 32 instructions q0_w2 q1_w2 REG REG w1 MUX SEL(Q0), SEL(W2), SHR(2), ADD(0), UPD(A); q0_w1 q1_w1 ctl[1] HW SEL(Q0), SEL(W2), SHR(4), ADD(A), UPD(A); -- (1) MUX REG REG ctl[2] input_sel ctl[0] ctl[5:3] SEL(Q0), SEL(W2), SHL(1), ADD(0), UPD(B); SHIFT sh_res ctl[10] ctl[11] SEL(Q0), SEL(W2), SHR(2), ADD(B), UPD(B); -- (2) ctl[7] MUX +/- acc_sel ctl[6] A B SEL(Q0), SEL(W1), SHR(2), ADD(B), UPD(B); -- (3) REG REG add_res ... ctl[8] ctl[9] ctl[12] REG res1 data_out
4 Requirements Automation and Customization FW Production FW.level HW.bias Start set: HW.bias = 42 run: FW.startTest3(4, 10) start get: stat = FW.isRunning stat == 0 snoop get: result = FW.level Stop
6 The Solution The Journey 2007-2010 2014-2016 • HW, FW and eSW • Audiology development development and • XML, C, RT model, Fitting SW driver • Custom debug GUI CLI tools, Java API, Device debug GUI M2T, Textual DSL • Eclipse Ganymede, • Eclipse Mars, RCP, EMF, CDT Xtend, Xtext 2017… 2011-2013 • DSP Algorithm and • Performance and Device production Modelling usability • Cached RT model, • Incremental M2M, IDE, HTTP API, Graphical editors, Settings diff GUI new Eclipse+Java • Eclipse Juno, Jetty, • Eclipse Neon, CNF, EMFCompare Graphiti, e4 XWT
6 The Solution Modelling like source code 2007-2010 • HW, FW and eSW development • XML, C, RT model , CLI tools, Java API, Device debug GUI Patched • Eclipse Ganymede, .c RCP, EMF, CDT • A • B • D CDT RT model • A X Y X • B • • N A • C • • B M Y • D Z • N Z • N • M • M XML
7 The Solution Performance with models in 2010 2007-2010 • HW, FW and eSW development • XML, C, RT model, CLI tools, Java API, Device debug GUI eSW • Eclipse Ganymede, FW RCP, EMF, CDT HW Numbers are for the parameter DSL Year 2010 Types: Element types in DSL Types 90 Files 170 Files: Source model files Elements 14K Elements: Source model elements Instances 220K Instances: RT model elements Memory 540 MB Load XML: Load source model Load XML 1 sec Transform: Source model to RT model Transform 11 sec
8 The Solution Source model tooling 2007-2010 • HW, FW and eSW development • XML , C , RT model, Controlling XML syntax for href attributes CLI tools, Java API, Device debug GUI … xmi.impl.XMLResourceImpl.getEObjectByID(String) • Eclipse Ganymede, RCP, EMF , CDT … xmi.impl.XMLResourceImpl.getURIFragment(EObject) From EMF library example: <author> #//@writers.0 </author> Source model example: link=" #idsp_unit.gp_core.top_param " Generating source model files from c code with annotated elements Using Eclipse CDT Managed Builder to drive the source file iteration Each IASTTranslationUnit calls special ASTVisitor for annotated elements
9 The Solution RT model tooling 2007-2010 • HW, FW and eSW development • XML, C, RT model, Matlab Tests CLI tools , Java API , Device debug GUI • Eclipse Ganymede, RCP , EMF, CDT RCP Java Tests Device debug GUI Java API X • A Y Z • • • B N N • • • D M M X.A = 100 Y.N = 10 .image Z.N = 20 Z.M = 70 CLI
10 The Solution More model tooling 2011-2013 • DSP Algorithm and Device production • Cached RT model, Production IDE , HTTP API, CNF EMF Compare Settings diff GUI • Eclipse Juno, Jetty, CNF , EMFCompare Jetty EMF Binary Resource HTTP Server Impl .binary X • A Y Z .xml • • • B N N • • • D M M
11 The Solution Supporting non Java runtime 2011-2013 • DSP Algorithm and Device production • Cached RT model, Uses org.eclipse.jetty.server.Handler.handle(String, IDE, HTTP API , Request, HttpServletRequest, HttpServletResponse) Settings diff GUI • Eclipse Juno, Jetty , CNF, EMFCompare Request: http://localhost:2950/plain/manager/sessions/foo/connections/bar/automation.flowchart Response: x=100 y=3000
12 The Solution Caching RT model 2011-2013 • DSP Algorithm and Device production • Cached RT model , org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl IDE, HTTP API, Settings diff GUI Binary format is tightly coupled to classifier and feature ID’s • Eclipse Juno, Jetty, CNF, EMFCompare Numbers are for the parameter DSL Year 2010 Types: Element types in DSL Types 90 Files 170 Files: Source model files Elements 14K Elements: Source model elements Instances 220K Instances: RT model elements Memory 540 MB Load XML: Load source model Load XML 1 sec Transform: Source model to RT model Transform 11 sec Load Bin: Load cached RT model Load Bin 2 sec
13 The Solution Even more model tooling 2014-2016 • Audiology development and Fitting SW driver • Custom debug GUI Fitting M2T , Textual DSL • Eclipse Mars, Software Xtend , Xtext Custom debug GUI workflow readLevel { XML Xtend output a .driver Generator a = FW.level C# } X • A Y Z • • • B N N • • • D M M
14 The Solution From XML to Xtext DSL approach 2014-2016 • Audiology development and Fitting SW driver • Custom debug GUI M2T, Textual DSL • Eclipse Mars, Xtend, Xtext
15 The Solution Customizable debugging GUI 2014-2016 • Audiology development and Fitting SW driver • Custom debug GUI M2T, Textual DSL • Eclipse Mars, EMF.Edit Xtend, Xtext
16 The Solution Performance with ever growing models 2017… • Performance and Modelling usability • Incremental M2M, Product Graphical editors, Audiology DSP Algorithm new Eclipse+Java eSW eSW • Eclipse Neon, FW FW HW Graphiti, e4 XWT HW Numbers are for the parameter DSL Year 2010 2017 Types: Element types in DSL Types 90 260 Files 170 3300 Files: Source model files Elements 14K 190K Elements: Source model elements Instances 220K 3100K Instances: RT model elements Memory 540 MB 2800 MB Load XML: Load source model Load XML 1 sec 3 sec Transform: Source model to RT model Transform 11 sec 103 sec Load Bin: Load cached RT model Load Bin 2 sec 23 sec
17 The Solution Improved tooling 2017… • Performance and Modelling usability Accessor • Incremental M2M , Our own BinaryResourceImpl • Z Graphical editors, • N new Eclipse+Java Handling classifier and feature ID’s • • M Eclipse Neon, Graphiti, e4 XWT • A X X • B X • A Y Z • D • B • N • N Y • D • M • M Y • N Z Z • M Q Q P RT model • S • S P Q Q P • S • S P
18 The Solution RT model memory consumption 2017… • Performance and Modelling usability • Incremental M2M, Requirement Graphical editors, new Eclipse+Java Production test systems have limited memory • Eclipse Neon, Graphiti, e4 XWT Solution Use Boolean flags field instead of individual Boolean fields Our own base class that extends org.eclipse.emf.ecore.impl.EObjectImpl Find elements in model that are identical and then only keep one of them Finding identical elements also takes time T U TU T • • • 1 1 1 • • U • 7 7 7 Replace general element structures with new element type Instead of *1000 elements per memory block we will only have one element
19 The Solution New Eclipse and Java versions 2017… • Performance and Modelling usability • Incremental M2M, Requirement Graphical editors, new Eclipse+Java Use the latest versions – less bugs and most features • Eclipse Neon, Graphiti, e4 XWT Support Eclipse Neon which requires Java 8 runtime Support Matlab having it’s own JVM embedded, which is only at Java 7 Solution Make the API needed in Matlab available through an HTTP interface Ended up reusing/extending the first Jetty HTTP Server based API Will generate a Java 7 compliant frontend for Matlab that uses HTTP
20 Graphical Editors 2017… • Performance and Modelling usability • Incremental M2M, Graphical editors , new Eclipse+Java • Eclipse Neon, Graphiti Graphiti , e4 XWT Binding Editor e4 XWT
21 The Solution Solution Numbers 2007-2017 Human Resources 20 SW developers have contributed over time Around 60 man-years of work More than 240 users Artifacts 7500 files of Java source and test code 2500K lines of Java source and test code 85000 test model files
Recommend
More recommend