Skip to content

Commit

Permalink
Clean up exception messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
d0iasm committed Mar 23, 2021
1 parent cf49b60 commit 3516146
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions module/src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,7 @@ impl Cpu {
self.regs[rd] = val;
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x}",
opcode, funct3
);
println!("not implemented: opcode {:#x} funct3 {:#x}", opcode, funct3);
return Err(Exception::IllegalInstruction);
}
}
Expand All @@ -362,10 +359,7 @@ impl Cpu {
match funct3 {
0x0 => {} // fence
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x}",
opcode, funct3
);
println!("not implemented: opcode {:#x} funct3 {:#x}", opcode, funct3);
return Err(Exception::IllegalInstruction);
}
}
Expand Down Expand Up @@ -448,18 +442,15 @@ impl Cpu {
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct7 {:#x}",
"not implemented: opcode {:#x} funct7 {:#x}",
opcode, funct7
);
return Err(Exception::IllegalInstruction);
}
}
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x}",
opcode, funct3
);
println!("not implemented: opcode {:#x} funct3 {:#x}", opcode, funct3);
return Err(Exception::IllegalInstruction);
}
}
Expand Down Expand Up @@ -508,7 +499,7 @@ impl Cpu {
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x} funct7 {:#x}",
"not implemented: opcode {:#x} funct3 {:#x} funct7 {:#x}",
opcode, funct3, funct7
);
return Err(Exception::IllegalInstruction);
Expand Down Expand Up @@ -575,7 +566,7 @@ impl Cpu {
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x} funct7 {:#x}",
"not implemented: opcode {:#x} funct3 {:#x} funct7 {:#x}",
opcode, funct3, funct7
);
return Err(Exception::IllegalInstruction);
Expand Down Expand Up @@ -639,7 +630,7 @@ impl Cpu {
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x} funct7 {:#x}",
"not implemented: opcode {:#x} funct3 {:#x} funct7 {:#x}",
opcode, funct3, funct7
);
return Err(Exception::IllegalInstruction);
Expand Down Expand Up @@ -691,10 +682,7 @@ impl Cpu {
}
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x}",
opcode, funct3
);
println!("not implemented: opcode {:#x} funct3 {:#x}", opcode, funct3);
return Err(Exception::IllegalInstruction);
}
}
Expand Down Expand Up @@ -814,7 +802,7 @@ impl Cpu {
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x} funct7 {:#x}",
"not implemented: opcode {:#x} funct3 {:#x} funct7 {:#x}",
opcode, funct3, funct7
);
return Err(Exception::IllegalInstruction);
Expand Down Expand Up @@ -872,16 +860,13 @@ impl Cpu {
self.update_paging(csr_addr);
}
_ => {
println!(
"not implemented yet: opcode {:#x} funct3 {:#x}",
opcode, funct3
);
println!("not implemented: opcode {:#x} funct3 {:#x}", opcode, funct3);
return Err(Exception::IllegalInstruction);
}
}
}
_ => {
dbg!(format!("not implemented yet: opcode {:#x}", opcode));
println!("not implemented: opcode {:#x}", opcode);
return Err(Exception::IllegalInstruction);
}
}
Expand Down

0 comments on commit 3516146

Please sign in to comment.