Skip to content

Commit c59ae16

Browse files
Update Memory.scala
1 parent ce49baf commit c59ae16

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

src/main/scala/RISCV/Memory.scala

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,20 @@ class Memory() extends Module {
3737
io.write_vga := isVGA && io.write_1
3838
io.write_value_vga := io.write_value_1
3939

40-
when(io.write_1 && isVGA) {
41-
printf(
42-
"Writing to VGA! Address: %b Data: %b\n",
43-
io.address_1 - 0b1000000000000.U,
44-
io.write_value_1
45-
);
46-
}.otherwise {
47-
printf(
48-
"Writing to Memory! Address: %b Data: %b\n",
49-
io.address_1 - 0b1000000000000.U,
50-
io.write_value_1
51-
);
40+
when(io.write_1) {
41+
when(isVGA) {
42+
printf(
43+
"Writing to VGA! Address: %b Data: %b\n",
44+
io.address_1 - 0b1000000000000.U,
45+
io.write_value_1
46+
);
47+
}.otherwise {
48+
printf(
49+
"Writing to Memory! Address: %b Data: %b\n",
50+
io.address_1 - 0b1000000000000.U,
51+
io.write_value_1
52+
);
53+
}
5254
}
5355

5456
io.read_value_1 := memory.readWrite(

0 commit comments

Comments
 (0)