<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.verific.com/faq/index.php?action=history&amp;feed=atom&amp;title=How_to_get_enums_from_Verilog_parsetree</id>
		<title>How to get enums from Verilog parsetree - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.verific.com/faq/index.php?action=history&amp;feed=atom&amp;title=How_to_get_enums_from_Verilog_parsetree"/>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=How_to_get_enums_from_Verilog_parsetree&amp;action=history"/>
		<updated>2026-05-02T12:45:29Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=How_to_get_enums_from_Verilog_parsetree&amp;diff=293&amp;oldid=prev</id>
		<title>Hoa: Created page with &quot;'''Q: From the parsetree, how can I get the enums declared in a module?'''  You can use the following code snippet:    VeriModule *mod = ... ;   VeriScope *scope = mod-&gt;GetSco...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=How_to_get_enums_from_Verilog_parsetree&amp;diff=293&amp;oldid=prev"/>
				<updated>2017-06-14T17:36:23Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Q: From the parsetree, how can I get the enums declared in a module?&amp;#039;&amp;#039;&amp;#039;  You can use the following code snippet:    VeriModule *mod = ... ;   VeriScope *scope = mod-&amp;gt;GetSco...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Q: From the parsetree, how can I get the enums declared in a module?'''&lt;br /&gt;
&lt;br /&gt;
You can use the following code snippet:&lt;br /&gt;
&lt;br /&gt;
  VeriModule *mod = ... ;&lt;br /&gt;
  VeriScope *scope = mod-&amp;gt;GetScope() ;&lt;br /&gt;
  Set ids(POINTER_HASH) ;&lt;br /&gt;
  if (scope) scope-&amp;gt;GetDeclaredIds(ids) ;&lt;br /&gt;
  SetIter si ;&lt;br /&gt;
  VeriIdDef *id ;&lt;br /&gt;
  FOREACH_SET_ITEM(&amp;amp;ids, si, &amp;amp;id) {&lt;br /&gt;
    if (!id-&amp;gt;IsEnumId()) continue ;&lt;br /&gt;
    // Here id is an enum id/literal.&lt;br /&gt;
    // id-&amp;gt;GetInitialValue() returns the use specified initial value of the enum id&lt;br /&gt;
    // If there is no value specified in the input RTL, you get a NULL returned.&lt;br /&gt;
  }&lt;/div&gt;</summary>
		<author><name>Hoa</name></author>	</entry>

	</feed>