Below is an example of the display of the top-level netlist of the Picture-in-Picture modeling example.
Double-clicking on an object representing a netlist (displayed as a gray box by default) opens another view showing the structure of that netlist. Double-clicking on another object opens a text editor on the source code for that object.
The Structure Viewer requires Eclipse 3.1 or later, using Java version 1.5 or later, and the Graphical Editor Framework (GEF) Eclipse plugin, release 3.1.1 or later. It also requires a local installation of Metropolis. Also, in order to do automatic layout, the open-source GraphViz layout programs from AT&T must be accessible.
.zip
file in the folder containing your Eclipse
installation (i.e., containing the folder called "eclipse"), and its
contents should be extracted into their proper places (the plugins,
features, and readme folders).
Window -> Open Perspective -> Java
Window -> Preferences -> Metropolis
Browse
tool.
Project
menu:Build Automatically
(if it shows a checkmark)
to disable.
File
menu:
File -> New -> Project... -> Other -> Metropolis Project
You are first prompted to give the project a name. The name must be the name of the root package of your model. The top-level folder of the project is where you will put any metamodel (.mmm) source files belonging to the top-level package, and any subfolders containing sub-packages.
After entering the name, you can hit Finish
.
Your Metropolis metamodel (.mmm) source code can be created in place using Eclipse's text editor, or it can be imported into your project.
To import files that are accessable from your file system,
select the project title in the Package Explorer view,
right-click to bring up the context menu, and select the
"Import...
" menu item.
On the first page of the resulting wizard,
select "File system
" as the source
and navigate to your files in the subsequent wizard pages.
If your files are in CVS, you can instead use the
"Team -> Share Project...
"
context menu item to check out your files
from CVS.
The details of using CVS with Eclipse are outside the scope
of this document, but are fairly straight-forward.
The specifications for compiling your model
(i.e., the information you would include on the
command line of a metacomp
command that would build it)
are entered as properties of the Eclipse project containing
your model.
To enter that information, right-click on the project resource
in the Package Explorer view:
Properties
in project context menu:Metro Specs
"
and "Metro Source Files
".
Here are illustrations of example settings for the
producers_consumer
example:
Metro Specs
page,
for entering Java classpath and Metropolis
classpath (each initially set to default values), and the
fully-qualified name of the top-level model package,
and the name of the top-level netlist.
Metro Source Files
page,
with tools for browsing to files
in the project, in the Metropolis library, and elsewhere in the
local file system, respectively.
Use the Add...
button to add entries.
Select entries and click the Delete
button to delete them.
Metro Specs
page
for the PiP example.
Metro Source Files
page
for the PiP example.
Project -> Build Project
Console
view
(Window -> Show View -> Console
)
displays the output of that process.
A successful build will create a folder inside the project called
metro0.tmp
.
(Subsequent builds will create metro1.tmp
,
metro2.tmp
, etc.
To avoid this accumulation, delete unwanted
metroX.tmp
folders before building.)
Inside metro0.tmp
is a binary representation of
the model structure called NET
.
Below is a screendump of an Eclipse window showing the output of
a successful build of the producers_consumer
example,
and the file NET
which it creates.
Double-clicking on the file NET
in
metro
x.tmp
will bring up a display of the elaborated netlist described by
that file.
The initial appearance of the graphical display
depends on the layout preference settings.
Before describing the preferences, a note about auto-layout is in order: Automatic layout is provided as a helpful starting point for laying out a diagram. It may not provide a suitable finished layout, but can help provide an initial layout that is understandable and easily modifiable by hand. The preferences can be helpful in getting the most out of auto-layout.
Window -> Preferences -> Metropolis -> Layout
Do automatic layout...
Never
When no layout has yet been done
Auto layout style
spring tension (GraphViz neato)
hierarchical, in rank and file (GraphViz dot)
radial (GraphViz twopi)
circular (GraphViz circo)
More information about these layout schemes is available on the GraphViz website.
Stretch the distance between components...
This slider allows adjusting the distance between objects provided by the auto-layout program.
Location of GraphViz programs
This file-specification tool must be filled in to tell the plugin where to find the layout programs, if auto-layout is desired.
Fit MObjects around their names / Use default MObject size:
The initial size of netlist components is set here to either fit snugly around their name labels, or else to be a set width and height in pixels.
Color editors are provided to change the colors used to identify the types of objects displayed.
A white circle on a component rectangle represents an output port. The name of the port is displayed in a tooltip when the mouse hovers over it.
A shadow port can appear either as a free-floating symbol, when it represents a connection endpoint outside of the current netlist, or as a port symbol on a netlist object, when it represents a connection endpoint inside that netlist. The following figure illustrates:
The rectangular component symbols and the free-floating
shadow port symbols can be dragged into any position.
They can also be resized by selecting them and dragging their
handles.
Multiple symbols can be selected at once by dragging a selection
box around them, or by doing Shift-Click
to add them to the current selection.
An important caveat: If multiple views of the model are open when one is saved -- i.e., views of multiple netlists in a hierarchical structure -- it is important to realize that the layout for all views will be saved. That is, the layout for the entire model is saved in one place and saving any view saves the layout for all views.
Edit
menu contains Undo
and Redo
items.
Undo
and Redo
.
Undo
and Redo
items.File
menu contains a Save
item.Save
icon.
JPEG and BMP formats have been tested to work on Windows and Redhat Linux platforms. The underlying Java API theoretically also supports PNG and GIF, but success with those is yet to be seen.