{"id":193,"date":"2014-10-22T09:15:16","date_gmt":"2014-10-22T17:15:16","guid":{"rendered":"http:\/\/www.beyond-circuits.com\/wordpress\/?page_id=193"},"modified":"2014-10-22T09:15:16","modified_gmt":"2014-10-22T17:15:16","slug":"vpp-pm","status":"publish","type":"page","link":"https:\/\/www.beyond-circuits.com\/wordpress\/vpp-pm\/","title":{"rendered":"Vpp.pm"},"content":{"rendered":"<ul id=\"index\">\n<li><a href=\"#NAME\">NAME<\/a><\/li>\n<li><a href=\"#SYNOPSIS\">SYNOPSIS<\/a><\/li>\n<li><a href=\"#DESCRIPTION\">DESCRIPTION<\/a>\n<ul>\n<li><a href=\"#Variables\">Variables<\/a><\/li>\n<li><a href=\"#Functions\">Functions<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1 id=\"NAME\">NAME<\/h1>\n<p>Vpp &#8211; Verilog Pre-Processor library<\/p>\n<h1 id=\"SYNOPSIS\">SYNOPSIS<\/h1>\n<p>\/\/@ use Vpp;<\/p>\n<h1 id=\"DESCRIPTION\">DESCRIPTION<\/h1>\n<h2 id=\"Variables\">Variables<\/h2>\n<p><b>Vpp<\/b> is a library meant for use with the <b>vpp.pl<\/b> preprocessor. The library defines useful routines for use with <b>vpp.pl<\/b> and also defines some variable corresponding to Verilog predefined tasks so that calls to the tasks do not need to be escaped. For example, since <code>$display<\/code> looks like a variable reference to the preprocessor, <b>Vpp<\/b> defines a variable called display whose value is <b>$display<\/b>. Thus you can say <code>$display<\/code> in your code and that will appear in the output text.<\/p>\n<p>In addition, <b>vpp.pl<\/b> will expand <code>`ifdef<\/code> statements. This is often not desired, so <b>Vpp<\/b> defines <b>$ifdef<\/b>, <b>$else<\/b>, and <b>$endif<\/b> variables. The value of these variables is <b>`ifdef<\/b>, <b>`else<\/b>, and <b>`endif<\/b> respectively. These variables may be used to quote the <b>ifdef<\/b> constructs and prevent expansion by <b>vpp.pl<\/b>.<\/p>\n<h2 id=\"Functions\">Functions<\/h2>\n<dl>\n<dt id=\"log2-val-\"><b>log2<\/b>(<i>val<\/i>)<\/dt>\n<dd>\n<p>Returns the cieling of the log base 2 of <i>val<\/i>.<\/p>\n<p>Here is an example:<\/p>\n<pre><code> \/\/@ my $width = 20;\r\n \/\/@ my $log_width = Vpp::log2($width);\r\n parameter width = $width;\r\n parameter log_width = $log_width;<\/code><\/pre>\n<\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>NAME SYNOPSIS DESCRIPTION Variables Functions NAME Vpp &#8211; Verilog Pre-Processor library SYNOPSIS \/\/@ use Vpp; DESCRIPTION Variables Vpp is a library meant for use with the vpp.pl preprocessor. The library defines useful routines for use with vpp.pl and also defines &hellip; <a href=\"https:\/\/www.beyond-circuits.com\/wordpress\/vpp-pm\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-193","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/pages\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":1,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/pages\/193\/revisions"}],"predecessor-version":[{"id":194,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/pages\/193\/revisions\/194"}],"wp:attachment":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/media?parent=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}