Skip to content

Commit

Permalink
Added stats to README
Browse files Browse the repository at this point in the history
  • Loading branch information
b0nbun committed May 26, 2024
1 parent 9d61a2a commit 80b1683
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,10 @@ Success: no issues found in 7 source files

== Статистика

TODO
[source]
----
| ФИО | алг | LoC | code байт | code инстр. | инстр | такт | вариант |
| Гусяков Ратмир Кириллович | hello | 11 | - | 7 | 69 | 895 | asm | risc | neum | mc -> hw | instr | struct | stream | mem | cstr | prob2 | pipeline |
| Гусяков Ратмир Кириллович | prob2 | 34 | - | 26 | 145 | 2222 | asm | risc | neum | mc -> hw | instr | struct | stream | mem | cstr | prob2 | pipeline |
| Гусяков Ратмир Кириллович | gcd | 30 | - | 20 | 148 | 2049 | asm | risc | neum | mc -> hw | instr | struct | stream | mem | cstr | prob2 | pipeline |
----
4 changes: 2 additions & 2 deletions examples/gcd.asm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
hex_prefix: "0x"
hex: "0123456789ABCDEF"
start:
addi $1, $0, 10
addi $2, $0, 20
addi $1, $0, 3233
addi $2, $0, 3127

loop:
beq $2, $0, print_a
Expand Down
4 changes: 4 additions & 0 deletions src/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ class ControlUnit:
mpc: int
data_path: DataPath
_tick: int
_instructions: int

def __init__(self, microcode: list[isa.MInstruction], data_path: DataPath) -> None:
self.microcode = microcode
self.mpc = 0
self.data_path = data_path
self._tick = 0
self._instructions = 0

def tick(self) -> None:
self._tick += 1
Expand All @@ -129,6 +131,8 @@ def signal_latch_mpc(self, mpc_sel: int) -> None:
self.mpc = mpc_sel

def execute_microinstruction(self) -> None:
if self.mpc == 1:
self._instructions += 1
minstr = self.microcode[self.mpc]
logging.debug("executing: %s", minstr)
logging.debug("control_unit: %s", self)
Expand Down

0 comments on commit 80b1683

Please sign in to comment.