Root/xilinx_lib/xilinx_vhdl_chop

1#!/usr/bin/perl -w
2# $Id: xilinx_vhdl_chop 87 2007-10-06 15:21:26Z mueller $
3#
4# Copyright 2007- by Walter F.J. Mueller <W.F.J.Mueller@xxxxxx>
5#
6# This program is free software; you may redistribute and/or modify it under
7# the terms of the GNU General Public License Version 2 as published by the
8# Free Software Foundation.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
12# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13# for complete details.
14#
15#
16# splits a xilinx unisim_VITAL.vhd file along separators looking like:
17#
18# -- $Header: <path>/and5b1.vhd,v 1.4 2004/04/08 18:46:23 patrickp Exp $
19#
20 
21use 5.003; # require Perl 5.003 or higher
22use strict; # require strict checking
23 
24while (<>) {
25  chomp;
26  my @line = split;
27  if (/^-- \$Header/) {
28    my @file = split(/\//,$line[2]);
29    my $name = $file[$#file];
30    $name =~ s/,v//;
31    print "writing $name \n";
32    close(OFILE);
33    open(OFILE, "> $name") or die "Couldn't open output file: $!\n";
34  }
35  print OFILE $_,"\n";
36}
37close(OFILE);
38
39

Archive Download this file

Branches:
master



interactive