Open Microelectronics architecture considerations Marek Gayer, Ph.D. .

36
Open Microelectronics architecture considerations Marek Gayer, Ph.D. www.ing.unipi.it
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    219
  • download

    0

Transcript of Open Microelectronics architecture considerations Marek Gayer, Ph.D. .

Open Microelectronics architecture considerations

Open Microelectronics architecture considerations

Marek Gayer, Ph.D.

www.ing.unipi.it

2PISA 2007

www.ing.unipi.it

Some of goals of frameworkSome of goals of framework

Interactive input of simulation parameters and interactive visualization

Programmable flow of simulation modules Open source Multiplatform (at least Windows + Linux) Easy installation and updates Easily extendible by user without recompiling Server based simulation Ability to develop and contribute without necessity to

understand whole problems and technologies Should encourage others to contribute

3PISA 2007

www.ing.unipi.it

Basics of ArchitectureBasics of Architecture

Interactive Device designer(like devedit)

User Interface - C++ with Qt / GTK / etc.UI – Java / Java Web Start / Applet

UI - ECMAScript + SVG + DHTML

Design and flow visualization - SVG, OpenGL, Library capabilities

Interactive Visualization(like tonyplot/3d)

Visualization by: OpenGL , SVG , VRML – X3D, Java2D/3D

Common video formats

Statistics

Server(like deckbuild)

Server Scripting – CGI, PHP, JSP, Python, Perl

Flow Control – XML, XSLT, Python, PHP

Simulator modules and their bindings (C/C++, Fortran)

Data interchange between modules (C++ library, files)

Visualization creating / assistance modules (reduced XML grid, web

graphics formats)

Data Storage of results on server:

Files, SQL, XML, ...

Task to solve

Visualization Interaction

XMLover

TCP/IP

4PISA 2007

www.ing.unipi.it

Interactive designerInteractive designer

Will specify the task to compute server(shape, materials, doping, …)

Will also specify flow of simulation modules, perhaps by an interactive graph editor

Can create a grid, eventually meshing Result will be send to server Will use 2D shapes graphics, with control of Z

axis Could be made as a master thesis(es)

5PISA 2007

www.ing.unipi.it

Interactive designer – C++Interactive designer – C++

+ Fast performance + C/C++ will be probably used for

simulation modules and passing data - We must make and test binaries for

supported platforms - Easy delivery and update via web

browser not possible (like in Java)

6PISA 2007

www.ing.unipi.it

Interactive designer –User Interface – C++ with QtInteractive designer –User Interface – C++ with Qt

+ Most professional solution for multiplatform UI + Windows / Linux / Mac (native widgets) + Good documentation + Completeness + User Interface Designer (Qt Designer) + Bindings for Python, Java - GPL / commercial license + Used by Google Earth, Skype (Linux), KDE (Linux) http://en.wikipedia.org/wiki/QT http://www.trolltech.com/

7PISA 2007

www.ing.unipi.it

Qt Designer by TrolltechQt Designer by Trolltech

8PISA 2007

www.ing.unipi.itInteractive designer User Interface – C++ with GTK+

Interactive designer User Interface – C++ with GTK+

+ Often used for multiplatform UI + Windows / Linux / Mac (native widgets) - User Interface Designer + Bindings for Python, Java + LGPL license - Written in C, although C++ wrapper exists (gtkmm) + Used by Gnome, GIMP, Firefox

http://en.wikipedia.org/wiki/GTK http://www.trolltech.com/

9PISA 2007

www.ing.unipi.it

Glade – UI designer for GTK+Glade – UI designer for GTK+

10PISA 2007

www.ing.unipi.it

Interactive designer User Interface – C++Interactive designer User Interface – C++

Other alternatives:

–wxWidgets

–FoxToolkit

–FLTK

–Ultimate++

11PISA 2007

www.ing.unipi.it

Interactive designer –JavaInteractive designer –Java

+ Ability to deploy application in various ways (web start, applet, java binaries)

+ Rich library (e.g. java2d) http://java.sun.com/products/java-media/2D/

+ Many open source projects are in Java (SF: 23.000 Java, 20.000 C++, 18.000 C)

+ Java Web start - Java apps need considerable more memory - Java runtime must be installed

12PISA 2007

www.ing.unipi.it

Drawing with Java2D LibraryDrawing with Java2D Library

13PISA 2007

www.ing.unipi.it

Interactive designer – Java – SWING libraryInteractive designer – Java – SWING library

+ Made by Sun + Looks similar on each platform + Good object model design (more pure

Java) - Native GUI applications looks still better http://en.wikipedia.org/wiki/Swing_(Java) http://java.sun.com/products/jfc/tsc/sightings/

14PISA 2007

www.ing.unipi.it

Maple 10 UI made with SWINGMaple 10 UI made with SWING

15PISA 2007

www.ing.unipi.it

Interactive designer – Java – SWT libraryInteractive designer – Java – SWT library

+ Made by IBM + Looks more native on each platform - Worser object model design - Harder to develop then Swing - More neccessary to test each platform + More professional look http://en.wikipedia.org/wiki/SWT

16PISA 2007

www.ing.unipi.it

SWT on different platforms and Eclipse on Window VistaSWT on different platforms and Eclipse on Window Vista

17PISA 2007

www.ing.unipi.it

Interactive designer –Java Web StartInteractive designer –Java Web Start

+ Allows easy installation and launching of software through web browser

+ Easy update of new versions of software + When installed once, it is not necessary to

install again (under the condition that no changes were made)

+ During update, new jars are downloaded + Ability to use all features of Java: menus,

user interface, graphics, … http://en.wikipedia.org/wiki/Java_Web_Start

18PISA 2007

www.ing.unipi.it

Interactive designer ECMAScript (AJAX)Interactive designer ECMAScript (AJAX)

+ Not necessary to install anything (Firefox) + Easy delivery of new versions of application + Fast start of application - Considerably harder to develop complex applications then with C++ /

Java (hard testing, debugging) - No IDE, no GUI designer, unmature tools - Strange class/object model syntax - Poor general class library (e.g. strings) - Cannot access local filesystem due to security - Limitations of UI due to DHTML - Differences in each browser => necessary to test and maintain for

new browsers - Memory requirements - Interpreted, not compiled => slow +- Graphics would have to be in SVG http://en.wikipedia.org/wiki/Ajax_(programming)

19PISA 2007

www.ing.unipi.it

Google spreadsheet in ECMAScriptGoogle spreadsheet in ECMAScript

20PISA 2007

www.ing.unipi.it

Designer and simulation flow visualizationDesigner and simulation flow visualization

Using the visualization in the UI package:

– Graphics View for Qt

– Cairo for GTK

– Java2D for Java Using SVG Using OpenGL

21PISA 2007

www.ing.unipi.it

SVGSVG

Standard for vector and raster graphics based on XML used namely on the web

With Batik, generation of SVG is as easy as in Java2D (implements same interface)http://en.wikipedia.org/wiki/Batik

Possibility to add ECMAScript functionality Possibility to generate SVG from XML using

XSLT transformations Good support in browsers and other software http://en.wikipedia.org/wiki/

Scalable_Vector_Graphics

22PISA 2007

www.ing.unipi.it

OpenGLOpenGL

+ Portable library for 3D/2D graphics - No object layer - Uses state machine concept - More complex to learn and to use due to

less abstraction level (compared to e.g. Java2D)

+ Very fast performance + Bindings for different languages, including

Java: http://en.wikipedia.org/wiki/Java_OpenGL

23PISA 2007

www.ing.unipi.it

Inside Web ServerInside Web Server

Server core – CGI/PHP/JSP/Python

Sim.mod. 1 Sim.mod. 2

Sim.mod. 3

File/ SQL

Sim. Mod 4

Sim Mod 5 Sim Mod 6 Sim Mod 7

User defined flow in e.g.

Python / XML

Data Synchronizing

libraries / (XSLT) data converters

Visualization / Data assitance (SVG / VRML / MPG / XML)

Shared Memory

Interactive visualization

Interactive designer

24PISA 2007

www.ing.unipi.it

Server Side (1/2)Server Side (1/2) PHP/Python/JSP/CGI scripts on HTTP server will

maintain communication with interactive and visualization parts (including translation of data)

Will control the flow of simulation by launching simulation modules (written in C++/Fortran)

Data exhange between simulator modules will be realized using e.g. special C++ library, shared memory, PHP/Python glue code

Mechanism for calling C functions from Python/PHP glue should be investigated (something better then exec with files as arguments) – e.g. PHP extensions.

How modules will be compiled and linked together should be investigated

25PISA 2007

www.ing.unipi.it

Server Side (2/2)Server Side (2/2)

Possibility of using shared memory should be investigated

Input and output of modules could be defined XSD schema

Parts of glue could be defined by XML data (programmable by user / generated by designer)

XSLT transformations could be used for translation of data to format that module expects

http://en.wikipedia.org/wiki/XSLT Results (including partial ones could be saved in files

and/or SQL DB

26PISA 2007

www.ing.unipi.it

Interactive visualization of resultsInteractive visualization of results

Interaction with server for selecting part of currently visualized data of transistor

