Ptolemy Tutorial n n What is Ptolemy How

  • Slides: 31
Download presentation
Ptolemy Tutorial n n What is Ptolemy? How it works? What is the development

Ptolemy Tutorial n n What is Ptolemy? How it works? What is the development environment for you Show demo and former simulation work

What is Ptolemy n Ptolemy is a software infrastructure (kernel) developed by EECS dept,

What is Ptolemy n Ptolemy is a software infrastructure (kernel) developed by EECS dept, Berkeley n n Object-oriented Support modeling, simulation, design and code generation for concurrent, embedded real-time system. Support multiple domains Support heterogeneous environment

Organization of the software

Organization of the software

Domains in Ptolemy

Domains in Ptolemy

Ptolemy executables n Pigi n n Ptrim n n SDF, BDF, DE, CGC and

Ptolemy executables n Pigi n n Ptrim n n SDF, BDF, DE, CGC and HOF domains plus GUI Ptiny n n All domains and targets plus GUI SDF and DE domains plus GUI Ptcl n All domains, no GUI

Basic building bocks

Basic building bocks

Named. Obj

Named. Obj

Basic building blocks n n n Star: lowest level block in Ptolemy, with functionality

Basic building blocks n n n Star: lowest level block in Ptolemy, with functionality defined in c++ Galaxy: A block consisting of sub-blocks with input and output. Universe: An outmost block defining a executable system Domain: A model of computation, defining the behavior of a network of objects Wormhole: A galaxy with different domains from inside and outside

Domain classes derived

Domain classes derived

Block communication

Block communication

Hierarchical Abstraction

Hierarchical Abstraction

Hierarchical Abstraction (cont)

Hierarchical Abstraction (cont)

Star definition

Star definition

Star definition (cont)

Star definition (cont)

DE model n Provides a generic environment for time -oriented simulation system n n

DE model n Provides a generic environment for time -oriented simulation system n n Queuing system Communication network High-level modeling of computer architecture Particles represent event: change of system state

DE model n n n Each particle has an associated timestamp A global event

DE model n n n Each particle has an associated timestamp A global event queue sorts events by timestamp DE processes event in a chronological order (fetches the first one)

DE model (cont. )

DE model (cont. )

File organization

File organization

Setup your environment n Environment variables: n n n PTOLEMY: full path name of

Setup your environment n Environment variables: n n n PTOLEMY: full path name of ptolemy installation PTARCH: the platform on which Ptolemy is running Setup environment (put in. cshrc) n n n setenv PTOLEMY ~ptolemy setenv PTARCH `$PTOLEMY/bin/ptarch` setenv path = ($PTOLEMY/bin. $PTARCH $path)

Setup environment (cont. ) n On machines in cs dept n View available module

Setup environment (cont. ) n On machines in cs dept n View available module n n Load Ptolemy n n Module ptolemy Module load soft/ptolemy Setup JAVAHOME environment variable n setenv JAVAHOME /soft/java/Sun. OS 5. 6/JDK-1. 3

Running Ptolemy n Run Ptolemy demo n Go to demo directory n n n

Running Ptolemy n Run Ptolemy demo n Go to demo directory n n n cd $PTOLEMY/demo Run pigi Run former simulation n FC-AL SSA XOR-based disk

Using GUI n Programs: n n Vem Oct pigi. RPC Design objects n n

Using GUI n Programs: n n Vem Oct pigi. RPC Design objects n n Oct: design manager and database Facet: a design object(schematic or palette) Schematic: a design block diagram Palette: a facet containing a library of icons

Sample code for FC-AL n LPSM n Input n n n Inbound (from the

Sample code for FC-AL n LPSM n Input n n n Inbound (from the loop) from. FC 2 (FC-2 layer) Output n n Outbound (to the loop) to. FC 2 ( to upper layer)

LPSM n Internal states: n n n State (int) AL_PA (int) Fairness (int) prog.

LPSM n Internal states: n n n State (int) AL_PA (int) Fairness (int) prog. Delay (float) trans. Time (float)

LPSM implementation n Methods: n n n Setup Go wrapup

LPSM implementation n Methods: n n n Setup Go wrapup

Checklist to write your own simulation system n n Have a overview of Ptolemy

Checklist to write your own simulation system n n Have a overview of Ptolemy Conduct Architectural design of your system n n n n Basic star Galaxy Universe Get familiar with the Ptolemy running environment, draw the schematic diagram Implement all your stars Tweak and run your simulation Analyze the result

New direction of Ptolemy n Ptolemy II n Java based simulation environment

New direction of Ptolemy n Ptolemy II n Java based simulation environment

Resources n http: //ptolemy. eecs. berkeley. edu

Resources n http: //ptolemy. eecs. berkeley. edu

Resources n User Manual: n n n Pigi Ptcl Domains Vem Pxgraph installation

Resources n User Manual: n n n Pigi Ptcl Domains Vem Pxgraph installation

Resources (cont. ) n Programmer manual n n n n Software organization Writing stars

Resources (cont. ) n Programmer manual n n n n Software organization Writing stars Infrastructure Data types tcl/tk Domains Code generation

Resources (cont. ) n Kernel manual n n All stars defined in kernel Targets

Resources (cont. ) n Kernel manual n n All stars defined in kernel Targets used in kernel