FIX: fixed some bugs

This commit is contained in:
Dominik Meyer 2014-12-03 21:57:49 +01:00
parent ea4ab47f79
commit f2da12bbfe
4 changed files with 23 additions and 2 deletions

17
asm/fib.s Normal file
View File

@ -0,0 +1,17 @@
lui $1, 1 # for sub 1
lui $2, 1 # a
lui $3, 1 # b
lui $4, 1 # c
lui $5, 33 # i
lui $6, 2
sub $5,$5,$6
loop:
add $3,$0,$2 # b=a
add $2,$0,$4 # a=c
add $4,$2,$3 # c=a+b
sto $4, 5000
sub $5,$5,$1 # $i--
jpz end
jmp loop
end:
hlt

View File

@ -9,4 +9,5 @@ sub $5, $5, $4
jpz end
jmp loop
end:
sto $3, 5000
hlt

View File

@ -387,7 +387,10 @@ for my $i (@instructions) {
for my $i (@instructions) {
if ($ARGV[1] eq "-vhdl") {
printf("%4s \t => B\"%.32b\", --%s\n ",$i->{addr}, $i->{opc}, $i->{comment});
} else {
}
elsif($ARGV[1] eq "-raw") {
printf("%.32b\n",$i->{opc});
}else {
printf( "%4s %.32b #%s\n", $i->{addr}, $i->{opc}, $i->{comment} );
}
}

View File

@ -39,7 +39,7 @@ architecture arch of top is
signal scReset : std_logic;
begin
scReset <= not icReset;
scReset <= not icReset_n;
soc0:entity work.SOC
generic map(