Você está na página 1de 21

AP-210 / Offspring BoM

Translator
A. F. Griesser, Ph.D.

Copyright 2008 by
Prometheus Computing LLC
www.PrometheusComputing.com
Outline

Underview
Translator Runtime
Modifying the Program
Next STEPs
Underview
Programmed by UML Diagrams
You can modify them
They compile into rules
Uses Jess Inference Engine
Applies rules to infer the structure of
the output
Translator Runtime

Requirements
Installation
Use
Requirements
Jess Inference (Rule) Engine
Not free: license it from Sandia
JRuby 1.0 (with several added libraries)
Operating system - tested on:
Mac (OS X) with Java 1.5.0_13
Fedora Linux with Java 1.5.0_15
Installation - 1.

Install Jess 70p1


Unzip into SomeDirectory
Create environmental variables:
export JESS_HOME=${SomeDirectory}/Jess70p1
export JESS_CLASSPATH=`echo ${JESS_HOME}/lib/*.jar | tr ' ' :`
export JESS_PATH=${JESS_HOME}/bin
export PATH=$PATH:${JESS_PATH}
Installation - 2.

Install JRuby
Download from same site as runtime
This version contains extra libraries
Unzip into SomeOtherDir
Set environmental variable:
export JRUBY_HOME=${SomeOtherDir}/jruby-1.0
Installation - 3.

Download the translator runtime


Unzip anywhere you like
Use

cd into the translator runtime directory


To use all the defaults, invoke ./run.sh
This translates FlasherThruHole.stp
Result is in temp/offspring_result.xml
Next slide explains command in run.sh
Command Line Dissection
CLASSPATH=$JESS_CLASSPATH RUBYOPT=rubygems
Sets some environmental variables
jruby -J-Xmx1024m -J-Xms256m
start jruby with some extra memory
./nist/Translator_Runtime/translator.rb
Ask jruby to execute translator.rb
<direction> <config_file> <input_file> <output_file>
Direction can be ltr or rtl (BoM only uses ltr)
Remaining args are absolute or relative paths
BoM Bidirectionality
IPC
BoM Line Item
AP210
Package
IPC
Package

AP210
Component IPC
Component

Red lines conflict with blue lines


The Configuration File
Specifies (for left & right sides):
Type of file (STEP part 21 or XML)
Namespace to use (in rule engine)
File path to schema
File path to rules needed by rule engine
Debug options, output filter
File path to external functions (in Ruby)
Configuration Snippets
# Specify file type (:xml or :stp), namespace, path to schema
self.right= FileSpec.new(:xml, :IPC2581am1, './test_input/
IPC-2581_V1.0_Ammendment1.6Proposed.xsd')
# Specify pre-processing & debug information
right.debug_input
# Specify post-processing, filtering, & debug information
right.debug_output {|framelet| framelet.__full_name
([:IPC2581am1, :IPC_2581Type])}
# Define primitive translations
require "functions.rb"
# Specify rule files (‘_ltr.clp’ or ‘_rtl.clp’ is appended)
self.rules= './test_input/BoM'
Modifying the Program

Requirements
Installation
Use
Requirements

MagicDraw... Tested on:


Version 14
Personal Edition
Java 1.5.0_13 on Mac (OS X)
Java 1.5.0_15 on Fedora Linux
Installation
1. Create “Prometheus” directory in your
home directory
2. Move Zip file contents into MagicDraw
Plugins folder
3. Restart MagicDraw
Verifying Installation
Go to Options > Environment > Plugins
The Ruby adaptor should have “true” for
both “loaded” and “enabled”
Open the log file:
~/.magicdraw_personal/14.0/md.log
Verify it contains:
Loading Ruby plugins...
Loading plugin com.prometheus.mapper.
Use
Each diagram corresponds to one rule
Diagrams are hybrids between class &
instance diagrams
Rules have conditions and consequences
Distinguished by color coding
Associations usually indicate constraints
Dependencies usually indicate mappings
Use
1. Draw the diagram
2. Write any necessary functions
3. Select diagram or package with diagrams
in Containment Browser
4. Use context menu to generate code
5. File ends up in ~/Prometheus directory
6. Move file to place specified by config file
Next STEPs
AP210/Offspring:
Connectivity provided by board
(Gerber data: Traces and pads)
Netlist
More next year
SEMI SECS/EDA
Acknowlegements
This work was funded by NIST: special
thanks to Ya-Shian Li-Baboud and Kevin
Brady
Craig Lanning developed the mapping rules
and the functions
Members of the AP-210 Electro-Mechanical
Pilot contributed much useful information