QuestaSim Coverage

QuestaSim’s code coverage report XML, as vcover report -xml -details or coverage report -xml -details writes it.

Read by pyEDAA.Reports.CodeCoverage.QuestaSim.Document - see QuestaSim coverage report XML.

Questa states neither a namespace nor a format version, and publishes no XML Schema. The schema is built from three sources:

  • A report of Questa 2026.2, written with vcover report -xml -details -code bcesf: the root’s attributes questa_version and command; lines, byInstance, <instanceData> with <sourceTable> and <fileMap>, the coverage statistics <branches>, <states>, <transitions> and <statements>, and the coverage items <stmt>, <if>/<ielem>, <case>/<celem>, <state> and <trans>.

  • The example of Questa’s User’s Manual and a report of Questa 2023.3 by design unit: byDU, <DuData>.

  • ModelSim’s DTD covreport.dtd for the elements no Questa report shows yet: the summary records, <fileData>, and the details of conditions, expressions and toggles.

A scope’s <sourceTable> comes first; its statistics and coverage items follow in any order - Questa 2026.2 writes them in another order than the DTD -, except a finite state machine’s: <states>, <transitions>, then each <state> and each <trans>. A file number must be one of the scope’s source table; <state> and <trans> name none. Attributes are typed: counts are non-negative integers, line numbers positive, a percentage is a decimal from 0 to 100. Functional coverage reports (-cvg, -directive) aren’t covered.

Download

QuestaSim-Coverage.xsd (13.6 kiB)

Validate a report

xmllint --schema QuestaSim-Coverage.xsd --noout CoverageReport.xml

Source

  1<?xml version="1.0" encoding="UTF-8"?>
  2<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  3	<xs:annotation>
  4		<xs:documentation>
  5			QuestaSim code coverage report XML, as written by 'vcover report -xml -details' or 'coverage report -xml'.
  6
  7			Questa states neither a namespace nor a format version. The schema is built from three sources:
  8
  9			* a report of Questa 2026.2 written with 'vcover report -xml -details -code bcesf': root attributes
 10			  'questa_version' and 'command'; 'lines', 'byInstance', 'instanceData' with 'sourceTable', 'fileMap', the
 11			  statistics 'branches', 'states', 'transitions' and 'statements' - in this order, which contradicts the DTD -,
 12			  'stmt', 'if'/'ielem', 'case'/'celem', and the states and transitions of finite state machines,
 13			  'state'/'trans', which name no file number;
 14			* the Questa User's Manual and a report of Questa 2023.3 (by design unit): 'byDU', 'DuData';
 15			* ModelSim's DTD 'covreport.dtd' for the elements no Questa sample shows yet: the summary records, 'fileData',
 16			  the details of conditions, expressions and toggles.
 17
 18			A scope's 'sourceTable' comes first; its statistics and details follow in any order, except a finite state
 19			machine's: 'states', 'transitions', then each 'state' and each 'trans'. Functional coverage reports
 20			('functional_coverage_report') aren't covered.
 21		</xs:documentation>
 22	</xs:annotation>
 23
 24	<xs:simpleType name="Flag">
 25		<xs:restriction base="xs:string">
 26			<xs:enumeration value="0"/>
 27			<xs:enumeration value="1"/>
 28		</xs:restriction>
 29	</xs:simpleType>
 30
 31	<xs:simpleType name="Percent">
 32		<xs:restriction base="xs:decimal">
 33			<xs:minInclusive value="0"/>
 34			<xs:maxInclusive value="100"/>
 35		</xs:restriction>
 36	</xs:simpleType>
 37
 38	<xs:simpleType name="LineNumber">
 39		<xs:restriction base="xs:positiveInteger"/>
 40	</xs:simpleType>
 41
 42	<!-- Coverage statistics of a scope or a summary record: items, hit items, percentage. -->
 43	<xs:complexType name="Statistics">
 44		<xs:attribute name="active"  type="xs:nonNegativeInteger" use="required"/>
 45		<xs:attribute name="hits"    type="xs:nonNegativeInteger" use="required"/>
 46		<xs:attribute name="percent" type="Percent"               use="required"/>
 47	</xs:complexType>
 48
 49	<!-- A coverage item with a truth table: a condition or an expression (DTD only). -->
 50	<xs:complexType name="TableItem">
 51		<xs:sequence>
 52			<xs:element ref="table" minOccurs="0"/>
 53		</xs:sequence>
 54		<xs:attribute name="active"  type="xs:nonNegativeInteger" use="required"/>
 55		<xs:attribute name="fn"      type="xs:nonNegativeInteger"/>
 56		<xs:attribute name="hits"    type="xs:nonNegativeInteger" use="required"/>
 57		<xs:attribute name="ln"      type="LineNumber"            use="required"/>
 58		<xs:attribute name="percent" type="Percent"               use="required"/>
 59		<xs:attribute name="st"      type="xs:positiveInteger"    use="required"/>
 60	</xs:complexType>
 61
 62	<!-- The items of a scope: statistics and details, in any order. -->
 63	<xs:group name="ScopeItems">
 64		<xs:sequence>
 65			<xs:element ref="sourceTable" minOccurs="0"/>
 66			<xs:choice minOccurs="0" maxOccurs="unbounded">
 67				<xs:element name="statements"    type="Statistics"/>
 68				<xs:element name="branches"      type="Statistics"/>
 69				<xs:element name="conditions"    type="Statistics"/>
 70				<xs:element name="expressions"   type="Statistics"/>
 71				<xs:group ref="StateMachines"/>
 72				<xs:element name="toggleSummary" type="Statistics"/>
 73				<xs:element ref="stmt"/>
 74				<xs:element ref="if"/>
 75				<xs:element ref="case"/>
 76				<xs:element name="condition"     type="TableItem"/>
 77				<xs:element name="expression"    type="TableItem"/>
 78				<xs:element ref="tog"/>
 79				<xs:element ref="toge"/>
 80				<xs:element ref="togenum"/>
 81			</xs:choice>
 82		</xs:sequence>
 83	</xs:group>
 84
 85	<!-- The finite state machines of a scope: their statistics, then their states and transitions. -->
 86	<xs:group name="StateMachines">
 87		<xs:sequence>
 88			<xs:element name="states"      type="Statistics"/>
 89			<xs:element name="transitions" type="Statistics"/>
 90			<xs:element ref="state" minOccurs="0" maxOccurs="unbounded"/>
 91			<xs:element ref="trans" minOccurs="0" maxOccurs="unbounded"/>
 92		</xs:sequence>
 93	</xs:group>
 94
 95	<!-- The statistics of a summary record (DTD only). -->
 96	<xs:group name="SummaryItems">
 97		<xs:sequence>
 98			<xs:element name="statements"    type="Statistics" minOccurs="0"/>
 99			<xs:element name="branches"      type="Statistics" minOccurs="0"/>
