1Vregs::Language(3)    User Contributed Perl Documentation   Vregs::Language(3)
2
3
4

NAME

6       SystemC::Vregs::Language - File processing for various Languages
7

SYNOPSIS

9           use SystemC::Vregs::Language;
10
11           my $fh = SystemC::Vregs::Language->new (filename=>"foo.c",
12                                                   language=>'C',);
13           $fh->comment ("This file is generated automatically\n");
14           $fh->define ("TRUE",1, "Set true");
15           $fh->print ("void main();\n");
16

DESCRIPTION

18       This package creates a file handle with language specific semantics.
19       This allows similar operators to be called, such as comment, for many
20       different file formats.
21
22       The output data is stored in an array and dumped when the file is
23       complete.  This allows the file to only be written if the data changes,
24       to reduce makefile rebuilding.
25

FIELDS

27       These fields may be specified with the new() function.
28
29       filename
30           The filename to write the data to.
31
32       keep_timestamp
33           If true, the file will only be written if the data being written
34           differs from the present file contents.
35
36       language
37           The language for the file.  May be C, Perl, Assembler, TCL, or
38           Verilog.  A new language Foo may be defined by making a
39           SystemC::Vregs::Language::Foo class which is an @ISA of
40           SystemC::Vregs::Language.
41

ACCESSORS

43       language
44           Returns the type of file, for example 'C'.
45

OUTPUT FUNCTIONS

47       comment
48           Output a string with the appropriate comment delimiters.
49
50       comment_pre
51           Output a comment and Doxygen document before-the-fact.
52
53       comment_post
54           Output a comment and Doxygen document after-the-fact.
55
56       include_guard
57           Output a standard #ifndef around the file to prevent multiple
58           inclusion.  Closing the file will automatically add the #endif
59
60       sprint_hex_value
61           Return a string representing the value as a hex number.  Second
62           argument is number of bits.
63
64       preproc
65           Output a preprocessor directive.
66
67       print
68           Output plain text.  This function is called by all other functions.
69           You will probably want to make a inherited class and override this
70           method.
71
72       printf
73           Output printf text.
74

DISTRIBUTION

76       Vregs is part of the <http://www.veripool.org/> free Verilog software
77       tool suite.  The latest version is available from CPAN and from
78       <http://www.veripool.org/vregs>.  /www.veripool.org/>.
79
80       Copyright 2001-2010 by Wilson Snyder.  This package is free software;
81       you can redistribute it and/or modify it under the terms of either the
82       GNU Lesser General Public License Version 3 or the Perl Artistic
83       License Version 2.0.
84

AUTHORS

86       Wilson Snyder <wsnyder@wsnyder.org>
87

SEE ALSO

89       SystemC::Vregs, IO::File
90
91
92
93perl v5.34.0                      2021-07-22                Vregs::Language(3)
Impressum