Project

General

Profile

176 markw
#!/usr/bin/perl -w
use strict;

my $wanted_variant = shift @ARGV;

348 markw
my $name="de1 5200";

176 markw
#variants...
198 markw
##my $PAL = 1;
176 markw
my $NTSC = 0;

my $RGB = 1; # i.e. not scandoubled
my $VGA = 2;

#Added like this to the generated qsf
#set_parameter -name TV 1

my %variants =
(
198 markw
# "PAL" =>
# {
# "TV" => $PAL
# },
176 markw
"NTSC" =>
{
"TV" => $NTSC
}
);

if (not defined $wanted_variant or (not exists $variants{$wanted_variant} and $wanted_variant ne "ALL"))
{
die "Provide variant of ALL or ".join ",",sort keys %variants;
}

foreach my $variant (sort keys %variants)
{
next if ($wanted_variant ne $variant and $wanted_variant ne "ALL");
348 markw
print "Building $variant of $name\n";
176 markw
my $dir = "build_$variant";
`rm -rf $dir`;
mkdir $dir;
235 markw
`cp atari5200core_de1.vhd $dir`;
176 markw
`cp *pll*.* $dir`;
`cp *.v $dir`;
`cp *.vhd* $dir`;
235 markw
`cp atari5200core.sdc $dir`;
176 markw
`mkdir $dir/common`;
`mkdir $dir/common/a8core`;
`mkdir $dir/common/components`;
`mkdir $dir/common/zpu`;
`cp ../common/a8core/* ./$dir/common/a8core`;
`cp ../common/components/* ./$dir/common/components`;
`cp ../common/zpu/* ./$dir/common/zpu`;

chdir $dir;
235 markw
`../makeqsf ../atari5200core.qsf ./common/a8core ./common/components ./common/zpu`;
176 markw
foreach my $key (sort keys %{$variants{$variant}})
{
my $val = $variants{$variant}->{$key};
235 markw
`echo set_parameter -name $key $val >> atari5200core.qsf`;
176 markw
}

235 markw
`quartus_sh --flow compile atari5200core > build.log 2> build.err`;
176 markw
`quartus_cpf --convert ../output_file.cof`;

chdir "..";
}