Skip to content

Commit

Permalink
util: Improve simulation classes
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Oct 2, 2024
1 parent a90b4f5 commit 6b47e95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion util/sim/Simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def __init__(self, elf=None, dry_run=False, retcode=0, run_dir=None, name=None):
self.dry_run = dry_run
self.run_dir = run_dir if run_dir is not None else Path.cwd()
if name is None:
self.testname = Path(self.elf).stem
if self.elf is not None:
self.testname = Path(self.elf).stem
else:
self.testname = name
self.cmd = []
Expand Down
10 changes: 5 additions & 5 deletions util/sim/Simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Luca Colagrande <[email protected]>

from Simulation import QuestaSimulation, VCSSimulation, VerilatorSimulation, BansheeSimulation
from snitch.util.sim import Simulation


class Simulator(object):
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, binary):
Arguments:
binary: The VCS simulation binary.
"""
super().__init__(binary, name='vcs', simulation_cls=VCSSimulation)
super().__init__(binary, name='vcs', simulation_cls=Simulation.VCSSimulation)


class QuestaSimulator(RTLSimulator):
Expand All @@ -128,7 +128,7 @@ def __init__(self, binary):
Arguments:
binary: The QuestaSim simulation binary.
"""
super().__init__(binary, name='vsim', simulation_cls=QuestaSimulation)
super().__init__(binary, name='vsim', simulation_cls=Simulation.QuestaSimulation)


class VerilatorSimulator(RTLSimulator):
Expand All @@ -145,7 +145,7 @@ def __init__(self, binary):
Arguments:
binary: The Verilator simulation binary.
"""
super().__init__(binary, name='verilator', simulation_cls=VerilatorSimulation)
super().__init__(binary, name='verilator', simulation_cls=Simulation.VerilatorSimulation)


class BansheeSimulator(Simulator):
Expand All @@ -161,7 +161,7 @@ def __init__(self, cfg):
Arguments:
cfg: A Banshee config file.
"""
super().__init__(name='banshee', simulation_cls=BansheeSimulation)
super().__init__(name='banshee', simulation_cls=Simulation.BansheeSimulation)
self.cfg = cfg

def supports(self, test):
Expand Down

0 comments on commit 6b47e95

Please sign in to comment.