- 论坛徽章:
- 0
|
本帖最后由 zhlong8 于 2011-12-22 14:21 编辑
代码:
#!/usr/bin/perl
my $wire_gen = "wire_gen.v";
my $N = 8;
# my $m = 0;
# my $n = 0;
open (FILE_W,"> $wire_gen") || die ("Could not open $wire_gen for write:$! \n");
print "Generating the connection wires of each clk_tiles ......";
print FILE_W "//This file is generated by the ___.pl.\n\n";
print FILE_W "module clk_tile_netlist (\n";
print FILE_W "\tgtree_buf1_in,"
for ($n = 0; $n <= ($N-1);$n = $n + 1){
for ($m = 0;$m <= ($N-2);$m ++){
if (($n ==($N - 1))&&($m == ($N-2))) {
print FILE_W "wire"."$m\_"."$n\; \n";
}
else { print FILE_W "wire" . "$m\_" . "$n\,";
}
}
}
close (FILE_W);
运行之后一直提示这样的错误:
syntax error at Perl_draft.pl line 16, near "0;"
syntax error at Perl_draft.pl line 16, near "1)"
syntax error at Perl_draft.pl line 17, near "++)"
Execution of Perl_draft.pl aborted due to compilation errors.
求大神指点……:Q |
|