OpenCores
URL https://opencores.org/ocsvn/socgen/socgen/trunk

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [sys/] [workspace] - Diff between revs 97 and 99

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 97 Rev 99
Line 9... Line 9...
#/*          /    TOOL    \                                            */
#/*          /    TOOL    \                                            */
#/*          ==============                                            */
#/*          ==============                                            */
#/*          |            |                                            */
#/*          |            |                                            */
#/*          |____________|                                            */
#/*          |____________|                                            */
#/*                                                                    */
#/*                                                                    */
#/*  Traverse a socgen project and link it                             */
 
#/*                                                                    */
#/*                                                                    */
#/*                                                                    */
#/*                                                                    */
#/*  Author(s):                                                        */
#/*  Author(s):                                                        */
#/*      - John Eaton, jt_eaton@opencores.org                          */
#/*      - John Eaton, jt_eaton@opencores.org                          */
#/*                                                                    */
#/*                                                                    */
#/**********************************************************************/
#/**********************************************************************/
#/*                                                                    */
#/*                                                                    */
#/*    Copyright (C) <2010>                     */
#/*    Copyright (C) <2010-2011>                */
#/*                                                                    */
#/*                                                                    */
#/*  This source file may be used and distributed without              */
#/*  This source file may be used and distributed without              */
#/*  restriction provided that this copyright statement is not         */
#/*  restriction provided that this copyright statement is not         */
#/*  removed from the file and that any derivative work contains       */
#/*  removed from the file and that any derivative work contains       */
#/*  the original copyright notice and the associated disclaimer.      */
#/*  the original copyright notice and the associated disclaimer.      */
Line 44... Line 43...
#/*                                                                    */
#/*                                                                    */
#/**********************************************************************/
#/**********************************************************************/
 
 
 
 
 
 
 
 
 
 
 
 
use Cwd;
use Cwd;
use XML::LibXML;
use XML::LibXML;
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/ We never generate files into a RCS database.                                               */
#/ We never generate files into a RCS database.                                               */
#/                                                                                            */
#/                                                                                            */
#/ A special work area is created that is the image of the database using symbolic links      */
#/ A special work area is created that is the image of the database using symbolic links      */
#/                                                                                            */
#/                                                                                            */
#/*********************************************************************************************/
#/*********************************************************************************************/
 
 
my $root = "projects";
my $root      = "projects/opencores.org";
$home = cwd();
$home = cwd();
my  $prefix = "/work/";
my  $prefix = "/work/";
$lib_comp_sep = "/ip/";
$lib_comp_sep = "/ip/";
$comp_xml_sep = "/rtl/xml/";
$comp_xml_sep = "/rtl/xml/";
$tb_xml_sep = "/sim/xml/";
$tb_xml_sep = "/sim/xml/";
Line 93... Line 88...
   {
   {
   chomp($project);
   chomp($project);
   symlink( "${home}/tools/bin/Makefile.root", "${home}/work/${project}/bin/Makefile.root");
   symlink( "${home}/tools/bin/Makefile.root", "${home}/work/${project}/bin/Makefile.root");
   symlink( "${home}/tools/bin/Makefile",      "${home}/work/${project}/bin/Makefile");
   symlink( "${home}/tools/bin/Makefile",      "${home}/work/${project}/bin/Makefile");
 
 
   $cmd ="chmod 755    ${home}/projects/${project}/bin/* \n";
   $cmd ="chmod 755    ${home}/projects/opencores.org/${project}/bin/* \n";
   if (system($cmd)) {}
   if (system($cmd)) {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   my $path  = "${home}${prefix}${project}/children";
   my $path  = "${home}${prefix}${project}/children";
   mkdir $path,0755          unless( -e $path );
   mkdir $path,0755          unless( -e $path );
 
 
   my $path  = "${home}${prefix}${project}/children/Busdefs";
   my $path  = "${home}${prefix}${project}/children/Busdefs";
   mkdir $path,0755          unless( -e $path );
   mkdir $path,0755          unless( -e $path );
 
 
 
   &link_dir( "${home}/projects/opencores.org/Busdefs",     "${home}${prefix}${project}/children/Busdefs"  );
 
 
   &link_dir( "${home}/projects/Busdefs",     "${home}${prefix}${project}/children/Busdefs"  );
 
 
 
 
 
   my @components = qx(ls  ${home}/work/${project}/ip    );
   my @components = qx(ls  ${home}/work/${project}/ip    );
   foreach my $component (@components)
   foreach my $component (@components)
      {
      {
      chomp($component);
      chomp($component);
 
 
 
 
      $cmd ="./tools/sys/build_geda   $project  $component  /n";
      $cmd ="./tools/sys/build_geda   $project  $component  /n";
      if (system($cmd)) {}
      if (system($cmd)) {}
 
 
      my $parser = XML::LibXML->new();
      my $parser = XML::LibXML->new();
      my $doc    = $parser->parse_file("${home}${prefix}${project}${lib_comp_sep}${component}/soc/design.soc");
      my $doc    = $parser->parse_file("${home}${prefix}${project}${lib_comp_sep}${component}/ip-xact/design.xml");
 
 
         {
 
 
 
         #/*********************************************************************************************/
         #/*********************************************************************************************/
         #/                                                                                            */
         #/                                                                                            */
         #/                                                                                            */
         #/                                                                                            */
         #/*********************************************************************************************/
         #/*********************************************************************************************/
 
 
 
 
 
 
 
 
 
 
 
 
         foreach  my   $i_name ($doc->findnodes("//components/component/name"))
         foreach  my   $i_name ($doc->findnodes("//components/component/name"))
            {
            {
            my($comp_name)  = $i_name ->findnodes('./text()')->to_literal ;
            my($comp_name)  = $i_name ->findnodes('./text()')->to_literal ;
            my($comp_version)  = $i_name ->findnodes('../version/text()')->to_literal ;
            my($comp_version)  = $i_name ->findnodes('../version/text()')->to_literal ;
            my($variant)  = $i_name ->findnodes('../variant/text()')->to_literal ;
 
            $cmd ="./tools/sys/soc_link_child -project $project -lib_comp_sep $lib_comp_sep -component $component -comp_xml_sep $comp_xml_sep -variant $variant $comp_xml_sep /n";
         my $comp_variant = "";
 
         if($comp_version) {$comp_variant = "${comp_name}_${comp_version}"}
 
         else         {$comp_variant = "${comp_name}"}
 
 
 
         $cmd ="./tools/sys/soc_link_child -vendor opencores.org -project $project -lib_comp_sep $lib_comp_sep -component $component -comp_xml_sep $comp_xml_sep -variant $comp_variant $comp_xml_sep /n";
            if (system($cmd)) {}
            if (system($cmd)) {}
            }
            }
 
 
 
 
         foreach  my   $i_name ($doc->findnodes("//testbenchs/testbench/name"))
         foreach  my   $i_name ($doc->findnodes("//testbenchs/testbench/name"))
            {
            {
            my($tb_name)  = $i_name ->findnodes('./text()')->to_literal ;
            my($tb_name)  = $i_name ->findnodes('./text()')->to_literal ;
            my($tb_version)  = $i_name ->findnodes('../version/text()')->to_literal ;
            my($tb_version)  = $i_name ->findnodes('../version/text()')->to_literal ;
            my($tb_variant)  = $i_name ->findnodes('../variant/text()')->to_literal ;
 
            $cmd ="./tools/sys/soc_link_child -project $project -lib_comp_sep $lib_comp_sep -component $component -comp_xml_sep $comp_xml_sep -variant $tb_variant $tb_xml_sep /n";
         my $tb_variant = "";
 
         if($tb_version) {$tb_variant = "${tb_name}_${tb_version}"}
 
         else         {$tb_variant = "${tb_name}"}
 
 
 
         $cmd ="./tools/sys/soc_link_child -vendor opencores.org  -project $project -lib_comp_sep $lib_comp_sep -component $component -comp_xml_sep $comp_xml_sep -variant $tb_variant $tb_xml_sep /n";
            if (system($cmd)) {}
            if (system($cmd)) {}
            }
            }
 
 
 
 
         #/*********************************************************************************************/
         #/*********************************************************************************************/
         #/   link chip files for synthesys                                                            */
         #/   link chip files for synthesys                                                            */
         #/                                                                                            */
         #/                                                                                            */
         #/                                                                                            */
         #/                                                                                            */
         #/                                                                                            */
         #/                                                                                            */
Line 184... Line 169...
            print MAKSYNFILE  "board=${chip_target}\n";
            print MAKSYNFILE  "board=${chip_target}\n";
            print MAKSYNFILE  "Design=${chip_target}_${configuration}\n";
            print MAKSYNFILE  "Design=${chip_target}_${configuration}\n";
            my $path  = "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/target";
            my $path  = "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/target";
            mkdir $path,0755          unless( -e $path );
            mkdir $path,0755          unless( -e $path );
 
 
            &link_dir( "${home}/projects/targets/ip/${chip_target}", "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/target"  );
         &link_dir( "${home}/projects/opencores.org/targets/ip/${chip_target}", "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/target"  );
            &link_dir( "${home}/projects/cde/ip",                            "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/target/lib/ip"  );
         &link_dir( "${home}/projects/opencores.org/cde/ip",                            "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/target/lib/ip"  );
            &link_dir( "${home}/tools/Jtag_programmers/debug",               "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/debug"  );
            &link_dir( "${home}/tools/Jtag_programmers/debug",               "${home}${prefix}${project}${lib_comp_sep}${component}/syn/ise/${chip}/debug"  );
            }
            }
         }
         }
      }
      }
   }
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/*********************************************************************************************/
#/*********************************************************************************************/
 
 
 
 
# recursively map directory information
# recursively map directory information
 
 
sub link_sub {
sub link_sub {
    my $root = shift;
    my $root = shift;
    my $path = shift;
    my $path = shift;
    my $dest = shift;
    my $dest = shift;
    return unless( -e $path );
    return unless( -e $path );
 
 
 
 
    my $dest_path = $path;
    my $dest_path = $path;
      $dest_path =~ s/$root/$dest/;
      $dest_path =~ s/$root/$dest/;
 
 
 
 
    if( -d $path ) {
    if( -d $path ) {
 
 
        mkdir $dest_path,0755;
        mkdir $dest_path,0755;
 
 
        my @contents = (  );
        my @contents = (  );
Line 240... Line 219...
        symlink( "${home}/${path}", $dest_path);
        symlink( "${home}/${path}", $dest_path);
    }
    }
}
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
#/                                                                                            */
Line 290... Line 251...
        closedir( DIR );
        closedir( DIR );
 
 
        # recurse on items in the directory
        # recurse on items in the directory
        foreach my $item ( @contents )          { &link_dir("$src/$item", "$dest/$item" );}
        foreach my $item ( @contents )          { &link_dir("$src/$item", "$dest/$item" );}
 
 
 
 
       }
       }
       else  {symlink( "${src}", "${dest}") unless( -e "${dest}" ); }
       else  {symlink( "${src}", "${dest}") unless( -e "${dest}" ); }
}
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.