Rust character drawing

This commit is contained in:
2025-11-14 09:57:42 +01:00
parent 6bbecc252e
commit d8596b2247
7 changed files with 212 additions and 68 deletions

View File

@@ -72,41 +72,41 @@ class Alu extends Module {
out := (io.a * io.b) >> 64.U;
}
is(Div) {
when(io.b === 0.U) {
when(io.word_mode) {
out := (-1).S(32.W).asUInt
}.otherwise {
out := (-1).S(64.W).asUInt
}
}.otherwise {
out := (io.a.asSInt / io.b.asSInt).asUInt;
}
}
is(Divu) {
when(io.b === 0.U) {
out := "xFFFFFFFFFFFFFFFF".U
}.otherwise {
out := io.a / io.b;
}
}
is(Rem) {
when(io.b === 0.U) {
out := io.a
}.otherwise {
out := (io.a.asSInt % io.b.asSInt).asUInt;
}
}
is(Remu) {
when(io.b === 0.U) {
out := io.a
}.otherwise {
out := io.a % io.b;
}
}
// is(Div) {
// when(io.b === 0.U) {
// when(io.word_mode) {
// out := (-1).S(32.W).asUInt
// }.otherwise {
// out := (-1).S(64.W).asUInt
// }
// }.otherwise {
// out := (io.a.asSInt / io.b.asSInt).asUInt;
// }
// }
//
// is(Divu) {
// when(io.b === 0.U) {
// out := "xFFFFFFFFFFFFFFFF".U
// }.otherwise {
// out := io.a / io.b;
// }
// }
//
// is(Rem) {
// when(io.b === 0.U) {
// out := io.a
// }.otherwise {
// out := (io.a.asSInt % io.b.asSInt).asUInt;
// }
// }
//
// is(Remu) {
// when(io.b === 0.U) {
// out := io.a
// }.otherwise {
// out := io.a % io.b;
// }
// }
is(And) {
out := op_a & op_b;