Skip to content

Commit

Permalink
Added stop method
Browse files Browse the repository at this point in the history
Signed-off-by: Anderson Ignacio da Silva <[email protected]>
  • Loading branch information
aignacio committed Oct 31, 2024
1 parent bf84e9c commit 3cbd06e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
12 changes: 10 additions & 2 deletions cocotbext/waves/waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License : MIT license <Check LICENSE>
# Author : Anderson I. da Silva (aignacio) <[email protected]>
# Date : 25.10.2024
# Last Modified Date: 29.10.2024
# Last Modified Date: 31.10.2024
import cocotb
import wavedrom
import json
Expand Down Expand Up @@ -320,7 +320,15 @@ def _close(self):
self.waves["head"] = self.head
self.waves["foot"] = self.foot

def save(self):
def __str__(self):
return str(json.dumps(self.waves))

def stop(self):
self._close()
if self.debug:
print("[Waves - Debug] Stopping sims")

def save_svg(self):
self._close()
if self.debug:
print("[Waves - Debug] Printing JSON Wavedrom")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_gen_ahb_waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License : MIT license <Check LICENSE>
# Author : Anderson I. da Silva (aignacio) <[email protected]>
# Date : 25.10.2024
# Last Modified Date: 25.10.2024
# Last Modified Date: 31.10.2024
import cocotb
import os
import random
Expand Down Expand Up @@ -93,7 +93,7 @@ async def run_test(dut, bp_fn=None, pip_mode=False):

resp = await ahb_master.write(address, value, size, pip=pip_mode, verbose=True)
resp = await ahb_master.read(address, size, pip=pip_mode, verbose=True)
waves.save()
waves.save_svg()
type(resp)
del waves

Expand Down
5 changes: 3 additions & 2 deletions tests/test_gen_ahb_waves_ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License : MIT license <Check LICENSE>
# Author : Anderson I. da Silva (aignacio) <[email protected]>
# Date : 25.10.2024
# Last Modified Date: 26.10.2024
# Last Modified Date: 31.10.2024
import cocotb
import os
import random
Expand Down Expand Up @@ -88,7 +88,8 @@ async def run_test(dut):
resp = await ahb_master.write(address, value, size, pip=pip_mode)
resp = await ahb_master.read(address, size, pip=pip_mode)

waves.save()
print(waves)
waves.save_svg()
waves.save_txt()
type(resp)
del waves
Expand Down
4 changes: 2 additions & 2 deletions tests/test_gen_ahb_waves_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License : MIT license <Check LICENSE>
# Author : Anderson I. da Silva (aignacio) <[email protected]>
# Date : 25.10.2024
# Last Modified Date: 26.10.2024
# Last Modified Date: 31.10.2024
import cocotb
import os
import random
Expand Down Expand Up @@ -79,7 +79,7 @@ async def run_test(dut):
resp = await ahb_master.write(address, value, size, verbose=True)
resp = await ahb_master.read(address, size, verbose=True)
waves.save()
waves.save_txt()
waves.save_svg()
type(resp)
del waves

Expand Down

0 comments on commit 3cbd06e

Please sign in to comment.