diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-10-05 05:30:04 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-10-05 13:07:57 -0600 |
| commit | 3feb806ef5cbcb2ee85890d3f24ebfccf04869b1 (patch) | |
| tree | 862e2745d2aaa3607ea33fd17bfbc8b57f967008 /tb/models/core.py | |
| parent | 4acd900c4602db0353d11bf6841ddadfd80c57b8 (diff) | |
tb: implement block test: smp_sim reset
Diffstat (limited to '')
| -rw-r--r-- | tb/models/core.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tb/models/core.py b/tb/models/core.py new file mode 100644 index 0000000..c32fadb --- /dev/null +++ b/tb/models/core.py @@ -0,0 +1,22 @@ +import random + +import cocotb +from cocotb.triggers import ClockCycles + +class CorePaceModel: + def __init__(self, *, clk, halt, step, bkpt, halted): + self._clk = clk + self._halt = halt + self._step = step + self._bkpt = halted + self._halted = halted + + self._bkpt.value = 0 + self._halted.value = 0 + + async def run(self): + while True: + # Señales de step y halt pueden tomar algunas ciclos en surtir + # efecto, dependiendo de lo que esté ocurriendo en la pipeline + await ClockCycles(self._clk, random.randint(0, 10)) + self._halted.value = self._step.value or self._halt.value |
