Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ nix = [

[project.scripts]
dvsim = "dvsim.cli:main"
dvsim-admin = "dvsim.cli.admin:cli"

################
# BUILD-SYSTEM #
Expand Down
9 changes: 9 additions & 0 deletions src/dvsim/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

"""DVSim CLI."""

from dvsim.cli.run import main

__all__ = ("main",)
48 changes: 48 additions & 0 deletions src/dvsim/cli/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

"""DVSim CLI main entry point."""

from pathlib import Path

import click

from dvsim.report.data import ResultsSummary
from dvsim.report.generate import gen_block_report


@click.group()
def cli() -> None:
"""DVSim Administration tool.

Temporary tool for administration tasks for a DVSim project. The commands
here are experimental and may change at any time. As functionality
stabilises it will be moved over to the main `dvsim` command.
"""


@cli.group()
def report() -> None:
"""Reporting helper commands."""


@report.command()
@click.argument(
"json_path",
type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path),
)
@click.argument(
"output_dir",
type=click.Path(file_okay=False, dir_okay=True, path_type=Path),
)
def gen(json_path: Path, output_dir: Path) -> None:
"""Generate a report from a existing results JSON."""
from dvsim.report.generate import gen_summary_report

results: ResultsSummary = ResultsSummary.load(path=json_path)

gen_summary_report(summary=results, path=output_dir)

for flow_result in results.flow_results.values():
gen_block_report(flow_result, path=output_dir)
4 changes: 0 additions & 4 deletions src/dvsim/cli.py → src/dvsim/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,3 @@ def main() -> None:
if cfg.has_errors():
log.error("Errors were encountered in this run.")
sys.exit(1)


if __name__ == "__main__":
main()
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading