Project

General

Profile

37 markw
#!/usr/bin/perl -w
use strict;
15 markw
37 markw
my $wanted_variant = shift @ARGV;
15 markw
348 markw
my $name="mcc216";

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

my $SVIDEO = 1;
my $VGA = 2;

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

my %variants =
(
348 markw
# "SIMPLE" =>
# {
# "TV" => $PAL,
# "SCANDOUBLE" => 0,
# "VIDEO" => $VGA,
# "internal_ram" => 16384,
# "internal_rom" => 1,
# "ext_clock" => 0
# },
37 markw
"PAL_SVIDEO" =>
{
"TV" => $PAL,
"SCANDOUBLE" => 0,
"VIDEO" => $SVIDEO,
40 markw
"internal_ram" => 0,
54 markw
"internal_rom" => 0,
40 markw
"ext_clock" => 0
37 markw
},
110 markw
"PAL_RGB" =>
96 markw
{
"TV" => $PAL,
110 markw
"SCANDOUBLE" => 0,
96 markw
"VIDEO" => $VGA,
"internal_ram" => 0,
110 markw
"internal_rom" => 0,
96 markw
"ext_clock" => 0
},
37 markw
"PAL_VGA" =>
{
"TV" => $PAL,
"SCANDOUBLE" => 1,
"VIDEO" => $VGA,
40 markw
"internal_ram" => 0,
54 markw
"internal_rom" => 0,
40 markw
"ext_clock" => 0
37 markw
},
"NTSC_SVIDEO" =>
{
"TV" => $NTSC,
"SCANDOUBLE" => 0,
"VIDEO" => $SVIDEO,
40 markw
"internal_ram" => 0,
54 markw
"internal_rom" => 0,
40 markw
"ext_clock" => 0
37 markw
},
110 markw
"NTSC_RGB" =>
{
"TV" => $NTSC,
"SCANDOUBLE" => 0,
"VIDEO" => $VGA,
"internal_ram" => 0,
"internal_rom" => 0,
"ext_clock" => 0
},
37 markw
"NTSC_VGA" =>
{
"TV" => $NTSC,
"SCANDOUBLE" => 1,
"VIDEO" => $VGA,
40 markw
"internal_ram" => 0,
54 markw
"internal_rom" => 0,
40 markw
"ext_clock" => 0
37 markw
}
);

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";
37 markw
my $dir = "build_$variant";
`rm -rf $dir`;
mkdir $dir;
`cp atari800core_mcc.vhd $dir`;
38 markw
`cp *pll*.* $dir`;
390 markw
`cp ../mcc_common/*remote_update*.* $dir`;
`cp ../mcc_common/*delayed_reconfig*.* $dir`;
37 markw
`cp sdram_ctrl_3_ports.v $dir`;
45 markw
`cp zpu_rom.vhdl $dir`;
37 markw
`cp atari800core.sdc $dir`;
58 markw
`mkdir $dir/common`;
`mkdir $dir/common/a8core`;
`mkdir $dir/common/components`;
`mkdir $dir/common/zpu`;
`mkdir $dir/svideo`;
`cp ../common/a8core/* ./$dir/common/a8core`;
`cp ../common/components/* ./$dir/common/components`;
266 markw
mkdir "./$dir/common/components/usbhostslave";
`cp ../common/components/usbhostslave/trunk/RTL/*/*.v ./$dir/common/components/usbhostslave`;
58 markw
`cp ../common/zpu/* ./$dir/common/zpu`;
`cp ./svideo/* ./$dir/svideo`;
37 markw
chdir $dir;
266 markw
`../makeqsf ../atari800core.qsf ./svideo ./common/a8core ./common/components ./common/zpu ./common/components/usbhostslave`;
37 markw
foreach my $key (sort keys %{$variants{$variant}})
{
my $val = $variants{$variant}->{$key};
`echo set_parameter -name $key $val >> atari800core.qsf`;
}

`quartus_sh --flow compile atari800core > build.log 2> build.err`;

`quartus_cpf --convert ../output_file.cof`;
my $vga = 1;
if ($variant =~ /SVIDEO/)
{
$vga = 0;
}

427 markw
##TODO - generate automated version number
#my $version = `svn info | grep Revision: | cut -d' ' -f 2`;
#chomp $version;
#$version = `date +%y%m`;
#my $version2 = `date +%d`;
#chomp $version;
#chomp $version2;
my $version = `../../mcc_common/version.pl`;
my $cmd = "wine ../rbf2arg/rbf2arg.exe $vga A $version \"Atari 800XL $variant\" output_files/atari800core.rbf output_files/atari800core_$variant.arg";
71 markw
print "Running $cmd\n";
`$cmd`;
37 markw
chdir "..";
}


#--for the MCC216 S-Video
#--rbf2arg 0 A <version.revison> "description" <filename.rbf> <filename.arg>
#--for the MCC216 VGA
#--rbf2arg 1 A <version.revison> "description" <filename.rbf> <filename.arg>