URL
https://opencores.org/ocsvn/nanoblaze/nanoblaze/trunk
Subversion Repositories nanoblaze
Compare Revisions
- This comparison shows the changes necessary to convert path
/nanoblaze/trunk
- from Rev 11 to Rev 12
- ↔ Reverse comparison
Rev 11 → Rev 12
/Tools/nanoasm.pl
8,7 → 8,7
# |
use Getopt::Std; |
my %opts; |
getopts('hva:d:r:k', \%opts); |
getopts('hva:d:r:kz', \%opts); |
|
die("\n". |
"Usage: $0 [options] fileSpec\n". |
20,6 → 20,7
"${indent}-d bitNb the number of data bits\n". |
"${indent}-r bitNb the number of register address bits\n". |
"${indent}-k keep source comments in VHDL code\n". |
"${indent}-z zero don't care bits in VHDL ROM code\n". |
"\n". |
"Assemble code to VHDL for the nanoBlaze processor.\n". |
"\n". |
30,6 → 31,7
|
my $verbose = $opts{v}; |
my $keepComments = $opts{k}; |
my $zeroDontCares = $opts{z}; |
my $addressBitNb = $opts{a} || 10; |
my $registerBitNb = $opts{d} || 8; |
my $registerAddressBitNb = $opts{r} || 4; |
454,6 → 456,9
$operand2 = toBinary($operand2, $registerAddressBitNb); |
if ($registerBitNb > $registerAddressBitNb) { |
$operand2 = $operand2 . '-' x ($registerBitNb - $registerAddressBitNb); |
if ($zeroDontCares) { |
$operand2 =~ s/\-/0/g; |
} |
} |
} |
# address as second operand |
461,6 → 466,9
my $fill = ''; |
if ($binaryBranchInstructionLength < $binaryInstructionLength) { |
$fill = '-' x ($binaryInstructionLength - $binaryBranchInstructionLength); |
if ($zeroDontCares) { |
$fill =~ s/\-/0/g; |
} |
} |
if ( ($opcode =~ m/Ret/) ) { |
$operand2 = $fill . '-' x $addressBitNb; |