cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
221 Views
Registered: ‎11-11-2020

What files can I safely blow away in sources_1/ip/axi_pcie_0?

Turkey9999999_0-1605900727204.png

 

If I want to zip my project, is it safe to only keep the axi_pcie_0.xci file for vivado pcie_0 ip?  and blow away everything else in the subdirectory of axi_pcie_0??

The idea, is that the compiler will regenerate this mess of files again from the axi_pcie_0.xci file??  is there anything else i need to keep for the vivado axi_pcie_0 core?

For instance i know i can safely delete axi_pcie_0_stub.v, etc.... can i also delete the entire synth,  simulation, and doc directory directory to save space in a zip file?

0 Kudos
4 Replies
Highlighted
212 Views
Registered: ‎11-11-2020

Turkey9999999_0-1605901493967.png

 

If generate Vivado PCIE Axi core without hitting generating output button, then it only create 4 files under sources_1/ip/axi_pcie_0   so i'm assuming all subdirectories can be deleted....   But even this list doesn't look completely clean... for instance, i don't think i need instantiation templates...   this XML file... i don't know if that's important or not...

 

0 Kudos
Highlighted
196 Views
Registered: ‎11-11-2020

#!/bin/perl

find_subdir_and_keeponly(
    "ip/axi_pcie_0",  
	"/axi_pcie_0/*.xci\$", 
	"/axi_pcie_0/*.xml\$"
);

# Copy Bit file from runs directory before deleting it.
x("find . -name \*.bit -exec cp -f {} . \;");

# Vivado Output Directories not needed...
x("rm -rf *.cache/");
x("rm -rf *.runs/");
x("rm -rf *.sim/");
x("rm -rf *.hw/");
x("rm -rf *.ip_user_files/");

# Vivado Output Files not needed...
x("rm -f *.jou")
x("rm -f *.log");
x("rm -f *.str");

exit 1;

#-------------------------------------------------------------
# Subroutines
#-------------------------------------------------------------
sub x() {
    my $cmd = shift;
	
	print "x: $cmd\n";
	system($cmd);	
}


sub find_subdir_and_keeponly() {
    my $subdir = shift;
	my @keeponly = @_;
    print "find_subdir_and_keeponly:  subdir:$subdir  keeponly:@keeponly\n";
		
	my @dirs = ();
	my $cmd = "find -type d | egrep $subdir\$";
	print "cmd: $cmd\n";
	open(F, "$cmd |") ||die("cannot open pipe to cmd: $cmd");
	while(<F>) {
	    $line = $_;
		chomp($line);        	
		push(@dirs, $line);
	}
	close(F);
	
	foreach $dir (@dirs) {
		
		# Junk files
		print "\ndir: $dir\n";		
		$cmd2 = "find $dir -type f";
   	    open(F, "$cmd2 |") ||die("cannot open pipe to cmd: $cmd");
		@junker = ();
	    while(<F>) {
			chomp;
			push(@junker, $_);
		}
		close(F);
		
		foreach $junk (@junker) {
			$found = 0;
			foreach $keep (@keeponly) {
				$found=1 if ($junk =~ /$keep/);
			}
			if ($found) {
			    print "keep: $junk\n";
				next;
			}
		    print "junk: $junk\n";
			unlink($junk);
		}
		
		# Junk Subdirectories
		print "\ndir: $dir\n";		
		$cmd2 = "find $dir -type d";
   	    open(F, "$cmd2 |") ||die("cannot open pipe to cmd: $cmd");
		@junker = ();
	    while(<F>) {
			chomp;
			next if ($_ eq $dir);
			push(@junker, $_);
		}
		close(F);
		foreach $junk (@junker) {
			print "subdir: $junk\n";
			rmdir($junk);
		}		
		
	}
	
}

0 Kudos
Highlighted
178 Views
Registered: ‎01-22-2015

@Turkey9999999 

Please see the following post on ways to safely "blow away" files from a Vivado project and reduce size of the archive for a Vivado project.

https://forums.xilinx.com/t5/Design-Methodologies-and/Vivado-upgrade-and-archive/m-p/929863

