ODB++ Control File Part Mapping
During ODB++ translation, it is often appropriate to augment available data for the purposes of simulation. One area that is often vital is component classification and value assignment; this supplementary information can be added using an XML Control File with a Components/TypeMap and/or ODBPropertyMap.
- The TypeMap element provides a sequence of either Part or RefDes elements.
- Each element specifies a Perl Regular Expression.
- A component's type and value are matched sequentially using the TypeMap, with Part elements evaluating against a part name and RefDes elements against the reference designator.
For example, a Control File mapping the type of components with reference designators beginning in 'L' to an inductor, 'R' to a resistor, and 'C' to a capacitor, is implemented as:
<?xml version="1.0" encoding="UTF-8"?>
<c:Control schemaVersion="1.0 " xmlns:c="http://www.ansys.com/control">
<Components schemaVersion="1.0 ">
<TypeMap>
<RefDes Type="Inductor " RegEx="L.*"/>
<RefDes Type="Resistor " RegEx="R.*"/>
<RefDes Type="Capacitor " RegEx="C.*"/>
</TypeMap>
</Components>
</c:Control>
The regular expressions in this example are mutually exclusive and, thus, do not rely on order for evaluation. A more complicated TypeMap, using part names, reference designators, and relying on order is:
<TypeMap>
<RefDes RegEx="L.*" Type="Inductor"/>
<RefDes RegEx="R.*" Type="Resistor" SR_Value="25ohm" />
<Part RegEx="100nF " Type="Capacitor" SC_Value="100nF" SR_Value="0.1ohm" />
<Part RegEx=".*nF " Type="Capacitor" SC_Value="0.1uF" SR_Value="0.1ohm" SL_Value="0.1nH" />
<RefDes RegEx="C.*" Type="Capacitor" SC_Value="1uF"/>
</TypeMap>
The following mappings should result:
|
Part Name |
Refdes |
Mapped To |
|
AA-0.1nF |
C21 |
Capacitor:(0.1uF,0.1ohm,0.1nH) |
|
AB-1000nF-T |
C22 |
Capacitor:(1uF) |
|
100nF |
C23 |
Capacitor:(100nF,0.1ohm) |
|
100nF |
L-C24 |
Inductor |
Information regarding component type and values can be specified in the control file. If the component information is not in the control file, the translator looks for optional properties in the ODB++ component files if the component has 2 pins. If the component records in these files have property records TYPE and VALUE, the contents of these properties are used to determine component information. All comparisons are case independent.
The following table shows the type assigned to the component based on the TYPE property content:
|
TYPE property |
Type assigned to the component |
|
"resistor" or "embedded resistor" |
resistor |
|
"inductor" |
inductor |
|
"capacitor" or "embedded capacitor" |
capacitor |
|
any other TYPE content |
the content of VALUE is used to deduce the type |
|
1. content does not begin with a number |
component is assumed to be discrete |
|
2. content begins with a number |
|
|
• without any following text |
resistor |
|
• last letter is "h" |
inductor |
|
• last letter is "f" |
capacitor |
|
• following text includes "ohm" |
resistor |
|
• last letter is a unit abbreviation ("p", "n", "u", "m", "k", "meg", "g", or "t") |
resistor
|
ODBPropertyMap
If an ODBPropertyMap is not defined in the .xml file types and values of component are assigned primarily through the TypeMap. Any unmatched components then has their type and value set on the component PRP with key Type in the component_top and component_bottom file and the values on the PRP key called Value or Val. If additional control is chosen one can define the ODBProperty map.
If one wishes to use the TypeMap as default values one can now set the "PrioritizeOverTypeMap" attribute to true in the ODBPropertyMap. From the following case, if the a component R1 had a resistance value set in the VALUE key of "1K": with the flag set to true the resistance is set to 1000 ohm, if the flag is not set the resistors value are 25ohm.
Fields are listed in priority order and the names are compared without case sensitivity. That is the field named Type takes precedence over all the other fields and it matches "TYPE", "type", etc. Because the TypeOnly field is true it are only used to set the type and should not correspond to a value. If this is being used for R1, it is likely "resistor". If a field is not "TypeOnly" it are used to infer an RLC type. It is important to make your "TypeOnly" first in the list if you need to guarantee it are used. At present only 2 pin components with properties are supported.
The SeparationCharacter attribute takes a string of characters to cut at. For example, if the value supplied are in the form "220K/5%" and "3.9K,1%", set SeparationCharacter = ", /".
This string cuts at commas, spaces and the back slash.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<c:Control xmlns:c="http://www.ansys.com/control" schemaVersion="1.0">
<Components schemaVersion="1.0">
<TypeMap>
<RefDes RegEx="L.*" Type="Inductor"/>
<RefDes RegEx="R.*" Type="Resistor" SR_Value="25ohm" />
<Part RegEx="100nF" Type="Capacitor" SC_Value="100nF" SR_Value="0.1ohm" />
<Part RegEx=".*nF" Type="Capacitor" SC_Value="0.1uF" SR_Value="0.1ohm" SL_Value="0.1nH" />
<RefDes RegEx="C.*" Type="Capacitor" SC_Value="1uF"/>
</TypeMap>
<ODBPropertyMap PrioritizeOverTypeMap ="true">
<ODBProperty Name="Type" TypeOnly="true"/>
<ODBProperty Name="Value" SeparationCharacters = ", /"/>
<ODBProperty Name="Val"/>
<ODBProperty Name="InstPar" SeparationCharacters = ", /"/>
</ODBPropertyMap>
</Components>
</c:Control>