URL
https://opencores.org/ocsvn/socgen/socgen/trunk
Subversion Repositories socgen
Compare Revisions
- This comparison shows the changes necessary to convert path
/socgen/trunk/tools/bin
- from Rev 84 to Rev 85
- ↔ Reverse comparison
Rev 84 → Rev 85
/soc_link_1
0,0 → 1,423
eval 'exec `which perl` -S $0 ${1+"$@"}' |
if 0; |
|
#/**********************************************************************/ |
#/* */ |
#/* ------- */ |
#/* / SOC \ */ |
#/* / GEN \ */ |
#/* / TOOL \ */ |
#/* ============== */ |
#/* | | */ |
#/* |____________| */ |
#/* */ |
#/* Traverse a socgen project and link it */ |
#/* */ |
#/* */ |
#/* Author(s): */ |
#/* - John Eaton, jt_eaton@opencores.org */ |
#/* */ |
#/**********************************************************************/ |
#/* */ |
#/* Copyright (C) <2010> <Ouabache Design Works> */ |
#/* */ |
#/* This source file may be used and distributed without */ |
#/* restriction provided that this copyright statement is not */ |
#/* removed from the file and that any derivative work contains */ |
#/* the original copyright notice and the associated disclaimer. */ |
#/* */ |
#/* This source file is free software; you can redistribute it */ |
#/* and/or modify it under the terms of the GNU Lesser General */ |
#/* Public License as published by the Free Software Foundation; */ |
#/* either version 2.1 of the License, or (at your option) any */ |
#/* later version. */ |
#/* */ |
#/* This source is distributed in the hope that it will be */ |
#/* useful, but WITHOUT ANY WARRANTY; without even the implied */ |
#/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */ |
#/* PURPOSE. See the GNU Lesser General Public License for more */ |
#/* details. */ |
#/* */ |
#/* You should have received a copy of the GNU Lesser General */ |
#/* Public License along with this source; if not, download it */ |
#/* from http://www.opencores.org/lgpl.shtml */ |
#/* */ |
#/**********************************************************************/ |
|
|
|
|
|
|
use Cwd; |
use XML::LibXML; |
|
|
|
|
my $root = "projects"; |
$home = cwd(); |
|
my $project = $ARGV[0]; |
my $component = $ARGV[1]; |
|
|
|
|
my $prefix = "work/${project}"; |
$root = "bench"; |
$dest = "work/${project}/ip/${component}/sim/bench"; |
&link_sub( $root,$root, $dest ); |
$root = "lib"; |
$dest = "work/${project}/ip/${component}/sim/lib"; |
&link_sub( $root,$root, $dest ); |
|
#/*********************************************************************************************/ |
#/ */ |
#/ Every component needs a rtl/verilog,gen/sim and /gen/syn subdirectory */ |
#/ */ |
#/*********************************************************************************************/ |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/verilog"; |
mkdir $path,0755 unless( -e $path ); |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/gen"; |
mkdir $path,0755 unless( -e $path ); |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/gen/sim"; |
mkdir $path,0755 unless( -e $path ); |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/gen/syn"; |
mkdir $path,0755 unless( -e $path ); |
|
|
print "Start component $component \n"; |
my $prefix = "work/${project}"; |
|
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file("${home}/${prefix}/ip/${component}/soc/design.soc"); |
|
{ |
|
#/*********************************************************************************************/ |
#/ link chip files */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
print "Linking targets for $project $component \n"; |
foreach my $i_name ($doc->findnodes("//chips/chip/name")) |
{ |
my($chip) = $i_name ->findnodes('./text()')->to_literal ; |
my($chip_target) = $i_name ->findnodes('../target/text()')->to_literal ; |
my($configuration) = $i_name ->findnodes('../configuration/text()')->to_literal ; |
my($variant) = $i_name ->findnodes('../variant/text()')->to_literal ; |
|
$outfile ="${home}/${prefix}/ip/${component}/syn/${chip}/def_file"; |
open DEFSYNFILE,">$outfile" or die "unable to open $outfile"; |
print DEFSYNFILE "\`define MODULE_NAME ${chip_target}_${configuration}\n"; |
|
$outfile ="${home}/${prefix}/ip/${component}/syn/${chip}/Makefile"; |
open MAKSYNFILE,">$outfile" or die "unable to open $outfile"; |
|
print MAKSYNFILE "include ../../../../bin/Makefile.root\n"; |
print MAKSYNFILE "include ./target/Makefile.brd\n"; |
print MAKSYNFILE "Design=${chip_target}_${configuration}\n"; |
|
my $path = "${home}/${prefix}/ip/${component}/syn/${chip}/target"; |
mkdir $path,0755 unless( -e $path ); |
|
&link_dir( "${home}/targets/${chip_target}", "${home}/${prefix}/ip/${component}/syn/${chip}/target" ); |
&link_dir( "${home}/lib", "${home}/${prefix}/ip/${component}/syn/${chip}/target/lib/syn" ); |
|
} |
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
print "Linking modules for $project $component \n"; |
foreach my $i_name ($doc->findnodes("//module/name")) |
{ |
my($child) = $i_name ->findnodes('./text()')->to_literal ; |
my($child_parent) = $i_name ->findnodes('../component/text()')->to_literal ; |
my($child_family) = $i_name ->findnodes('../project/text()')->to_literal ; |
|
if( ($child_family ne $project) & ($child_family ne "cde")) |
{ &link_child( $project,$child_parent, $child_family ); } |
} |
print "\n"; |
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
|
|
sub link_child { |
my $project = shift; |
my $child_parent = shift; |
my $child_family = shift; |
|
my $path = "work/${project}/children"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "work/${project}/children/${child_family}"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "work/${project}/children/${child_family}/bin"; |
mkdir $path,0755 unless( -e $path ); |
$root = "${home}/projects/${child_family}/bin"; |
$dest = "${home}/work/${project}/children/${child_family}/bin"; |
&link_dir( "$root", "$dest" ); |
symlink( "${home}/tools/bin/Makefile.root", "${home}/work/${project}/children/${child_family}/bin/Makefile.root"); |
symlink( "${home}/tools/bin/Makefile", "${home}/work/${project}/children/${child_family}/bin/Makefile"); |
my $path = "work/${project}/children/${child_family}/sw"; |
mkdir $path,0755 unless( -e $path ); |
$root = "${home}/projects/${child_family}/sw"; |
$dest = "${home}/work/${project}/children/${child_family}/sw"; |
&link_dir( "$root", "$dest" ); |
my $path = "work/${project}/children/${child_family}/ip"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "work/${project}/children/${child_family}/ip/${child_parent}"; |
mkdir $path,0755 unless( -e $path ); |
$root = "${home}/projects/${child_family}/ip/${child_parent}"; |
$dest = "${home}/work/${project}/children/${child_family}/ip/${child_parent}"; |
&link_dir( "$root", "$dest" ); |
my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen/sim"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen/syn"; |
mkdir $path,0755 unless( -e $path ); |
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
|
# recursively map directory information |
|
sub link_sub { |
my $root = shift; |
my $path = shift; |
my $dest = shift; |
return unless( -e $path ); |
|
|
my $dest_path = $path; |
$dest_path =~ s/$root/$dest/; |
|
|
if( -d $path ) { |
|
mkdir $dest_path,0755; |
|
my @contents = ( ); |
opendir( DIR, $path ); |
while( my $item = readdir( DIR )) { |
next if( $item eq '.' or $item eq '..' or $item eq '.svn' ); |
push( @contents, $item ); |
} |
closedir( DIR ); |
|
# recurse on items in the directory |
foreach my $item ( @contents ) { &link_sub($root, "$path/$item", $dest );} |
|
|
} else { |
|
symlink( "${home}/${path}", $dest_path); |
} |
} |
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
# recursively map directory information |
|
sub link_dir { |
my $src = shift; |
my $dest = shift; |
return unless( -e $src ); |
|
if( -d $src ) |
{ |
|
mkdir $dest,0755; |
my @contents = ( ); |
opendir( DIR, $src ); |
while( my $item = readdir( DIR )) |
{ |
next if( $item eq '.' or $item eq '..' or $item eq '.svn' ); |
push( @contents, $item ); |
} |
closedir( DIR ); |
|
# recurse on items in the directory |
foreach my $item ( @contents ) { &link_dir("$src/$item", "$dest/$item" );} |
|
|
} |
else {symlink( "${src}", "${dest}") unless( -e "${dest}" ); } |
} |
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
sub trim_sort { |
my @output_files = @_; |
my %trim = (); |
foreach $descriptor (@output_files) { $trim{$descriptor} = 1; } |
my @k = keys %trim; |
@output_files = sort(sort @k); |
return(@output_files); |
} |
eval 'exec `which perl` -S $0 ${1+"$@"}' |
if 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
sub parse_hier |
{ |
my @params = @_; |
my $variant = pop(@params); |
my $component = pop(@params); |
my $project = pop(@params); |
|
$home = cwd(); |
$cde="cde"; |
|
|
|
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file("${home}/projects/${project}/ip/${component}/rtl/xml/${variant}.xml"); |
|
foreach my $comp ($doc->findnodes('//spirit:component')) |
{ |
|
my($vendor) = $comp->findnodes('./spirit:vendor/text()')->to_literal ; |
my($library) = $comp->findnodes('./spirit:library/text()')->to_literal ; |
my($name) = $comp->findnodes('./spirit:name/text()')->to_literal ; |
my($version) = $comp->findnodes('./spirit:version/text()')->to_literal ; |
|
my $variant = ""; |
if($version) {$variant = "${name}_${version}"} |
else {$variant = "${name}"} |
|
#/*********************************************************************************************/ |
#/ */ |
#/ Create filelists for simulation, code coverage, linting and synthesis */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
push(@filelist_hier,"::${library}::${name}::${variant}::"); |
|
foreach my $i_name ($doc->findnodes("//spirit:component/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) |
{ |
my($library_name) = $i_name ->findnodes('../spirit:componentRef/spirit:library/text()')->to_literal ; |
my($component_name) = $i_name ->findnodes('../spirit:componentRef/spirit:name/text()')->to_literal ; |
my($version_name) = $i_name ->findnodes('../spirit:componentRef/spirit:version/text()')->to_literal ; |
|
my $variant_name = ""; |
if($version_name) {$variant_name = "${component_name}_${version_name}";} |
else {$variant_name = "${component_name}";} |
|
if($library_name ne "cde") |
{ |
my @filelist_sub = parse_hier("$library_name","$component_name","$variant_name"); |
foreach $line (@filelist_sub) { push(@filelist_hier,"$line"); } |
} |
else { push(@filelist_hier,"::${library_name}::${component_name}::${variant_name}::"); } |
} |
} |
@filelist_hier = trim_sort(@filelist_hier); |
return(@filelist_hier); |
} |
soc_link_1
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: soc_link_2
===================================================================
--- soc_link_2 (nonexistent)
+++ soc_link_2 (revision 85)
@@ -0,0 +1,383 @@
+eval 'exec `which perl` -S $0 ${1+"$@"}'
+ if 0;
+
+#/**********************************************************************/
+#/* */
+#/* ------- */
+#/* / SOC \ */
+#/* / GEN \ */
+#/* / TOOL \ */
+#/* ============== */
+#/* | | */
+#/* |____________| */
+#/* */
+#/* Traverse a socgen project and link it */
+#/* */
+#/* */
+#/* Author(s): */
+#/* - John Eaton, jt_eaton@opencores.org */
+#/* */
+#/**********************************************************************/
+#/* */
+#/* Copyright (C) <2010> */
+#/* */
+#/* This source file may be used and distributed without */
+#/* restriction provided that this copyright statement is not */
+#/* removed from the file and that any derivative work contains */
+#/* the original copyright notice and the associated disclaimer. */
+#/* */
+#/* This source file is free software; you can redistribute it */
+#/* and/or modify it under the terms of the GNU Lesser General */
+#/* Public License as published by the Free Software Foundation; */
+#/* either version 2.1 of the License, or (at your option) any */
+#/* later version. */
+#/* */
+#/* This source is distributed in the hope that it will be */
+#/* useful, but WITHOUT ANY WARRANTY; without even the implied */
+#/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
+#/* PURPOSE. See the GNU Lesser General Public License for more */
+#/* details. */
+#/* */
+#/* You should have received a copy of the GNU Lesser General */
+#/* Public License along with this source; if not, download it */
+#/* from http://www.opencores.org/lgpl.shtml */
+#/* */
+#/**********************************************************************/
+
+
+
+
+
+
+use Cwd;
+use XML::LibXML;
+
+
+
+
+
+my $root = "projects";
+$home = cwd();
+
+
+my $project = $ARGV[0];
+my $component = $ARGV[1];
+my $variant = $ARGV[2];
+
+
+
+
+#/*********************************************************************************************/
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/*********************************************************************************************/
+
+
+
+print "Processing children \n" ;
+
+
+my @filelist_hier = ( );
+my @filelist = ( );
+
+
+ my $prefix = "work/${project}";
+ print "\nStart $variant \n";
+ @filelist_hier = ( );
+ @filelist = ( );
+ @filelist = parse_hier("$project","$component","$variant");
+ @filelist = trim_sort(@filelist);
+
+
+
+ foreach $line (@filelist)
+ {
+ $_ = $line;
+ if(/::(\w+)::(\w+)::(\w+)::/)
+ {
+ $new_proj = $1;
+ $new_comp = $2;
+ $new_variant = $3;
+ }
+
+ if($new_proj eq "cde" ) {}
+ elsif($new_proj eq $project ) {}
+ else { &link_child( $project,$new_comp, $new_proj ); }
+ }
+
+
+
+
+
+
+#/*********************************************************************************************/
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/*********************************************************************************************/
+
+
+
+sub link_child {
+ my $project = shift;
+ my $child_parent = shift;
+ my $child_family = shift;
+
+
+ print "$project $child_parent $child_family \n";
+
+ my $path = "work/${project}/children";
+ mkdir $path,0755 unless( -e $path );
+ my $path = "work/${project}/children/${child_family}";
+ mkdir $path,0755 unless( -e $path );
+ my $path = "work/${project}/children/${child_family}/bin";
+ mkdir $path,0755 unless( -e $path );
+ $root = "${home}/projects/${child_family}/bin";
+ $dest = "${home}/work/${project}/children/${child_family}/bin";
+ &link_dir( "$root", "$dest" );
+ symlink( "${home}/tools/bin/Makefile.root", "${home}/work/${project}/children/${child_family}/bin/Makefile.root");
+ symlink( "${home}/tools/bin/Makefile", "${home}/work/${project}/children/${child_family}/bin/Makefile");
+ my $path = "work/${project}/children/${child_family}/sw";
+ mkdir $path,0755 unless( -e $path );
+ $root = "${home}/projects/${child_family}/sw";
+ $dest = "${home}/work/${project}/children/${child_family}/sw";
+ &link_dir( "$root", "$dest" );
+ my $path = "work/${project}/children/${child_family}/ip";
+ mkdir $path,0755 unless( -e $path );
+ my $path = "work/${project}/children/${child_family}/ip/${child_parent}";
+ mkdir $path,0755 unless( -e $path );
+
+ my $path = "work/${project}/children/${child_family}/ip/${child_parent}/rtl";
+ mkdir $path,0755 unless( -e $path );
+ $root = "${home}/projects/${child_family}/ip/${child_parent}/rtl";
+ $dest = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl";
+ &link_dir( "$root", "$dest" );
+ my $path = "work/${project}/children/${child_family}/ip/${child_parent}/doc";
+ mkdir $path,0755 unless( -e $path );
+ symlink( "${home}/projects/${child_family}/ip/${child_parent}/doc/copyright.v", "${home}/work/${project}/children/${child_family}/ip/${child_parent}/doc/copyright.v");
+
+ my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen";
+ mkdir $path,0755 unless( -e $path );
+ my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen/sim";
+ mkdir $path,0755 unless( -e $path );
+ my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen/syn";
+ mkdir $path,0755 unless( -e $path );
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#/*********************************************************************************************/
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/*********************************************************************************************/
+
+
+# recursively map directory information
+
+sub link_sub {
+ my $root = shift;
+ my $path = shift;
+ my $dest = shift;
+ return unless( -e $path );
+
+
+
+ my $dest_path = $path;
+ $dest_path =~ s/$root/$dest/;
+
+
+ if( -d $path ) {
+
+ mkdir $dest_path,0755;
+
+ my @contents = ( );
+ opendir( DIR, $path );
+ while( my $item = readdir( DIR )) {
+ next if( $item eq '.' or $item eq '..' or $item eq '.svn' );
+ push( @contents, $item );
+ }
+ closedir( DIR );
+
+ # recurse on items in the directory
+ foreach my $item ( @contents ) { &link_sub($root, "$path/$item", $dest );}
+
+
+ } else {
+
+ symlink( "${home}/${path}", $dest_path);
+ }
+}
+
+
+
+#/*********************************************************************************************/
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/*********************************************************************************************/
+
+# recursively map directory information
+
+sub link_dir {
+ my $src = shift;
+ my $dest = shift;
+ return unless( -e $src );
+
+ if( -d $src )
+ {
+
+ mkdir $dest,0755;
+ my @contents = ( );
+ opendir( DIR, $src );
+ while( my $item = readdir( DIR ))
+ {
+ next if( $item eq '.' or $item eq '..' or $item eq '.svn' );
+ push( @contents, $item );
+ }
+ closedir( DIR );
+
+ # recurse on items in the directory
+ foreach my $item ( @contents ) { &link_dir("$src/$item", "$dest/$item" );}
+
+
+ }
+ else {symlink( "${src}", "${dest}") unless( -e "${dest}" ); }
+}
+
+
+
+
+#/*********************************************************************************************/
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/*********************************************************************************************/
+
+sub trim_sort {
+ my @output_files = @_;
+ my %trim = ();
+ foreach $descriptor (@output_files) { $trim{$descriptor} = 1; }
+ my @k = keys %trim;
+ @output_files = sort(sort @k);
+ return(@output_files);
+ }
+
+#eval 'exec `which perl` -S $0 ${1+"$@"}'
+# if 0;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#/*********************************************************************************************/
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/ */
+#/*********************************************************************************************/
+
+sub parse_hier
+ {
+ my @params = @_;
+ my $variant = pop(@params);
+ my $component = pop(@params);
+ my $project = pop(@params);
+
+ $home = cwd();
+ $cde="cde";
+
+
+ my $parser = XML::LibXML->new();
+ my $doc = $parser->parse_file("${home}/projects/${project}/ip/${component}/rtl/xml/${variant}.xml");
+
+ foreach my $comp ($doc->findnodes('//spirit:component'))
+ {
+
+
+
+ my($vendor) = $comp->findnodes('./spirit:vendor/text()')->to_literal ;
+ my($library) = $comp->findnodes('./spirit:library/text()')->to_literal ;
+ my($name) = $comp->findnodes('./spirit:name/text()')->to_literal ;
+ my($version) = $comp->findnodes('./spirit:version/text()')->to_literal ;
+
+ my $variant = "";
+ if($version) {$variant = "${name}_${version}"}
+ else {$variant = "${name}"}
+
+
+ #/*********************************************************************************************/
+ #/ */
+ #/ Create filelists for simulation, code coverage, linting and synthesis */
+ #/ */
+ #/ */
+ #/*********************************************************************************************/
+
+ push(@filelist_hier,"::${library}::${name}::${variant}::");
+
+ foreach my $i_name ($doc->findnodes("//spirit:component/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
+ {
+ my($library_name) = $i_name ->findnodes('../spirit:componentRef/spirit:library/text()')->to_literal ;
+ my($component_name) = $i_name ->findnodes('../spirit:componentRef/spirit:name/text()')->to_literal ;
+ my($version_name) = $i_name ->findnodes('../spirit:componentRef/spirit:version/text()')->to_literal ;
+
+ my $variant_name = "";
+ if($version_name) {$variant_name = "${component_name}_${version_name}";}
+ else {$variant_name = "${component_name}";}
+
+ if($library_name ne "cde")
+ {
+ my @filelist_sub = parse_hier("$library_name","$component_name","$variant_name");
+ foreach $line (@filelist_sub) { push(@filelist_hier,"$line"); }
+ }
+ else { push(@filelist_hier,"::${library_name}::${component_name}::${variant_name}::"); }
+ }
+ }
+ $ArraySize = @filelist_hier;
+
+
+ @filelist_hier = trim_sort(@filelist_hier);
+
+ return(@filelist_hier);
+ }
soc_link_2
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: build_leaf
===================================================================
--- build_leaf (revision 84)
+++ build_leaf (revision 85)
@@ -44,7 +44,6 @@
#/* */
#/**********************************************************************/
-# ToDO: add handling unaligned words
############################################################################
@@ -70,10 +69,11 @@
## Help option
##############################################################################
if ( ($opt_h eq "1") )
- { print "\n type test filename ( no extension)";
- print "\n";
- exit 1;
- }
+ {
+ print "\n type build_leaf work/project component variant";
+ print "\n";
+ exit 1;
+ }
##############################################################################
@@ -83,13 +83,12 @@
use Cwd;
use XML::LibXML;
-$home = cwd();
+$cde_home = cwd();
$cde="cde";
+$lib_comp_sep = "/ip/";
+$comp_xml_sep = "/rtl/xml/";
-
-
-
#############################################################################
##
## open intel hex file and read into array
@@ -96,128 +95,113 @@
##
#############################################################################
- my $prefix = $ARGV[0];
- my $component = $ARGV[1];
- my $variant = $ARGV[2];
+my $prefix = $ARGV[0];
+my $component = $ARGV[1];
+my $variant = $ARGV[2];
-my $kid = "${home}/${prefix}/ip/${component}/rtl/xml/${variant}.xml" ;
-
print " Building RTL for $prefix $component $variant \n" ;
- my $parser = XML::LibXML->new();
- my $doc = $parser->parse_file($kid);
- foreach my $comp ($doc->findnodes('//spirit:component'))
- {
- my($name) = $comp->findnodes('./spirit:name/text()')->to_literal ;
- my($version) = $comp->findnodes('./spirit:version/text()')->to_literal ;
- my($vendor) = $comp->findnodes('./spirit:vendor/text()')->to_literal ;
- my($library) = $comp->findnodes('./spirit:library/text()')->to_literal ;
+my $parser = XML::LibXML->new();
+my $doc = $parser->parse_file("${cde_home}/${prefix}${lib_comp_sep}${component}${comp_xml_sep}${variant}.xml");
+foreach my $comp ($doc->findnodes('//spirit:component'))
+ {
+ my($name) = $comp->findnodes('./spirit:name/text()')->to_literal ;
+ my($version) = $comp->findnodes('./spirit:version/text()')->to_literal ;
+ my($vendor) = $comp->findnodes('./spirit:vendor/text()')->to_literal ;
+ my($library) = $comp->findnodes('./spirit:library/text()')->to_literal ;
+ #/**********************************************************************/
+ #/* */
+ #/* build a `define file for module names */
+ #/* */
+ #/* */
+ #/* */
+ #/* */
+ #/**********************************************************************/
-
-#/**********************************************************************/
-#/* */
-#/* build a `define file for module names */
-#/* */
-#/* */
-#/* */
-#/* */
-#/**********************************************************************/
-
- my $outfile ="${home}/${prefix}/ip/${component}/rtl/gen/deflist";
- open DEFLIST,">$outfile" or die "unable to open $outfile";
- print DEFLIST " \n";
- foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:logicalName"))
- {
- my($def_logic) = $i_name ->findnodes('./text()')->to_literal ;
- my($def_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
- if($def_logic ) {print DEFLIST sprintf( "\`define %s _%s\n", uc($def_logic) , $def_logic );}
- }
+ my $outfile ="${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/deflist";
+ open DEFLIST,">$outfile" or die "unable to open $outfile";
+ print DEFLIST " \n";
+ foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:logicalName"))
+ {
+ my($def_logic) = $i_name ->findnodes('./text()')->to_literal ;
+ my($def_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
+ if($def_logic ) {print DEFLIST sprintf( "\`define %s _%s\n", uc($def_logic) , $def_logic );}
+ }
+ #/**********************************************************************/
+ #/* */
+ #/* build a fileset in the following order */
+ #/* */
+ #/* deflist for module names */
+ #/* all include files */
+ #/* verilogSourceTop file */
+ #/* all the remaining verilogSource files */
+ #/* */
+ #/* */
+ #/**********************************************************************/
+ my $outfile ="${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/filelist";
+ open FILELIST,">$outfile" or die "unable to open $outfile";
+ print FILELIST "${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/deflist";
-#/**********************************************************************/
-#/* */
-#/* build a fileset */
-#/* */
-#/* include files first, then top and then all the rest */
-#/* */
-#/* */
-#/**********************************************************************/
+ foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
+ {
+ my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
+ my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
+ if($file_type eq "verilogInclude"){ print FILELIST " ${cde_home}/${prefix}${lib_comp_sep}${component}${comp_xml_sep}${file_name}\n"};
+ }
- my $outfile ="${home}/${prefix}/ip/${component}/rtl/gen/filelist";
- open FILELIST,">$outfile" or die "unable to open $outfile";
- print FILELIST "${home}/${prefix}/ip/${component}/rtl/gen/deflist";
+ foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
+ {
+ my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
+ my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
+ if($file_type eq "verilogSourceTop"){ print FILELIST " ${cde_home}/${prefix}${lib_comp_sep}${component}${comp_xml_sep}${file_name}\n"};
+ }
+ foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
+ {
+ my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
+ my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
+ if($file_type eq "verilogSource") { print FILELIST " ${cde_home}/${prefix}${lib_comp_sep}${component}${comp_xml_sep}${file_name}\n"};
+ }
- foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
- {
- my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
- my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
- if($file_type eq "verilogInclude"){ print FILELIST " ${home}/${prefix}/ip/${component}/rtl/xml/${file_name}\n"};
- }
-
- foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
- {
- my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
- my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
- if($file_type eq "verilogSourceTop"){ print FILELIST " ${home}/${prefix}/ip/${component}/rtl/xml/${file_name}\n"};
- }
-
-
- foreach my $i_name ($doc->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
- {
- my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
- my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
- if($file_type eq "verilogSource") { print FILELIST " ${home}/${prefix}/ip/${component}/rtl/xml/${file_name}\n"};
- }
-
-#/**********************************************************************/
-#/* */
-#/* Every leaf cell is processed through a the verilog preprocessor */
-#/* to remove all verilog tic(`) statements and to create seperate */
-#/* versions for simulation and synthesys */
-#/* */
-#/* */
-#/**********************************************************************/
+ #/**********************************************************************/
+ #/* */
+ #/* Every leaf cell is processed through a the verilog preprocessor */
+ #/* to customize the module names,remove all verilog tic(`) statements */
+ #/* and to create seperate versions for simulation and synthesys */
+ #/* */
+ #/* */
+ #/**********************************************************************/
- print "BUILD HW $prefix $component $variant\n";
+ print "BUILD HW $prefix $component $variant\n";
- $cmd ="cp ${home}/${prefix}/ip/${component}/doc/copyright.v ${home}/${prefix}/ip/${component}/rtl/gen/sim/${variant}.v";
- if (system($cmd)) {}
+ $cmd ="cp ${cde_home}/${prefix}${lib_comp_sep}${component}/doc/copyright.v ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/sim/${variant}.v";
+ if (system($cmd)) {}
- $cmd ="vppreproc --noline --noblank -DVARIANT=${variant} -DCDE=${cde} -y ${home}/${prefix}/ip/${component}/rtl/verilog -f ${home}/${prefix}/ip/${component}/rtl/gen/filelist >> ${home}/${prefix}/ip/${component}/rtl/gen/sim/${variant}.v";
- if (system($cmd)) {}
+ $cmd ="vppreproc --noline --noblank -DVARIANT=${variant} -DCDE=${cde} -y ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/verilog -f ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/filelist >> ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/sim/${variant}.v";
+ if (system($cmd)) {}
- $cmd ="cp ${home}/${prefix}/ip/${component}/doc/copyright.v ${home}/${prefix}/ip/${component}/rtl/gen/syn/${variant}.v";
- if (system($cmd)) {}
+ $cmd ="cp ${cde_home}/${prefix}${lib_comp_sep}${component}/doc/copyright.v ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/syn/${variant}.v";
+ if (system($cmd)) {}
- $cmd ="vppreproc --noline --noblank -DSYNTHESIS -DVARIANT=${variant} -DCDE=${cde} -y ${home}/${prefix}/ip/${component}/rtl/verilog -f ${home}/${prefix}/ip/${component}/rtl/gen/filelist >> ${home}/${prefix}/ip/${component}/rtl/gen/syn/${variant}.v";
- if (system($cmd)) {}
+ $cmd ="vppreproc --noline --noblank -DSYNTHESIS -DVARIANT=${variant} -DCDE=${cde} -y ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/verilog -f ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/filelist >> ${cde_home}/${prefix}${lib_comp_sep}${component}/rtl/gen/syn/${variant}.v";
+ if (system($cmd)) {}
+ }
+1
- }
-
-
-
-
-
-
-1
-
-
-
-
/build_verilog
11,7 → 11,7
#/* | | */ |
#/* |____________| */ |
#/* */ |
#/* builds verilog rtl from a ip-xact component file for a leaf cell */ |
#/* builds verilog rtl from a ip-xact component file */ |
#/* */ |
#/* */ |
#/* Author(s): */ |
70,7 → 70,7
## Help option |
############################################################################## |
if ( ($opt_h eq "1") ) |
{ print "\n type test filename ( no extension)"; |
{ print "\n type build_verilog work/project component variant ../verilog/file_destination"; |
print "\n"; |
exit 1; |
} |
83,12 → 83,13
use Cwd; |
use XML::LibXML; |
|
$home = cwd(); |
$cde_home = cwd(); |
$lib_comp_sep = "/ip/"; |
$comp_xml_sep = "/rtl/xml/"; |
|
|
|
|
|
############################################################################# |
## |
## |
105,7 → 106,7
|
|
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file("${home}/${prefix}/ip/${component}/rtl/xml/${variant}.xml"); |
my $doc = $parser->parse_file("${cde_home}/${prefix}${lib_comp_sep}${component}${comp_xml_sep}${variant}.xml"); |
foreach my $comp ($doc->findnodes('//spirit:component')) |
{ |
my($vendor) = $comp->findnodes('./spirit:vendor/text()')->to_literal ; |
113,8 → 114,6
my($name) = $comp->findnodes('./spirit:name/text()')->to_literal ; |
my($version) = $comp->findnodes('./spirit:version/text()')->to_literal ; |
|
|
|
#/**********************************************************************/ |
#/* */ |
#/* Every hier cell is constructed from the ipxact file with seperate */ |
123,12 → 122,9
#/* */ |
#/**********************************************************************/ |
|
|
|
|
print "BUILD design $prefix\n $component $variant\n"; |
print "CREATING verilog for Proj $project Comp $component Name $name Var $variant \n"; |
my $outfile ="${home}/${prefix}/ip/${component}/rtl/xml/${destination}"; |
my $outfile ="${cde_home}/${prefix}${lib_comp_sep}${component}${comp_xml_sep}${destination}"; |
open DEST_FILE,">$outfile" or die "unable to open $outfile"; |
my $name = $variant; |
print DEST_FILE "\n module \n\n $variant \n "; |
266,7 → 262,6
} |
} |
} |
|
} |
print DEST_FILE ");\n\n"; |
} |
275,19 → 270,6
|
|
|
# foreach my $i_name ($doc->findnodes("//spirit:component/rtl")) |
# { |
# my($rtl_file) = $i_name ->findnodes('./name/text()')->to_literal ; |
# print "CCC $rtl_file\n"; |
# $SRCFILE ="${home}/${prefix}/ip/${component}/rtl/xml/${rtl_file}"; |
# open(SRCFILE) or die("Could not open src file."); |
# foreach $line (<SRCFILE>) |
# { |
# chomp($line); # remove the newline from $line. |
# # do line-by-line processing. |
# print DEST_FILE "${line}\n"; |
# } |
# } |
|
|
foreach my $i_name ($doc->findnodes("//spirit:component/spirit:fileSets/spirit:fileSet/spirit:file")) |
297,20 → 279,16
|
if($file_type eq "verilogFragment") |
{ |
$SRCFILE ="${home}/${prefix}/ip/${component}/rtl/xml/${rtl_file}"; |
$SRCFILE ="${cde_home}/${prefix}${lib_comp_sep}${component}${comp_xml_sep}${rtl_file}"; |
open(SRCFILE) or die("Could not open src file."); |
foreach $line (<SRCFILE>) |
{ |
chomp($line); |
print DEST_FILE "${line}\n"; |
} |
} |
} |
} |
|
|
print DEST_FILE "\n\n\n endmodule\n\n"; |
|
|
print DEST_FILE "\n\n\n endmodule\n\n"; |
} |
|
|
/soc_builder
115,9 → 115,10
|
$cmd ="./tools/bin/setup_cov $project $component /n"; |
if (system($cmd)) {} |
|
print "exit setup_cov \n"; |
$cmd ="./tools/bin/build_filelists $project $component $variant /n"; |
if (system($cmd)) {} |
print "exit build_filelists \n"; |
} |
} |
} |
315,6 → 316,6
else { push(@filelist_hier,"::${library_name}::${component_name}::${variant_name}::"); } |
} |
} |
|
@filelist_hier = trim_sort(@filelist_hier); |
return(@filelist_hier); |
} |
/soc_generate
103,64 → 103,61
print " Generating for $prefix $component $variant --" ; |
|
|
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file($xml_file); |
foreach my $comp ($doc->findnodes('//spirit:component')) |
{ |
my($vendor) = $comp->findnodes('./spirit:vendor/text()')->to_literal ; |
my($library) = $comp->findnodes('./spirit:library/text()')->to_literal ; |
my($name) = $comp->findnodes('./spirit:name/text()')->to_literal ; |
my($version) = $comp->findnodes('./spirit:version/text()')->to_literal ; |
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file($xml_file); |
foreach my $comp ($doc->findnodes('//spirit:component')) |
{ |
my($vendor) = $comp->findnodes('./spirit:vendor/text()')->to_literal ; |
my($library) = $comp->findnodes('./spirit:library/text()')->to_literal ; |
my($name) = $comp->findnodes('./spirit:name/text()')->to_literal ; |
my($version) = $comp->findnodes('./spirit:version/text()')->to_literal ; |
print "VLNV $vendor $library $name $version \n\n" ; |
|
|
#/**********************************************************************/ |
#/* */ |
#/* */ |
#/* */ |
#/* */ |
#/* */ |
#/**********************************************************************/ |
|
print "VLNV $vendor $library $name $version \n\n" ; |
foreach my $i_name ($doc->findnodes("//spirit:componentGenerator/spirit:name")) |
{ |
my($gen_name) = $i_name ->findnodes('./text()')->to_literal ; |
my($gen_phase) = $i_name ->findnodes('../spirit:phase/text()')->to_literal ; |
my($gen_apiType) = $i_name ->findnodes('../spirit:apiType/text()')->to_literal ; |
my($gen_generatorExe) = $i_name ->findnodes('../spirit:generatorExe/text()')->to_literal ; |
my($gen_generatorType) = $i_name ->findnodes('../spirit:vendorExtensions/generatorType/text()')->to_literal ; |
my($gen_group) = $i_name ->findnodes('../spirit:group/text()')->to_literal ; |
|
my $cmd; |
|
#/**********************************************************************/ |
#/* */ |
#/* */ |
#/* */ |
#/* */ |
#/* */ |
#/**********************************************************************/ |
|
foreach my $i_name ($doc->findnodes("//spirit:componentGenerator/spirit:name")) |
{ |
my($gen_name) = $i_name ->findnodes('./text()')->to_literal ; |
my($gen_phase) = $i_name ->findnodes('../spirit:phase/text()')->to_literal ; |
my($gen_apiType) = $i_name ->findnodes('../spirit:apiType/text()')->to_literal ; |
my($gen_generatorExe) = $i_name ->findnodes('../spirit:generatorExe/text()')->to_literal ; |
my($gen_generatorType) = $i_name ->findnodes('../spirit:vendorExtensions/generatorType/text()')->to_literal ; |
my($gen_group) = $i_name ->findnodes('../spirit:group/text()')->to_literal ; |
if($gen_generatorType eq "design" ){ $cmd = "$gen_generatorExe $prefix";} |
else { $cmd = "${home}/${prefix}${gen_generatorExe}";} |
|
my $cmd; |
|
|
if($gen_generatorType eq "design" ){ $cmd = "$gen_generatorExe $prefix";} |
else { $cmd = "${home}/${prefix}${gen_generatorExe}";} |
print "$gen_name $gen_phase $gen_group \n"; |
|
foreach my $i_name ($doc->findnodes("//spirit:componentGenerator[spirit:name/text() = '$gen_name']/spirit:parameters/spirit:parameter")) |
{ |
my($gen_param) = $i_name ->findnodes('./spirit:value/text()')->to_literal ; |
my($gen_param_name) = $i_name ->findnodes('./spirit:name/text()')->to_literal ; |
|
if ($gen_param_name eq "in_pipe") {$cmd = "$cmd <${home}/${prefix}/ip/${component}/${gen_param}";} |
elsif($gen_param_name eq "out_pipe") {$cmd = "$cmd >${home}/${prefix}/ip/${component}/${gen_param}";} |
elsif($gen_param_name eq "dash") {$cmd = "$cmd -${gen_param}";} |
else {$cmd = "$cmd $gen_param";} |
} |
|
print "$gen_name $gen_phase $gen_group \n"; |
|
foreach my $i_name ($doc->findnodes("//spirit:componentGenerator[spirit:name/text() = '$gen_name']/spirit:parameters/spirit:parameter")) |
{ |
my($gen_param) = $i_name ->findnodes('./spirit:value/text()')->to_literal ; |
my($gen_param_name) = $i_name ->findnodes('./spirit:name/text()')->to_literal ; |
|
if ($gen_param_name eq "in_pipe") {$cmd = "$cmd <${home}/${prefix}/ip/${component}/${gen_param}";} |
elsif($gen_param_name eq "out_pipe") {$cmd = "$cmd >${home}/${prefix}/ip/${component}/${gen_param}";} |
elsif($gen_param_name eq "dash") {$cmd = "$cmd -${gen_param}";} |
else {$cmd = "$cmd $gen_param";} |
$cmd = "${cmd}\n"; |
print " $cmd"; |
if (system($cmd)) {} |
print "\n"; |
} |
|
$cmd = "${cmd}\n"; |
print " $cmd"; |
if (system($cmd)) {} |
print "\n"; |
} |
|
} |
|
|
/Makefile.root
24,7 → 24,7
lint: |
echo "################################################################################"; \ |
echo; \ |
rm -r TB.v;\ |
rm -f TB.v;\ |
chmod 755 filelist.ver ;\ |
./filelist.ver ;\ |
verilator --cc TB.v --exe ../../bench/verilator/sim_main.cpp -top-module TB -Wno-WIDTH 2> lint.log;\ |
48,6 → 48,7
cd $(CUR_DIR)/../lint/$$VARIANT/;\ |
rm -f *.log;\ |
chmod 755 filelist.ver ;\ |
rm -f TB.v;\ |
./filelist.ver ;\ |
verilator --cc TB.v --exe ../../bench/verilator/sim_main.cpp -top-module TB -Wno-WIDTH 2> lint.log;\ |
cd $(CUR_DIR) ;\ |
184,20 → 185,20
cd xilinx;\ |
cp ../target/filelist ../filelist;\ |
cat ../filelist.syn >> ../filelist ;\ |
echo "run -ifn ../filelist -ifmt mixed -top " $(board)_$(Design) " -ofn " $(board)_$(Design)".ngc -ofmt NGC -p " $(Part) "-opt_mode Speed -opt_level 1" > Xst;\ |
xst -ifn ./Xst -ofn $(board)_$(Design).log;\ |
ngdbuild -dd _ngo -nt timestamp -p $(Part) -uc ../target/Pad_Ring.ucf $(board)_$(Design);\ |
map -p $(Part) -cm area -ir off -pr off -c 100 -o $(board)_$(Design)_map.ncd $(board)_$(Design).ngd $(board)_$(Design).pcf;\ |
par -w -ol std -t 1 $(board)_$(Design)_map.ncd $(board)_$(Design).ncd $(board)_$(Design).pcf ;\ |
trce -e 3 -s 5 -xml $(board)_$(Design) $(board)_$(Design).ncd -o $(board)_$(Design).twr $(board)_$(Design).pcf -ucf ../target/Pad_Ring.ucf ;\ |
netgen -s 5 -pcf $(board)_$(Design).pcf -sdf_anno true -sdf_path "../gate_sims/par" -insert_glbl true -insert_pp_buffers true -w -dir ../gate_sims/par -ofmt verilog -sim $(board)_$(Design).ncd $(board)_$(Design).v;\ |
bitgen -f ../target/cclk.ut $(board)_$(Design).ncd;\ |
mv $(board)_$(Design).bit Board_Design_cclk.bit ;\ |
promgen -u 0 Board_Design_cclk ; \ |
echo "run -ifn ../filelist -ifmt mixed -top " $(Design) " -ofn " $(Design)".ngc -ofmt NGC -p " $(Part) "-opt_mode Speed -opt_level 1" > Xst;\ |
xst -ifn ./Xst -ofn $(Design).log;\ |
ngdbuild -dd _ngo -nt timestamp -p $(Part) -uc ../target/Pad_Ring.ucf $(Design) >>$(Design).log ;\ |
map -p $(Part) -cm area -ir off -pr off -c 100 -o $(Design)_map.ncd $(Design).ngd $(Design).pcf >>$(Design).log ;\ |
par -w -ol std -t 1 $(Design)_map.ncd $(Design).ncd $(Design).pcf >>$(Design).log ;\ |
trce -e 3 -s 5 -xml $(Design) $(Design).ncd -o $(Design).twr $(Design).pcf -ucf ../target/Pad_Ring.ucf >>$(Design).log ;\ |
netgen -s 5 -pcf $(Design).pcf -sdf_anno true -sdf_path "../gate_sims/par" -insert_glbl true -insert_pp_buffers true -w -dir ../gate_sims/par -ofmt verilog -sim $(Design).ncd $(Design).v >>$(Design).log ;\ |
bitgen -f ../target/cclk.ut $(Design).ncd >>$(Design).log ;\ |
mv $(Design).bit Board_Design_cclk.bit ;\ |
promgen -u 0 Board_Design_cclk >>$(Design).log ; \ |
mv Board_Design_cclk.mcs ../debug ;\ |
bitgen -f ../target/jtag.ut $(board)_$(Design).ncd;\ |
mv $(board)_$(Design).bit Board_Design_jtag.bit ;\ |
impact -batch ../debug/impact_bat ;\ |
bitgen -f ../target/jtag.ut $(Design).ncd >>$(Design).log ;\ |
mv $(Design).bit Board_Design_jtag.bit ;\ |
impact -batch ../debug/impact_bat >>$(Design).log ;\ |
mv *.bit ../debug ;\ |
) |
|
/soc_link
54,6 → 54,7
|
|
|
|
#/*********************************************************************************************/ |
#/ We never generate files into a RCS database. */ |
#/ */ |
90,7 → 91,8
symlink( "${home}/tools/bin/Makefile.root", "${home}/work/${project}/bin/Makefile.root"); |
symlink( "${home}/tools/bin/Makefile", "${home}/work/${project}/bin/Makefile"); |
|
my $prefix = "work/${project}"; |
$cmd ="chmod 755 ${home}/projects/${project}/bin/* \n"; |
if (system($cmd)) {} |
|
|
my @components = qx(ls ${home}/work/${project}/ip ); |
97,145 → 99,19
foreach my $component (@components) |
{ |
chomp($component); |
$root = "bench"; |
$dest = "work/${project}/ip/${component}/sim/bench"; |
&link_sub( $root,$root, $dest ); |
$root = "lib"; |
$dest = "work/${project}/ip/${component}/sim/lib"; |
&link_sub( $root,$root, $dest ); |
|
#/*********************************************************************************************/ |
#/ */ |
#/ Every component needs a rtl/verilog,gen/sim and /gen/syn subdirectory */ |
#/ */ |
#/*********************************************************************************************/ |
$cmd ="./tools/bin/soc_link_1 $project $component \n"; |
if (system($cmd)) {} |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/verilog"; |
mkdir $path,0755 unless( -e $path ); |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/gen"; |
mkdir $path,0755 unless( -e $path ); |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/gen/sim"; |
mkdir $path,0755 unless( -e $path ); |
|
my $path = "${home}/${prefix}/ip/${component}/rtl/gen/syn"; |
mkdir $path,0755 unless( -e $path ); |
|
|
|
} |
} |
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
|
|
print "Processing components \n" ; |
|
foreach my $project (@projects) |
{ |
chomp($project); |
my @components = qx(ls ${home}/work/${project}/ip ); |
foreach my $component (@components) |
{ |
chomp($component); |
print "Start component $component \n"; |
my $prefix = "work/${project}"; |
|
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file("${home}/${prefix}/ip/${component}/soc/design.soc"); |
foreach my $comp ($doc->findnodes('//components/component')) |
{ |
|
my($name) = $comp->findnodes('./name/text()')->to_literal ; |
my($variant) = $comp->findnodes('./variant/text()')->to_literal ; |
|
print " directories for $project - $component $name - $variant \n"; |
|
|
|
{ |
|
|
#/*********************************************************************************************/ |
#/ link chip files */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
print "Linking targets for $project $component $name\n"; |
foreach my $i_name ($doc->findnodes("//chips/chip/name")) |
{ |
my($chip) = $i_name ->findnodes('./text()')->to_literal ; |
my($chip_target) = $i_name ->findnodes('../target/text()')->to_literal ; |
my($configuration) = $i_name ->findnodes('../configuration/text()')->to_literal ; |
|
$outfile ="${home}/${prefix}/ip/${component}/syn/${chip}/def_file"; |
open DEFSYNFILE,">$outfile" or die "unable to open $outfile"; |
print DEFSYNFILE "\`define MODULE_NAME ${chip_target}_${variant}_${configuration}\n"; |
|
$outfile ="${home}/${prefix}/ip/${component}/syn/${chip}/Makefile"; |
open MAKSYNFILE,">$outfile" or die "unable to open $outfile"; |
|
print MAKSYNFILE "include ../../../../bin/Makefile.root\n"; |
print MAKSYNFILE "include ./target/Makefile.brd\n"; |
print MAKSYNFILE "Design=${variant}_${configuration}\n"; |
|
my $path = "${home}/${prefix}/ip/${component}/syn/${chip}/target"; |
mkdir $path,0755 unless( -e $path ); |
|
&link_dir( "${home}/targets/${chip_target}", "${home}/${prefix}/ip/${component}/syn/${chip}/target" ); |
&link_dir( "${home}/lib", "${home}/${prefix}/ip/${component}/syn/${chip}/target/lib/syn" ); |
|
} |
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
print "Linking modules for $project $component $name\n"; |
foreach my $i_name ($doc->findnodes("//module/name")) |
{ |
my($child) = $i_name ->findnodes('./text()')->to_literal ; |
my($child_parent) = $i_name ->findnodes('../component/text()')->to_literal ; |
my($child_family) = $i_name ->findnodes('../project/text()')->to_literal ; |
|
if( ($child_family ne $project) & ($child_family ne "cde") ) |
{ |
&link_child( $project,$child_parent, $child_family ); |
} |
} |
print "\n"; |
} |
} |
} |
} |
|
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
262,40 → 138,24
print "Start children of $component \n"; |
my $prefix = "work/${project}"; |
|
|
|
|
my @xml_files = qx(ls ${home}/${prefix}/ip/${component}/rtl/xml ); |
foreach my $xml_file (@xml_files) |
{ |
chomp($xml_file); |
my $filename= "${home}/${prefix}/ip/${component}/rtl/xml/${xml_file}"; |
$_ = $filename; |
if(/(\S+)\/ip\/(\w+)\/rtl\/xml\/(\w+).xml/) |
{ |
$variant = $3; |
} |
print "Start $variant \n"; |
@filelist_hier = ( ); |
@filelist = ( ); |
@filelist = parse_hier("$project","$component","$variant"); |
@filelist = trim_sort(@filelist); |
|
foreach $line (@filelist) |
{ |
$_ = $line; |
if(/::(\w+)::(\w+)::(\w+)::/) |
{ |
$new_proj = $1; |
$new_comp = $2; |
$new_variant = $3; |
} |
|
|
|
|
if($new_proj eq "cde" ) {} |
elsif($new_proj eq $project ) {} |
else { &link_child( $project,$new_comp, $new_proj ); } |
|
|
my $filename= "${home}/${prefix}/ip/${component}/rtl/xml/${xml_file}"; |
$_ = $filename; |
if(/(\S+)\/ip\/(\w+)\/rtl\/xml\/(\w+).xml/) { $variant = $3; } |
$cmd ="./tools/bin/soc_link_2 $project $component $variant /n"; |
if (system($cmd)) {} |
} |
} |
} |
|
|
306,15 → 166,10
|
|
|
} |
} |
} |
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
324,69 → 179,6
#/ */ |
#/*********************************************************************************************/ |
|
|
|
sub link_child { |
my $project = shift; |
my $child_parent = shift; |
my $child_family = shift; |
|
my $path = "work/${project}/children"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "work/${project}/children/${child_family}"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "work/${project}/children/${child_family}/bin"; |
mkdir $path,0755 unless( -e $path ); |
$root = "${home}/projects/${child_family}/bin"; |
$dest = "${home}/work/${project}/children/${child_family}/bin"; |
&link_dir( "$root", "$dest" ); |
symlink( "${home}/tools/bin/Makefile.root", "${home}/work/${project}/children/${child_family}/bin/Makefile.root"); |
symlink( "${home}/tools/bin/Makefile", "${home}/work/${project}/children/${child_family}/bin/Makefile"); |
my $path = "work/${project}/children/${child_family}/sw"; |
mkdir $path,0755 unless( -e $path ); |
$root = "${home}/projects/${child_family}/sw"; |
$dest = "${home}/work/${project}/children/${child_family}/sw"; |
&link_dir( "$root", "$dest" ); |
my $path = "work/${project}/children/${child_family}/ip"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "work/${project}/children/${child_family}/ip/${child_parent}"; |
mkdir $path,0755 unless( -e $path ); |
$root = "${home}/projects/${child_family}/ip/${child_parent}"; |
$dest = "${home}/work/${project}/children/${child_family}/ip/${child_parent}"; |
&link_dir( "$root", "$dest" ); |
my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen/sim"; |
mkdir $path,0755 unless( -e $path ); |
my $path = "${home}/work/${project}/children/${child_family}/ip/${child_parent}/rtl/gen/syn"; |
mkdir $path,0755 unless( -e $path ); |
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
|
# recursively map directory information |
|
397,9 → 189,7
return unless( -e $path ); |
|
|
|
|
my $dest_path = $path; |
my $dest_path = $path; |
$dest_path =~ s/$root/$dest/; |
|
|
442,7 → 232,6
my $src = shift; |
my $dest = shift; |
return unless( -e $src ); |
|
|
if( -d $src ) |
{ |
522,6 → 311,7
|
|
|
|
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file("${home}/projects/${project}/ip/${component}/rtl/xml/${variant}.xml"); |
|
567,3 → 357,5
|
return(@filelist_hier); |
} |
|
|
/build_filelists
125,10 → 125,12
@filelist_cov = ( ); |
my @filelist_hier = ( ); |
|
|
print "enter build_filelist \n"; |
my @filelist = parse_hier("$project","$component","$variant"); |
@filelist = trim_sort(@filelist); |
|
print "finish_parse \n"; |
|
foreach $line (@filelist) |
{ |
|
307,45 → 309,6
open COVFILE,">$outfile" or die "unable to open $outfile"; |
foreach my $i_line (@filelist_cov) {print COVFILE "$i_line";} |
|
# my $outfile ="${home}/${prefix}/ip/${component}/sim/cov/${variant}/Makefile"; |
# open MAKCOVFILE,">$outfile" or die "unable to open $outfile"; |
|
# print MAKCOVFILE "SHELL=/bin/sh \n"; |
# print MAKCOVFILE "MAKE=make \n"; |
# print MAKCOVFILE " \n"; |
# print MAKCOVFILE " \n"; |
# print MAKCOVFILE ".PHONY build_cdd:\n"; |
# print MAKCOVFILE "build_cdd:\n"; |
|
# foreach my $i_name ($doc->findnodes("//spirit:component/code_coverage/cover/name")) |
# { |
# my($cover_name) = $i_name ->findnodes('./text()')->to_literal ; |
# my($cover_inst) = $i_name ->findnodes('../spirit:componentInstance/text()')->to_literal ; |
# print MAKCOVFILE "\tcovered score -f filelist.cov -i $cover_inst -t $cover_name -I ./ -v ./coverage.v -o ${cover_name}.cdd 2> cov.log | tee >> cov.log ;\\\n"; |
# } |
|
# print MAKCOVFILE " \n"; |
# print MAKCOVFILE ".PHONY score_cov:\n"; |
# print MAKCOVFILE "score_cov:\n"; |
|
# foreach my $i_name ($doc->findnodes("//spirit:component/code_coverage/cover/name")) |
# { |
# my($cover_name) = $i_name ->findnodes('./text()')->to_literal ; |
# my($cover_inst) = $i_name ->findnodes('../spirit:componentInstance/text()')->to_literal ; |
# print MAKCOVFILE "\tcovered score -cdd ${cover_name}.cdd -vcd ../../run/\$(TEST)/TestBench.vcd 2>> ${cover_name}_sco_cov.log | tee >> ${cover_name}_sco_cov.log ;\\\n"; |
# } |
|
# print MAKCOVFILE " \n"; |
# print MAKCOVFILE ".PHONY report_cov:\n"; |
# print MAKCOVFILE "report_cov:\n"; |
|
# foreach my $i_name ($doc->findnodes("//spirit:component/code_coverage/cover/name")) |
# { |
# my($cover_name) = $i_name ->findnodes('./text()')->to_literal ; |
# my($cover_inst) = $i_name ->findnodes('../spirit:componentInstance/text()')->to_literal ; |
# print MAKCOVFILE "\tcovered report -cdd ${cover_name}.cdd 2> ${cover_name}_rep_cov.log | tee >> ${cover_name}_rep_cov.log ;\\\n"; |
# } |
|
#/*********************************************************************************************/ |
#/ */ |
#/ Create a params.ver file in every lint directory */ |
442,16 → 405,7
print VDUTFILE "$i_line"; |
} |
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
print "CREATING sim files for $project $component $chip $name $variant \n"; |
|
|
|
459,9 → 413,12
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ Make synthesys filelist */ |
#/ Make simulation file set */ |
#/ */ |
#/ */ |
#/ */ |
468,17 → 425,17
#/ */ |
#/*********************************************************************************************/ |
|
print "CREATING sim files for $project $component $chip $name $variant \n"; |
|
|
|
my $parser = XML::LibXML->new(); |
my $doc = $parser->parse_file("${home}/${prefix}/ip/${component}/soc/design.soc"); |
|
|
foreach my $i_name ($doc->findnodes("//components/component/sims/sim[variant/text() = '$variant']")) |
foreach my $i_name ($doc->findnodes("//sims/sim[variant/text() = '$variant']")) |
{ |
my($simulation) = $i_name ->findnodes('name/text()')->to_literal ; |
my($configuration) = $i_name ->findnodes('configuration/text()')->to_literal ; |
my($simulation) = $i_name ->findnodes('name/text()')->to_literal ; |
my($configuration) = $i_name ->findnodes('configuration/text()')->to_literal ; |
print " sim files for $project $component $variant $simulation $configuration \n"; |
|
my $outfile ="${home}/${prefix}/ip/${component}/sim/run/${simulation}/Makefile"; |
496,6 → 453,7
open DATSIMFILE,">$outfile" or die "unable to open $outfile"; |
|
foreach my $i_line (@wire_inst){print DATSIMFILE "$i_line";} |
|
my %local_parameters = %default_parameters; |
my @local_order = @parameter_order; |
|
564,23 → 522,26
} |
|
print SIM_MODEL_FILE "///////////////////////////////////////////////////////////////////////////////\n"; |
|
|
|
|
} |
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ Make synthesis file set */ |
#/ */ |
#/ */ |
#/ */ |
#/ */ |
#/*********************************************************************************************/ |
|
|
print " Building synthesis file set for $prefix $project $component $variant \n" ; |
|
print " Building synthesis filelist for $prefix $project $component $variant \n" ; |
|
|
|
|
|
foreach my $i_name ($doc->findnodes("//chips/chip[variant/text() = '$variant']")) |
{ |
my($chip) = $i_name ->findnodes('name/text()')->to_literal ; |
590,7 → 551,7
|
|
|
print " $chip $chip_target $configration $chip_variant \n" ; |
print " $chip $chip_target $configration $chip_variant \n" ; |
|
$outfile ="${home}/${prefix}/ip/${component}/syn/${chip}/filelist.syn"; |
open SYNFILE,">$outfile" or die "unable to open $outfile"; |
617,7 → 578,7
} |
|
#/*********************************************************************************************/ |
#/ make synthesys parameter files */ |
#/ make synthesys parameter file */ |
#/ */ |
#/ */ |
#/ */ |
654,7 → 615,21
my($parameter_default) = $local_parameters{$parameter_name}; |
print SYN_PARM_FILE "parameter ${parameter_name} = ${parameter_default};\n"; |
} |
|
|
|
|
|
my $outfile ="${home}/${prefix}/ip/${component}/syn/${chip}/dat.syn"; |
open SYN_INST_FILE,">$outfile" or die "unable to open $outfile"; |
print SYN_INST_FILE "// Syn instantiation for $project $component $variant $configuration \n"; |
foreach my $i_line (@wire_inst) |
{ |
print SYN_INST_FILE "$i_line"; |
} |
} |
|
|
} |
|
|
681,8 → 656,6
@output_files = sort(sort @k); |
return(@output_files); |
} |
eval 'exec `which perl` -S $0 ${1+"$@"}' |
if 0; |
|
|
|
693,11 → 666,6
|
|
|
|
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ */ |
734,6 → 702,9
if($version) {$variant = "${name}_${version}"} |
else {$variant = "${name}"} |
|
|
|
|
#/*********************************************************************************************/ |
#/ */ |
#/ Create filelists for simulation, code coverage, linting and synthesis */ |
762,5 → 733,6
} |
} |
|
@filelist_hier = trim_sort(@filelist_hier); |
return(@filelist_hier); |
} |