Cheers,
Mark

0 Kudos
Highlighted
74 Views
Registered: ‎11-11-2020

#!/bin/perl
# This script was only made to runs from "git bash shell"
# Bill Moore 11/20/2020
#----------------------------------------------------

use File::Basename;

print "\n";
print "NOTE: This script was only made to runs from 'git bash shell'\n";

my @prj_dirs = find_vivado_prj_dirs();
foreach $dir (@prj_dirs) {
	clean_vivado_project($dir);
}
exit 1;

sub clean_vivado_project() {
	my $dir = shift;
	
	print "\n";
	print "#-" . "-" x 60 . "\n";
	print "# Cleaning up Project: $dir\n";
	print "#-" . "-" x 60 . "\n";
    x("rm -rf $dir/*.cache");
    x("rm -rf $dir/*.runs");
    x("rm -rf $dir/*.sim");
    x("rm -rf $dir/*.hw");
    x("rm -rf $dir/*.ip_user_files");	
    x("rm -rf $dir/*.jou");
    x("rm -rf $dir/*.log");
    x("rm -rf $dir/*.tmp");
    x("rm -rf $dir/*.str");	
    x("rm -rf $dir/*.bit");		
	
	find_and_keeponly(
	    "$dir",
        "ip/axi_pcie_0",  
	    "/axi_pcie_0/*.xci\$", 
	    "/axi_pcie_0/*.xml\$"
    );	
	
	print "\n";
}

#-------------------------------------------------------------
# Subroutines
#-------------------------------------------------------------
sub x() {
    my $cmd = shift;
	
	print "x: $cmd\n";
	system($cmd);	
}

sub find_vivado_prj_dirs() {
	my @dirs = ();
	
	my $cmd = "find -type f | egrep \"\\.xpr\$\"";
	print "\ncmd: $cmd\n";
	open(F, "$cmd |") ||die("cannot open pipe to cmd: $cmd");
	while(<F>) {
	    $line = $_;
		chomp($line);        	
		$line = dirname($line);
		push(@dirs, $line);
		print "Vivado_project: $line\n";
	}
	close(F);
	print "\n";
	
	return @dirs;
}

sub find_and_keeponly() {
	my $startdir = shift;
    my $subdir   = shift;
	my @keeponly = @_;
    print "\nfind_and_keeponly: [start] subdir:$subdir  keeponly:@keeponly\n";
		
	my @dirs = ();
	my $cmd = "find $startdir -type d | egrep $subdir\$";
	#print "cmd: $cmd\n";
	open(F, "$cmd |") ||die("cannot open pipe to cmd: $cmd");
	while(<F>) {
	    $line = $_;
		chomp($line);        	
		push(@dirs, $line);
		#print "found: $line\n";
	}
	close(F);
	
	foreach $dir (@dirs) {
		
		# Junk files
		print "find_and_keeponly: dir:  $dir\n";		
		$cmd2 = "find $dir -type f";
   	    open(F, "$cmd2 |") ||die("cannot open pipe to cmd: $cmd");
		@junker = ();
	    while(<F>) {
			chomp;
			push(@junker, $_);
		}
		close(F);
		
		foreach $junk (@junker) {
			$found = 0;
			foreach $keep (@keeponly) {
				$found=1 if ($junk =~ /$keep/);
			}
			if ($found) {
			    print "find_and_keeponly: keep: $junk\n";
				next;
			}
		    print "find_and_keeponly: junk: $junk\n";
			unlink($junk);
		}
		
		# Junk Subdirectories
		#print "\nfind_and_keeponly: dir: $dir\n";		
		$cmd2 = "find $dir -type d";
   	    open(F, "$cmd2 |") ||die("cannot open pipe to cmd: $cmd");
		@junker = ();
	    while(<F>) {
			chomp;
			next if ($_ eq $dir);
			push(@junker, $_);
		}
		close(F);
		foreach $junk (@junker) {
			print "subdir: $junk\n";
			rmdir($junk);
		}		
	}
    print "find_and_keeponly: [done]\n";
}

0 Kudos