100			<xs:element name="conditions"    type="Statistics" minOccurs="0"/>
101			<xs:element name="expressions"   type="Statistics" minOccurs="0"/>
102			<xs:element name="toggleSummary" type="Statistics" minOccurs="0"/>
103		</xs:sequence>
104	</xs:group>
105
106	<xs:element name="coverage_report">
107		<xs:complexType>
108			<xs:sequence>
109				<xs:element ref="code_coverage_report"/>
110			</xs:sequence>
111			<xs:attribute name="questa_version" type="xs:string"/>
112			<xs:attribute name="command"        type="xs:string"/>
113		</xs:complexType>
114	</xs:element>
115
116	<xs:element name="code_coverage_report">
117		<xs:complexType>
118			<xs:sequence>
119				<xs:element ref="summaryByFile"     minOccurs="0"/>
120				<xs:element ref="summaryByInstance" minOccurs="0"/>
121				<xs:choice>
122					<xs:element ref="DuData"       minOccurs="0" maxOccurs="unbounded"/>
123					<xs:element ref="fileData"     minOccurs="0" maxOccurs="unbounded"/>
124					<xs:element ref="instanceData" minOccurs="0" maxOccurs="unbounded"/>
125				</xs:choice>
126			</xs:sequence>
127			<xs:attribute name="byDU"       type="Flag"/>
128			<xs:attribute name="byFile"     type="Flag"/>
129			<xs:attribute name="byInstance" type="Flag"/>
130			<xs:attribute name="lines"      type="Flag"/>
131			<xs:attribute name="totals"     type="Flag"/>
132		</xs:complexType>
133	</xs:element>
134
135	<xs:element name="summaryByFile">
136		<xs:complexType>
137			<xs:group ref="SummaryItems"/>
138			<xs:attribute name="files" type="xs:nonNegativeInteger" use="required"/>
139		</xs:complexType>
140	</xs:element>
141
142	<xs:element name="summaryByInstance">
143		<xs:complexType>
144			<xs:group ref="SummaryItems"/>
145			<xs:attribute name="instances" type="xs:nonNegativeInteger" use="required"/>
146		</xs:complexType>
147	</xs:element>
148
149	<xs:element name="instanceData">
150		<xs:complexType>
151			<xs:group ref="ScopeItems"/>
152			<xs:attribute name="path" type="xs:string" use="required"/>
153			<xs:attribute name="du"   type="xs:string" use="required"/>
154			<xs:attribute name="sec"  type="xs:string"/>
155		</xs:complexType>
156		<xs:key name="InstanceFileNumber">
157			<xs:selector xpath="sourceTable/fileMap"/>
158			<xs:field xpath="@fn"/>
159		</xs:key>
160		<xs:keyref name="InstanceFileReference" refer="InstanceFileNumber">
161			<xs:selector xpath="stmt|if/ielem|case/celem|condition|expression"/>
162			<xs:field xpath="@fn"/>
163		</xs:keyref>
164	</xs:element>
165
166	<xs:element name="DuData">
167		<xs:complexType>
168			<xs:group ref="ScopeItems"/>
169			<xs:attribute name="du"  type="xs:string" use="required"/>
170			<xs:attribute name="sec" type="xs:string"/>
171		</xs:complexType>
172		<xs:key name="DesignUnitFileNumber">
173			<xs:selector xpath="sourceTable/fileMap"/>
174			<xs:field xpath="@fn"/>
175		</xs:key>
176		<xs:keyref name="DesignUnitFileReference" refer="DesignUnitFileNumber">
177			<xs:selector xpath="stmt|if/ielem|case/celem|condition|expression"/>
178			<xs:field xpath="@fn"/>
179		</xs:keyref>
180	</xs:element>
181
182	<xs:element name="fileData">
183		<xs:complexType>
184			<xs:group ref="ScopeItems"/>
185			<xs:attribute name="path" type="xs:string" use="required"/>
186		</xs:complexType>
187		<xs:key name="FileFileNumber">
188			<xs:selector xpath="sourceTable/fileMap"/>
189			<xs:field xpath="@fn"/>
190		</xs:key>
191		<xs:keyref name="FileFileReference" refer="FileFileNumber">
192			<xs:selector xpath="stmt|if/ielem|case/celem|condition|expression"/>
193			<xs:field xpath="@fn"/>
194		</xs:keyref>
195	</xs:element>
196
197	<xs:element name="sourceTable">
198		<xs:complexType>
199			<xs:sequence>
200				<xs:element ref="fileMap" maxOccurs="unbounded"/>
201			</xs:sequence>
202			<xs:attribute name="files" type="xs:nonNegativeInteger" use="required"/>
203		</xs:complexType>
204	</xs:element>
205
206	<xs:element name="fileMap">
207		<xs:complexType>
208			<xs:attribute name="fn"   type="xs:nonNegativeInteger" use="required"/>
209			<xs:attribute name="path" type="xs:string"             use="required"/>
210		</xs:complexType>
211	</xs:element>
212
213	<xs:element name="stmt">
214		<xs:complexType>
215			<xs:attribute name="fn"   type="xs:nonNegativeInteger"/>
216			<xs:attribute name="ln"   type="LineNumber"            use="required"/>
217			<xs:attribute name="st"   type="xs:positiveInteger"    use="required"/>
218			<xs:attribute name="hits" type="xs:nonNegativeInteger" use="required"/>
219		</xs:complexType>
220	</xs:element>
221
222	<!-- A state of a finite state machine: its name, line and how often it was entered. -->
223	<xs:element name="state">
224		<xs:complexType>
225			<xs:attribute name="ln"    type="LineNumber"            use="required"/>
226			<xs:attribute name="hits"  type="xs:nonNegativeInteger" use="required"/>
227			<xs:attribute name="state" type="xs:string"             use="required"/>
228		</xs:complexType>
229	</xs:element>
230
231	<!-- A transition of a finite state machine: its number, line, how often it was taken, and 'from -> to'. -->
232	<xs:element name="trans">
233		<xs:complexType>
234			<xs:attribute name="ln"    type="LineNumber"            use="required"/>
235			<xs:attribute name="tid"   type="xs:nonNegativeInteger" use="required"/>
236			<xs:attribute name="hits"  type="xs:nonNegativeInteger" use="required"/>
237			<xs:attribute name="state" type="xs:string"             use="required"/>
238		</xs:complexType>
239	</xs:element>
240
241	<!-- An if statement: its branches (if, elsif, else or the implicit AllFalse branch), how often each was taken. -->
242	<xs:element name="if">
243		<xs:complexType>
244			<xs:sequence>
245				<xs:element ref="ielem" maxOccurs="unbounded"/>
246			</xs:sequence>
247			<xs:attribute name="active"  type="xs:positiveInteger"    use="required"/>
248			<xs:attribute name="hasElse" type="Flag"                  use="required"/>
249			<xs:attribute name="hits"    type="xs:nonNegativeInteger" use="required"/>
250			<xs:attribute name="percent" type="Percent"               use="required"/>
251		</xs:complexType>
252	</xs:element>
253
254	<xs:element name="ielem">
255		<xs:complexType>
256			<xs:attribute name="false" type="xs:nonNegativeInteger" use="required"/>
257			<xs:attribute name="fn"    type="xs:nonNegativeInteger"/>
258			<xs:attribute name="ln"    type="LineNumber"            use="required"/>
259			<xs:attribute name="st"    type="xs:positiveInteger"    use="required"/>
260			<xs:attribute name="true"  type="xs:nonNegativeInteger" use="required"/>
261		</xs:complexType>
262	</xs:element>
263
264	<!-- A case statement: its case items, and how often each was taken. -->
265	<xs:element name="case">
266		<xs:complexType>
267			<xs:sequence>
268				<xs:element ref="celem" maxOccurs="unbounded"/>
269			</xs:sequence>
270			<xs:attribute name="active"  type="xs:nonNegativeInteger" use="required"/>
271			<xs:attribute name="hits"    type="xs:nonNegativeInteger" use="required"/>
272			<xs:attribute name="percent" type="Percent"               use="required"/>
273		</xs:complexType>
274	</xs:element>
275
276	<xs:element name="celem">
277		<xs:complexType>
278			<xs:attribute name="fn"   type="xs:nonNegativeInteger"/>
279			<xs:attribute name="hits" type="xs:nonNegativeInteger" use="required"/>
280			<xs:attribute name="ln"   type="LineNumber"            use="required"/>
281			<xs:attribute name="st"   type="xs:positiveInteger"    use="required"/>
282		</xs:complexType>
283	</xs:element>
284
285	<!-- Truth table of a condition or an expression (DTD only). -->
286	<xs:element name="table">
287		<xs:complexType>
288			<xs:sequence>
289				<xs:element ref="col" maxOccurs="unbounded"/>
290				<xs:element ref="row" maxOccurs="unbounded"/>
291			</xs:sequence>
292			<xs:attribute name="cols"    type="xs:nonNegativeInteger" use="required"/>
293			<xs:attribute name="rows"    type="xs:nonNegativeInteger" use="required"/>
294			<xs:attribute name="unknown" type="xs:string"             use="required"/>
295		</xs:complexType>
296	</xs:element>
297
298	<xs:element name="col">
299		<xs:complexType>
300			<xs:attribute name="i"     type="xs:nonNegativeInteger" use="required"/>
301			<xs:attribute name="label" type="xs:string"             use="required"/>
302		</xs:complexType>
303	</xs:element>
304
305	<xs:element name="row">
306		<xs:complexType>
307			<xs:attribute name="body" type="xs:string"             use="required"/>
308			<xs:attribute name="hits" type="xs:nonNegativeInteger" use="required"/>
309			<xs:attribute name="j"    type="xs:nonNegativeInteger" use="required"/>
310		</xs:complexType>
311	</xs:element>
312
313	<!-- Toggle details (DTD only). -->
314	<xs:element name="tog">
315		<xs:complexType>
316			<xs:attribute name="name" type="xs:string"             use="required"/>
317			<xs:attribute name="c0"   type="xs:nonNegativeInteger"/>
318			<xs:attribute name="c1"   type="xs:nonNegativeInteger"/>
319		</xs:complexType>
320	</xs:element>
321
322	<xs:element name="toge">
323		<xs:complexType>
324			<xs:attribute name="name"   type="xs:string"             use="required"/>
325			<xs:attribute name="c1H_0L" type="xs:nonNegativeInteger"/>
326			<xs:attribute name="c0L_1H" type="xs:nonNegativeInteger"/>
327			<xs:attribute name="c0L_Z"  type="xs:nonNegativeInteger"/>
328			<xs:attribute name="cZ_0L"  type="xs:nonNegativeInteger"/>
329			<xs:attribute name="c1H_Z"  type="xs:nonNegativeInteger"/>
330			<xs:attribute name="cZ_1H"  type="xs:nonNegativeInteger"/>
331		</xs:complexType>
332	</xs:element>
333
334	<!-- An enumerated signal: Questa writes one attribute per enumeration value, ModelSim's DTD child elements. -->
335	<xs:element name="togenum">
336		<xs:complexType>
337			<xs:sequence>
338				<xs:element ref="togenumval" minOccurs="0" maxOccurs="unbounded"/>
339			</xs:sequence>
340			<xs:attribute name="name" type="xs:string" use="required"/>
341			<xs:anyAttribute processContents="skip"/>
342		</xs:complexType>
343	</xs:element>
344
345	<xs:element name="togenumval">
346		<xs:complexType>
347			<xs:attribute name="name" type="xs:string"             use="required"/>
348			<xs:attribute name="c"    type="xs:nonNegativeInteger"/>
349		</xs:complexType>
350	</xs:element>
351</xs:schema>