Timing Diagram Markup Language
Developer Tutorial
www.si2.org
Contents
Page
TDML Developer Tutorial
*1.0 TDML Introduction *
2.0 Overview of TDML Structure *
3.0 XML Overview *
3.1 Structuring data with XML tags *
3.2 TDML Definition Files *
3.3 The Catalog file *
3.4 Reading a DTD *
3.4.1 Elements *
3.4.2 Attributes *
3.4.3 Entities *
4.0 TDML Examples *
4.1 Header, Signal, and Waveform Elements *
4.2 Clock Elements *
4.3 Timing Parameter Elements (Delay, Setup, Hold, Constraint, Measure) *
4.4 Marker Elements *
4.5 Text Annotation *
5.0 Encoding Information Not Defined in the Standard *
6.0 XML Parsers *
6.1 SP *
This document describes how Timing Diagram Markup Language (TDML) is used to represent timing diagrams. Timing diagrams consist of waveforms, timing specifications, and parameters which define relationships between signals. TDML is designed to be the interactive timing diagram format used in on-line datasheets. To accomplish this goal, it also includes information on presentation and objects normally found in printed datasheets such as text annotations and time compression markers.
TDML is being developed by an Electronic Component Information eXchange (ECIX) Working Group under the management of the Silicon Integration Initiative (Si2). Members of the Working Group include: Chronology Corporation, Denali Software Inc., SynaptiCAD Inc., IBM, and Mentor Graphics/Interconnectix Business Unit.
The TDML Working Group was formed in December 1997 with the goal of developing an interchange standard for timing diagram information that would:
Allow interchange between users and producers of timing diagrams using different timing diagram tools, and
Allow incorporation of timing diagram data as a strategic element of the ECIX Pinnacles Component Information Standard (PCIS).
TDML is an open industry standard language for the exchange of interactive timing diagrams. TDML allows exchange of interactive timing diagram information in a standard form. This standard form promotes the sharing and interchange of information between different organizations and allows interested parties to develop tools for generating, editing, and browsing these diagrams.
The standard resulting from this process will be designed for use by ECIX PCIS-compliant datasheets for representation of timing and waveform diagrams that describe component and intellectual property (IP) characteristics. This interchange format will be promoted as an industry-wide standard first through Si2 membership, then formally through the IEEE/IEC. The standard is openly available to companies worldwide for adoption and usage with both commercial and in-house software tools.
TDML is eXtensible Markup Language (XML) compliant. The choice of XML provides the format with several benefits. XML is a highly structured, easily parsed format. Several freely available XML browsers and parsers exist that provide file validity checking and simplify the creation of TDML parsers. The format also provides a method for adding and preserving extra information in a TDML file that has not yet been defined in the standard without breaking the ability of other tools to read the standard TDML information.
TDML is simple to parse because all the information is hierarchically organized and contained between begin and end tags. This structuring of the data and the fact that TDML is a text-based format makes it easy to write scripts to convert waveform data to and from TDML.
Several free XML parsers (with source code) are available, easing the incorporation of support for TDML by EDA vendors and test equipment manufacturers. One benefit of using an XML-based parser is the ability to "validate" TDML files, guaranteeing that a TDML file contains data that meets TDML file format requirements for structure and content. This ability dramatically reduces the chance for the inadvertent creation of incompatible versions of TDML files as a result of a misreading of the TDML specification standard and provides a "confidence check" for TDML users.
To make TDML a truly open standard, it supports a method for tools to ignore yet preserve information that they do not understand. That means that a waveform translator can write TDML files that include voltage threshold levels for generating SPICE files and VHDL and Verilog signal typing information for generating HDL test stimulus. Yet a timing diagram editor can still read the TDML file and ignore the information that it does not understand. Using the same methods, programs can store application-specific information in their TDML files without having to worry about breaking other tools that need to read the basic TDML information contained in the files.
2.0 Overview of TDML Structure
TDML code consists of a number of nested elements. The main element is called timing.diagram. It contains all of the information needed to reconstruct the diagram, arranged into the following sub-elements:
tdml.admin.info:
This section contains information about the tool used to generate the TDML code.
sources:
This section contains the name and direction of signals.
tdml.conn.group:
This section groups of a set of related signals into a bus. It contains the name of the bus and references to member signals.
signal:
This section keeps the signal's waveform structure and clock information (if the signal is a clock) and other related signal information. Note: some signal information is stored in the sources section inside connection elements to maintain compatibility with PCIS.
edge.relationships:
This sections stores instantiations of delays, setups, holds, constraints, measures, and markers. Each of these references data in the cc.list element that defines the actual parameters of the relationship.
annotation:
Text annotations are stored in this section.
view.group:
This section describes a viewable section of the diagram of potential interest to a user.
cc.list:
This section contains the list of parameter data referenced by the instantiations stored in edge.relationships.
alias.list:
This section contains a list of name-value pairs to store aliases (macros) in.
user.defined:
This section contains a list of name-value pairs to store miscellaneous information about the entire timing diagram. These lists can also appear in signal and relationship elements, where they are used to store application-specific data.
XML is a mark-up language that provides a standardized framework with which to define a set of document tags. XML documents look similar to other mark-up language documents like HTML. The following sections provide a brief overview of XML syntax. For more in-depth information about XML and XML DTDs, see http://www.oasis-open.org/cover.
3.1 Structuring data with XML tags
Each object in the TDML code is contained within matching tags. For example, the code excerpt below is one of the first code blocks in a TDML file. The block begins with a <tdml.admin.info> tag and ends with a </tdml.admin.info> tag. The information between these two tags describes the type of program used to generate the TDML file. If a TDML reader does not understand a particular tag, it can ignore the information and continue to read the rest of the file.
<tdml.admin.info>
<tool.info id="X1">
<tool.name id="X2">Timing Diagram Tool</tool.name>
<tool.type id="X3">Timing Diagram Editor</tool.type>
</tool.info>
</tdml.admin.info>
The TDML language is formally defined by an XML Document Type Definition (DTD). The DTD is contained in several files: xml-pcistdml.dtd is the main file, referenced in the DOCTYPE element at the beginning of each TDML file; xml-tdmlbase.ent contains the majority of the TDML language definitions; the rest of the definitions are contained in PCIS DTD files. There are several other .ent files that are used for character lookup tables and other minor tasks.
The complete list of files is as follows:
xml-pcistdml.dtd , iso-amsa.ent, iso-amsb.ent, iso-amsc.ent, iso-amsn.ent, iso-amso.ent, iso-amsr.ent, iso-dia.ent, iso-grk3.ent, iso-lat1.ent, iso-lat2.ent, iso-num.ent, iso-pub.ent, iso-tech.ent, xml-exchange.ent, xml-padmin.ent, xml-pcharset.ent, xml-pinnbase.ent, xml-psources.ent, xml-tdmlbase.ent.
The catalog file is a file that contains links between formal public identifiers and the associated DTD files. Public identifiers are "logical names" that can be converted to physical storage locations where the DTD files are stored.
An XML Document Type Definition (DTD) is a set of rules that can be used to ensure that all documents within a class governed by that DTD are constructed in the same way. DTDs range from completely enforcing (where a specific and highly detailed set of rules is enforced throughout the document structure) to enabling (where as many existing documents as possible are legal under the rules of the DTD). The TDML DTD is an enabling DTD. Each relevant information element has been named and given an identifier, so that different companies can name information of the same type consistently. However very little information is actually required to be identified.
The following sub-sections describe the three main types of objects contained in the TDML DTD: elements, attributes, and entities.
Elements in XML are similar to classes in C++. They can contain both sub-elements and attributes (member variables). They are the core of XML, and define the TDML language. They are found in the .dtd and .ent files mentioned above, and allow XML parsers to understand what is a proper TDML grammar. In the example below, the timing.diagram element contains several sub-elements. Regular expressions are used to define how an element is composed of sub-elements. An asterisk following a sub-element means that the element can appear zero or more times in that place, a plus sign indicates one or more times, and a question mark indicates it may appear once or not at all. Commas separate consecutive sub-elements and parentheses denote a grouping of sub-elements.
Attributes describe properties of an element. An Attribute list, or ATTLIST as it appears in the code, defines the attributes that may be attached to the element. Attributes appear inside of the element's start tag. An attribute defined as #IMPLIED is not required in a TDML document, while a #REQUIRED attribute must be present and have a value. It is up to the application parsing a TDML document to determine the default value of an #IMPLIED attribute.
Entities are the XML equivalent of macros. They are replaced by their value throughout the .dtd file. In the example below, the entity show.atts is replaced with the string in quotes, effectively adding those attributes to the timing.diagram element where it is instantiated.
<!ENTITY % present.atts "line.thickness CDATA #IMPLIED
foreground.color CDATA #IMPLIED
tick.marks %yesorno; #IMPLIED
font.ptr IDREF #IMPLIED">
<!-- SHOW-OR-HIDE ATTRIBUTES -->
<!ENTITY % show.atts "show %yesorno; #IMPLIED
show.uncertainty (MIN|MAX|TYP|ALL)
'ALL' " >
... //more code
<!-- TIMING DIAGRAM -->
<!ELEMENT timing.diagram (tdml.admin.info, (sources?,
tdml.conn.group*),
signal*,
edge.relationships?,
annotation*, view.group?, cc.list*,
alias.list?, user.defined*) >
<!ATTLIST timing.diagram
default.time.units CDATA #REQUIRED
show.delays %yesorno; #IMPLIED
show.holds %yesorno; #IMPLIED
show.samples %yesorno; #IMPLIED
show.setups %yesorno; #IMPLIED
%present.atts;
%show.atts;
%tool.atts;
%info.atts; >
The following sections contain examples of some of the basic elements of TDML documents, along with descriptions of how the elements are related.
4.1 Header, Signal, and Waveform Elements
Figure 1 represents a timing diagram consisting of one signal with a waveform. Explanations for each section are shown:
Figure 1: Header, Signal, and WaveForm
<!DOCTYPE timing.diagram PUBLIC "-//TDML Working Group//DTD XML-PCISTDML.DTD 19990514 Draft 1.1 Timing Diagram Markup Language DTD//EN" "xml-pcistdml.dtd" >
<timing.diagram default.time.units="1e-12 s" show.delays="1" show.holds="1" show.samples="1" show.setups="1" line.thickness="1" show.uncertainty="ALL" delay.rule="first">
<tdml.admin.info>
<tool.info id="X1">
<tool.name id="X2">Timing Diagram Tool</tool.name>
<tool.type id="X3">Timing Diagram Editor</tool.type>
</tool.info>
</tdml.admin.info>
<sources>
<conn.source id="X4">
<connection conn.type="O" id="ID1">
<conn.name id="X5">SIG0</conn.name>
</connection>
</conn.source>
</sources>
<signal id="ID2" show="1" show.grid="0">
<conn.ptr conn.id="ID1">SIG0</conn.ptr>
<waveform id="ID3" locked="0">
<e id="ID3V" driven="1" s="1" te="0" tl="0"></e>
<e driven="1" s="0" te="55000" tl="55000"></e>
<e driven="1" s="1" te="90000" tl="90000"></e>
<e driven="1" s="0" te="140000" tl="140000"></e>
<e te="190000" tl="190000"></e>
</waveform>
</signal>
<view.group>
<view first.signal="ID2" last.signal="ID2" begin.time="0" end.time="259584"></view>
</view.group>
</timing.diagram>
Clocks are a special form of repetitive signal that can be described using period, duty cycle, offset, and edge uncertainty values.
Figure 2: Clocks
<sources>
<conn.source id="X4">
<connection conn.type="O" id="ID1">
<conn.name id="X5">CLK0</conn.name>
</connection>
</conn.source>
</sources>
<signal id="ID2" show="1" show.grid="0" clock="1" inverted="0">
<conn.ptr conn.id="ID1">CLK0</conn.ptr>
<clock.info>
<period>100000</period>
<duty.cycle>50</duty.cycle>
<time.offset>0</time.offset>
<uncertainty.falling>0</uncertainty.falling>
<uncertainty.rising>0</uncertainty.rising>
</clock.info>
<waveform id="ID3" locked="1">
<e te="0" s="0" id="ID3V"></e>
<e driven="1" s="1" te="0" tl="0" id="ID4"></e>
<e driven="1" s="0" te="50000" tl="50000"></e>
<e driven="1" s="1" te="100000" tl="100000"></e>
<e driven="1" s="0" te="150000" tl="150000"></e>
<e driven="1" s="1" te="200000" tl="200000"></e>
<e driven="1" s="0" te="250000" tl="250000"></e>
</waveform>
</signal>
4.3 Timing Parameter Elements (Delay, Setup, Hold, Constraint, Measure)
The diagram in figure 3 adds a delay parameter to the timing diagram of the previous section. The code fragment in figure 3 contains only the sections that are relevant to the discussion of the parameter.
Figure 3: Delay Parameter
<sources>
<conn.source id="X4">
<connection conn.type="O" id="ID1">
<conn.name id="X5">SIG0</conn.name>
</connection>
</conn.source>
</sources>
<signal id="ID2" show="1" show.grid="0">
<conn.ptr conn.id="ID1">SIG0</conn.ptr>
<waveform id="ID3" locked="0">
<e id="ID3V" driven="1" s="1" te="0" tl="0"></e>
<e id="ID4" driven="1" s="0" te="55000" tl="55000"></e>
<e id="ID5" driven="1" s="1" te="65000" tl="75000"></e>
<e driven="1" s="0" te="140000" tl="140000"></e>
<e te="190000" tl="190000"></e>
</waveform>
</signal>
<edge.relationships>
<relationship type="delay" tdml.cc.ptr="ID6" show="1">
<two.edge source.e="ID4" target.e="ID5"></two.edge>
<relationship.label label.type="default">%n v=%mv,%Mv f=%mf,%Mf m=%mm,%Mm d=%md,%Md %c </relationship.label>
</relationship>
</edge.relationships>
<cc.list>
<title id="X6">Parameter Data Table</title>
<tdml.cc id="ID6" static="1" show="1">
<parm id="X7">
<parm.symbol id="X8">D0</parm.symbol>
</parm>
<tdml.value id="X9" value.type="MIN">
<tdml.expression expression.handling="SynaptiCAD">
<expression id="X10">10</expression>
<evaluated.to>10000</evaluated.to>
</tdml.expression>
</tdml.value>
<tdml.value value.type="MAX">
<tdml.expression expression.handling="SynaptiCAD">
<expression id="X11">20</expression>
<evaluated.to>20000</evaluated.to>
</tdml.expression>
</tdml.value>
</tdml.cc>
</cc.list>
Markers are vertical lines in the timing diagram that can compress a section of a timing diagram. The two diagrams show the display of a time marker with and without compression. In the first diagram, one of the D0 delays is not visible because the marker is compressing 20ns of time. The second timing diagram shows a time marker without compression. The TDML code for the marker looks a lot like the code for the delay parameter. Here are a few things to notice:
Figure 4: Markers with and without time compression
<edge.relationships>
<relationship type="marker" tdml.cc.ptr="ID21">
<one.edge></one.edge>
<user.defined><key>DefaultType</key><user.value>Documentation</user.value></user.defined>
<user.defined><key>Type</key><user.value>Timebreak(Curved)</user.value></user.defined>
</relationship>
... //more code
</edge.relationships>
<cc.list>
... //more code
<tdml.cc id="ID21" static="0">
<parm id="X24">
<parm.symbol id="X25">MARK0</parm.symbol>
</parm>
<tdml.value value.type="MIN">
<tdml.expression expression.handling="SynaptiCAD">
<expression id="X26">70</expression>
<evaluated.to>70000.0</evaluated.to>
</tdml.expression>
</tdml.value>
<tdml.value value.type="MAX">
<tdml.expression expression.handling="SynaptiCAD">
<expression id="X27">90</expression>
<evaluated.to>90000.0</evaluated.to>
</tdml.expression>
</tdml.value>
</tdml.cc>
</cc.list>
TDML Annotations are text objects that can be placed anywhere in the waveform portion of a timing diagram. This example shows the different attachments and different styles of annotations available in TDML.
Figure 5: Text Annotations
<annotation x.offset="37964.3" y.offset="-0.0833333"><highlight highlight.pref="bold"><highlight
highlight.pref="italic">TDML Annotations (Text Objects)</highlight></highlight>
</annotation>
<annotation x.offset="0" y.offset="0.0416667" segment.centered="1" e.ptr="ID7"
signal.ptr="ID5">support <super>superscripts</super>and <sub>subscripts</sub>
</annotation>
<annotation x.offset="11612.6" y.offset="-0.125" e.ptr="ID11" signal.ptr="ID9">for realistic databook names like
<highlight highlight.pref="bold">td<sub>HL</sub> </highlight>
</annotation>
5.0 Encoding Information Not Defined in the Standard
TDML includes the capability to add extra information to objects in the timing diagram beyond that currently defined in the standard. This is achieved by using user.defined elements. This mechanism enables timing diagram tools to store additional information which is either unique to the tool or too new to have yet been made part of the standard. The user.defined elements can be entered as sub-elements of timing.diagram, signals, relationship, and tdml.cc. For example, a tool might attach a VhdlType and a VerilogType name-value pair to each signal in a diagram using user-defined elements so that the VHDL and Verilog signal type information is saved in the TDML file. As long as a tool reads and writes user-defined elements, the non-standard information will be preserved even by tools that do not make use of the information (except in the case where two tools use a name-value pair with the same name but different meanings).
While user.defined elements can be used as a short term solution for storing information which has not been assigned tags in the standard, most information of this type should eventually be migrated into the standard and assigned new tags.
To contact the TDML working group about suggestions for additions or changes to future revisions of the TDML standard, visit http://www.si2.org/.
A list of publicly available SGML and XML parsers can be found at http://www.oasis-open.org/cover/publicSW.html.
A list of commercially available parsers can be found at http://www.infotek.no/sgmltool/guide.htm.
SP is an SGML/XML parser written by James Clark. It performs many of the tasks of parsing the TDML file automatically, such as checking it against the specification in the .dtd and .ent files, and tokenizing files that are correct TDML. Information on SP can be found at http://www.jclark.com.