At least at beginning of project 2D visualization should be sufficient

Possibility to implement one or more of:– OpenGL– SVG (created on server)– VRML/X3D (created on server)– JPG / MPEG (created on server)– Delivering numerical data and stats. (XML)

27PISA 2007

www.ing.unipi.it

VRML/X3DVRML/X3D 3D Model scene is defined in text format Can be zoomed, rotated, etc. Requires plugin in web browser Those plugins are not fully compatible (Scripting …) For using in standalone application, library is needed

(CyberX3D, OpenVRML, Xj3D, H3D) X3D (ISO standard) is successor of VRML, adds

support XML For modification of visualization data, new

VRML/X3D file is usually created on server http://en.wikipedia.org/wiki/VRML http://en.wikipedia.org/wiki/X3D

28PISA 2007

www.ing.unipi.it

Progress (1/3)Progress (1/3) Established working environment for Python, Numpy

and building extensions in CygWin Even possible to run KDevelop and KDBG (possible

to debug extensions!) Read important parts on Python and Numpy

programming book (“Python Scripting For Computational Science”)

Created sample module in C, with one and two dimensional float arrays and pointer to function. Various programming styles (3 version of wrapper func used)

The 2D and 1D arrays are now accessible in both C and Python. Able to also use Python dictionary type

29PISA 2007

www.ing.unipi.it

Progress (2/3)Progress (2/3)

With NUMPY, converting to type * and type ** does not need additional memory and values do not have to be copied (in type **, helper mapping array of pointers must be created)

NUMPY alone is a reason to stick with Python Python extensions cannot be build easily with

Windows (requires 5 packages including.net framework SDK – hundreds of MBs)

Able to compile ViDES as library, then to link with wrapper as Python extension (no need to change a single line in original source code).

30PISA 2007

www.ing.unipi.it

Progress (3/3)Progress (3/3)

Wrote wrapper accepts tens of NumPY arrays and converts them to C type *(*)

Wrote allocations and file operations to fill all needed variables for module struttura to Python

Compiles and links, but I am getting Segmentation fault (debug needed)

31PISA 2007

www.ing.unipi.it

Progress2 (1/3)Progress2 (1/3)

Succesfully debugged ViDES struttura - results in binary files are 100% same

NumPy basic operations under matrixes should be same as C extension (for example I tested scalar multiplying on 1000x1000 matrix: 0.21s vs 0.20s)

Compared performance of versions of array accessing in Python and NumPy array as C extension - 2D arrays (NumPy, C), 1D (NumPy), and 2D lists (Python)

32PISA 2007

www.ing.unipi.it

Progress2 (2/3)Progress2 (2/3)

def PythonArray2dGridLoop (a, x, y, f): for i in xrange(x.size): for j in xrange(y.size): a[i][j] = f(x[i], y[j]); # OR # a[i][j] = x[i] + y[j]; # OR # return a;

Results: (e.g. 0.02s C vs. 3.5s Python), but with one Python callback 0.75s C vs. 3.9s Python

Howeever, direct manipulation in cycles is still slow; i.e. fast code is expected to be moved to C extension

33PISA 2007

www.ing.unipi.it

Progress2 (3/3)Progress2 (3/3)

Could be a good idea to buy NumPy book, for $39.99 (electronic pdf version), I read first 50 sample pages http://www.tramy.us/guidetoscipy.html Documentation for older package, Numeric is available here: http://numpy.sourceforge.net/numdoc/numdoc.pdffor most case it should be enough

TODO: make C++ class with overloaded operators, as possible recommended datatype to use in C++ modules and check performance againts double **

34PISA 2007

www.ing.unipi.it

Progress2 Notes (1/2)Progress2 Notes (1/2)

Shape of NumPy array can be anytime changed in python, but we must keep the number of items

Extended slice operations, which has base in python are inspired from Numeric/Numpy package

Numpy natively supports hundreds of operations:– Aritmetic operators (*+-^%+=):– Concetation of matrices– Slices and indexing– Creation of Matrices and Vectors (filling arrays e.g. identity matrix)– Reshaping– Assigment of multiple values– Transposing– Inverting

35PISA 2007

www.ing.unipi.it

Progress2 Notes (2/2)Progress2 Notes (2/2)

– Determinant– Summary of various elements– Sorting– Finding maximum and minimum– Flipping– Rotating– Various kind of multiplications– Finding values based on conditions– Statistics (average, median, variance, correlation, covariance)– Solving differential equation (diff function)– Fourier transformation– Direct reading from/to file. these operations are implemented

in C

36PISA 2007

www.ing.unipi.it

Thank you for your attention.Thank you for your attention.

???Do you have any questions ?