\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename readme.info
@settitle Perl SystemC Installation
@c %**end of header

@c DESCRIPTION: TexInfo: DOCUMENT source run through texinfo to produce README file
@c Use 'make README' to produce the output file

@node Top, Copyright, (dir), (dir)

This is the SystemC Perl Package, aka SystemPerl.

@menu
* Copyright::                   
* Description::                 
* Obtaining Distribution::      
* Supported Systems::           
* Installation::                
@end menu

@node Copyright, Description, Top, Top
@section Copyright

This package is Copyright 2001 by Wilson Snyder @email{wsnyder@@wsnyder.org}.

You may distribute under the terms of either the GNU General Public License
or the Artistic License, as specified in the Perl README file, with the
exception that it cannot be placed on a CD-ROM or similar media for commercial
distribution without the prior approval of the author.

This code is provided with no warranty of any kind, and is used entirely at
your own risk.

@node Description, Obtaining Distribution, Copyright, Top
@section Description

This package provides three major sub-packages.  The SystemC::Parser
understands how to read SystemC files, and extract tokens and such,
similar to Verilog::Parser.

SystemC::Netlist builds netlists out of SystemC files.  This allows easy
scripts to determine things such as the hiearchy of SC_MODULEs.  The
netlist database may also be extended to support other languages.

sp_preproc provides extensions to the SystemC language, called the
SystemPerl language.  This allows most of the Tedium to be removed from
SystemC coding, just as the author's /*AUTO*/ comments did for the
Verilog language.  See @samp{man SystemPerl} after installation.

Parsing example:

@example
    package Trialparser;
    @@ISA = qw(SystemC::Parser);

    sub module @{
        my $self = shift;
        my $module = shift;
        print $self->filename.":".$self->lineno().": ";
        print "Contains the module declaration for $module\n";
    @}

    package main;
    my $sp = Trialparser->new();
    $sp->read ("test.sp");
@end example

Netlist example:

@example
  use SystemC::Netlist;

    my $nl = new SystemC::Netlist ();
    foreach my $file ('testnetlist.sp') @{
        $nl->read_file (filename=>$file,
                        strip_autos=>1);
    @}
    $nl->link();
    $nl->autos();
    $nl->lint();
    $nl->exit_if_error();

    foreach my $mod ($nl->modules_sorted) @{
        show_hier ($mod, "  ");
    @}

    sub show_hier @{
        my $mod = shift;
        my $indent = shift;
        print $indent,"Module ",$mod->name,"\n";
        foreach my $cell ($mod->cells_sorted) @{
            show_hier ($cell->submod, $indent."  ".$cell->name."  ");
        @}
    @}
@end example

@node Obtaining Distribution, Supported Systems, Description, Top
@section Obtaining Distribution

The latest version is available at 
@uref{http://www.perl.org/CPAN/}

Download the latest package from that site, and decompress.
@samp{gunzip SystemC_version.tar.gz ; tar xvf SystemC_version.tar}

@node Supported Systems, Installation, Obtaining Distribution, Top
@section Supported Systems

This version of SystemC has been built and tested on:

@itemize @bullet
@item i386-linux
@end itemize

It should run on any system with Perl and a C compiler.

@node Installation,  , Supported Systems, Top
@section Installation

@enumerate
@item
@code{cd} to the directory containing this INSTALL notice.

@item
Type @samp{perl Makefile.PL} to configure SystemC for your system.
(Note this package will probably run slower if you are still using perl
5.005.)

@item
Type @samp{make} to compile SystemC.

@item
Type @samp{make test} to check the compilation.

@item
You can see examples under the test_dir directory.  The *.sp files are
"inline" converted, while the *.h and *.cpp files are expanded from the
.sp files.

@item
Type @samp{make install} to install the programs and any data files and
documentation.

@item
Install @samp{systemperl.h} somewhere in your project's build path.
The best place is probably the $SYSTEMC/include directory.

@end enumerate


