SystemC::Vregs::Rules - Rules for outputting class headers
In a I<package>__rules.pl file: before_file_body (replace => 1, text => "#include \"myinclude.h\"\n",); before_enum_begin ( name => qr/_mine$/, text => " static const bool MINE = true\n", ); after_enum_end ( name => 'Foo', prog => sub { fprint " // enum foo\n"; }, );
This package is used to execute Vregs rule files. These files describe exceptions and additional text to be included in Vregs outputs.
These functions are used to describe a rule. A rule has a number of rule parameters, generally a name which must match, and a text or prog parameter.
Specifies a rule to be invoked at the bottom of any type of file.
Specifies a rule to be invoked at the top of any type of file.
Specifies a rule to be invoked at the bottom of the class.h file.
Specifies a rule to be invoked to produce the #include and other text at the top of the class.h file.
Specifies a rule to be invoked right after the 'class foo {' line.
Specifies a rule to be invoked right before the '}' ending a class declaration.
Specifies a rule to be invoked right after the '}' ending a class declaration.
Specifies a rule to be invoked at the bottom of the defs.h file.
Specifies a rule to be invoked at the top of the defs.h file.
Specifies a rule to be invoked right after the 'enum foo {' line.
Specifies a rule to be invoked right before the '}' ending a enum declaration.
Specifies a rule to be invoked right after the '}' ending a enum declaration.
Must be either a string which must match for the rule to be invoked, or a regexp reference (qr/regexp/) which if matches will invoke the rule.
Generally rules are cumulative, in that defining additional rules will place additional cases to be tested. With the replace flag, the rule will replace all existing rules, including default rules. This is generally useful for replacing the default #include section with the before_file_body rule.
A text string to output to the file.
A reference to a subroutine that generates the code for the file.
These functions and variables are useful when writing prog=> subroutines.
Reference to a SystemC::Vregs::Enum or SystemC::Vregs::Type, as appropriate. This can be used to get information about the thing to be printed, for example $self->{name} is the name of the object, and $self->{attributes}{foo} checks for a specific attribute.
Print to the file.
Formatted print to the file.
Vregs is part of the http://www.veripool.org/ free Verilog software tool suite. The latest version is available from CPAN and from http://www.veripool.org/vregs. /www.veripool.org/>.
Copyright 2001-2010 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
Wilson Snyder <wsnyder@wsnyder.org>
vreg, SystemC::Vregs
To install SystemC::Vregs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SystemC::Vregs
CPAN shell
perl -MCPAN -e shell install SystemC::Vregs
For more information on module installation, please visit the detailed CPAN module installation guide.