mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-04-21 12:27:27 +03:00
Fixing some examples, adding scripts for compiling xilinx libs with ghdl
This commit is contained in:
51
xilinx_lib/xilinx_ghdl_simprim
Executable file
51
xilinx_lib/xilinx_ghdl_simprim
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
# $Id: xilinx_ghdl_simprim 88 2007-10-12 20:37:45Z mueller $
|
||||
#
|
||||
if [ -z "$XILINX" ]
|
||||
then
|
||||
echo "XILINX not defined"
|
||||
exit 1
|
||||
fi
|
||||
#
|
||||
cd $XILINX
|
||||
echo "============================================================"
|
||||
echo "* Build ghdl SIMPRIM libs for $XILINX"
|
||||
echo "============================================================"
|
||||
#
|
||||
if [ ! -d ghdl ]
|
||||
then
|
||||
mkdir ghdl
|
||||
fi
|
||||
#
|
||||
cd $XILINX/ghdl
|
||||
if [ ! -d simprim ]
|
||||
then
|
||||
mkdir simprim
|
||||
fi
|
||||
#
|
||||
cd $XILINX/ghdl/simprim
|
||||
cp $XILINX/vhdl/src/simprims/simprim_Vcomponents.vhd .
|
||||
cp $XILINX/vhdl/src/simprims/simprim_Vpackage.vhd .
|
||||
#
|
||||
if [ ! -d simprim_vital_chop ]
|
||||
then
|
||||
mkdir simprim_vital_chop
|
||||
fi
|
||||
cd simprim_vital_chop
|
||||
xilinx_vhdl_chop $XILINX/vhdl/src/simprims/simprim_VITAL.vhd
|
||||
#
|
||||
cd ..
|
||||
echo "# ghdl ... simprim_Vcomponents.vhd"
|
||||
ghdl -a --ieee=synopsys --work=simprim simprim_Vcomponents.vhd
|
||||
echo "# ghdl ... simprim_Vpackage.vhd"
|
||||
ghdl -a --ieee=synopsys --work=simprim simprim_Vpackage.vhd
|
||||
|
||||
for file in `find simprim_vital_chop -name "*.vhd"`
|
||||
do
|
||||
echo "# ghdl ... $file"
|
||||
ghdl -a -fexplicit --ieee=synopsys --work=simprim 2>&1 $file |\
|
||||
tee $file.ghdl.log
|
||||
done
|
||||
#
|
||||
echo "--- scan for compilation errors:"
|
||||
find
|
||||
52
xilinx_lib/xilinx_ghdl_unisim
Executable file
52
xilinx_lib/xilinx_ghdl_unisim
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# $Id: xilinx_ghdl_unisim 88 2007-10-12 20:37:45Z mueller $
|
||||
#
|
||||
if [ -z "$XILINX" ]
|
||||
then
|
||||
echo "XILINX not defined"
|
||||
exit 1
|
||||
fi
|
||||
#
|
||||
cd $XILINX
|
||||
echo "============================================================"
|
||||
echo "* Build ghdl UNISIM libs for $XILINX"
|
||||
echo "============================================================"
|
||||
#
|
||||
if [ ! -d ghdl ]
|
||||
then
|
||||
mkdir ghdl
|
||||
fi
|
||||
#
|
||||
cd $XILINX/ghdl
|
||||
if [ ! -d unisim ]
|
||||
then
|
||||
mkdir unisim
|
||||
fi
|
||||
#
|
||||
cd $XILINX/ghdl/unisim
|
||||
cp $XILINX/vhdl/src/unisims/unisim_VCOMP.vhd .
|
||||
cp $XILINX/vhdl/src/unisims/unisim_VPKG.vhd .
|
||||
#
|
||||
if [ ! -d unisim_vital_chop ]
|
||||
then
|
||||
mkdir unisim_vital_chop
|
||||
fi
|
||||
cd unisim_vital_chop
|
||||
xilinx_vhdl_chop $XILINX/vhdl/src/unisims/unisim_VITAL.vhd
|
||||
#
|
||||
cd ..
|
||||
echo "# ghdl ... unisim_VCOMP.vhd"
|
||||
ghdl -a --ieee=synopsys --work=unisim unisim_VCOMP.vhd
|
||||
echo "# ghdl ... unisim_VPKG.vhd"
|
||||
ghdl -a --ieee=synopsys --work=unisim unisim_VPKG.vhd
|
||||
|
||||
for file in `find unisim_vital_chop -name "*.vhd"`
|
||||
do
|
||||
echo "# ghdl ... $file"
|
||||
ghdl -a -fexplicit --ieee=synopsys --work=unisim 2>&1 $file |\
|
||||
tee $file.ghdl.log
|
||||
done
|
||||
#
|
||||
echo "--- scan for compilation errors:"
|
||||
find unisim_vital_chop -name "*.ghdl.log" | xargs grep error
|
||||
#
|
||||
38
xilinx_lib/xilinx_vhdl_chop
Executable file
38
xilinx_lib/xilinx_vhdl_chop
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/perl -w
|
||||
# $Id: xilinx_vhdl_chop 87 2007-10-06 15:21:26Z mueller $
|
||||
#
|
||||
# Copyright 2007- by Walter F.J. Mueller <W.F.J.Mueller@xxxxxx>
|
||||
#
|
||||
# This program is free software; you may redistribute and/or modify it under
|
||||
# the terms of the GNU General Public License Version 2 as published by the
|
||||
# Free Software Foundation.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# 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);
|
||||
|
||||
Reference in New Issue
Block a user