mirror of
https://github.com/wfjm/w11.git
synced 2026-04-19 02:17:23 +00:00
41 lines
1.3 KiB
Perl
Executable File
41 lines
1.3 KiB
Perl
Executable File
#!/usr/bin/perl -w
|
|
# $Id: xilinx_vhdl_chop 314 2010-07-09 17:38:41Z mueller $
|
|
#
|
|
# Copyright 2007- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
|
#
|
|
# This program is free software; you may redistribute and/or modify it under
|
|
# the terms of the GNU General Public License as published by the Free
|
|
# Software Foundation, either version 2, or at your option any later version.
|
|
#
|
|
# This program 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 General Public License
|
|
# for complete details.
|
|
#
|
|
# Revision History:
|
|
# Date Rev Vers Comment
|
|
# 2007-06-06 50 1.0 Initial version
|
|
#
|
|
# splits a xilinx unisim_VITAL.vhd file along separators looking like:
|
|
#
|
|
# -- $Header: <path>/and5b1.vhd,v 1.4 2004/04/08 18:46:23 patrickp Exp $
|
|
#
|
|
|
|
use 5.003; # require Perl 5.003 or higher
|
|
use strict; # require strict checking
|
|
|
|
while (<>) {
|
|
chomp;
|
|
my @line = split;
|
|
if (/^-- \$Header/) {
|
|
my @file = split(/\//,$line[2]);
|
|
my $name = $file[$#file];
|
|
$name =~ s/,v//;
|
|
print "writing $name \n";
|
|
close(OFILE);
|
|
open(OFILE, "> $name") or die "Couldn't open output file: $!\n";
|
|
}
|
|
print OFILE $_,"\n";
|
|
}
|
|
close(OFILE);
|