-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util/sim: Report simulation and CPU time (#91)
* util/sim: Merge `CustomSimulation` into `RTLSimulation` Allows reuse of `RTLSimulation` logic, e.g. for parsing the simulation logs, also for custom simulations run behind the scenes through an RTL simulator. * util/sim: Extract simulation and elapsed time in Questa * util/sim: Print summary as table
- Loading branch information
Showing
5 changed files
with
179 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ pyyaml | |
pytablewriter | ||
termcolor | ||
pandas | ||
prettytable | ||
pyelftools | ||
psutil | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,7 @@ | |
# | ||
# Luca Colagrande <[email protected]> | ||
|
||
from Simulation import QuestaSimulation, VCSSimulation, VerilatorSimulation, BansheeSimulation, \ | ||
CustomSimulation | ||
from Simulation import QuestaSimulation, VCSSimulation, VerilatorSimulation, BansheeSimulation | ||
|
||
|
||
class Simulator(object): | ||
|
@@ -72,9 +71,7 @@ class RTLSimulator(Simulator): | |
A test may need to be run with a custom command, itself invoking | ||
the simulation binary behind the scenes, e.g. for verification | ||
purposes. Such a test carries the custom command (a list of args) | ||
under the `cmd` key. In such case, the RTL simulator constructs a | ||
[CustomSimulation][Simulation.CustomSimulation] object from the | ||
given test, with the custom command and simulation binary. | ||
under the `cmd` key. | ||
""" | ||
|
||
def __init__(self, binary, **kwargs): | ||
|
@@ -89,16 +86,14 @@ def __init__(self, binary, **kwargs): | |
|
||
def get_simulation(self, test): | ||
if 'cmd' in test: | ||
return super().get_simulation( | ||
test, | ||
simulation_cls=CustomSimulation, | ||
sim_bin=self.binary, | ||
cmd=test['cmd']) | ||
cmd = test['cmd'] | ||
else: | ||
return super().get_simulation( | ||
test, | ||
sim_bin=self.binary | ||
) | ||
cmd = None | ||
return super().get_simulation( | ||
test, | ||
sim_bin=self.binary, | ||
cmd=cmd | ||
) | ||
|
||
|
||
class VCSSimulator(RTLSimulator): | ||
|
Oops, something went wrong.