Skip to content

Commit

Permalink
feat(tapac): add options to use pyslang
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaok committed Jan 15, 2025
1 parent 35d0c7e commit 795c155
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tapa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from tapa.steps.pack import pack
from tapa.steps.synth import synth
from tapa.steps.version import version
from tapa.util import setup_logging
from tapa.util import Options, setup_logging

_logger = logging.getLogger().getChild(__name__)

Expand Down Expand Up @@ -54,17 +54,26 @@
metavar="limit",
help="Override Python recursion limit.",
)
@click.option(
"--enable-pyslang / --disable-pyslang",
type=bool,
default=False,
help="Enable or disable pyslang (experimental).",
)
@click.pass_context
def entry_point(
def entry_point( # noqa: PLR0913,PLR0917
ctx: click.Context,
verbose: bool,
quiet: bool,
work_dir: str,
recursion_limit: int,
enable_pyslang: bool,
) -> None:
"""The TAPA compiler."""
setup_logging(verbose, quiet, work_dir)

Options.enable_pyslang = enable_pyslang

# Setup execution context
ctx.ensure_object(dict)
switch_work_dir(work_dir)
Expand Down
6 changes: 6 additions & 0 deletions tapa/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
AST_IOPort = Input | Output | Inout


class Options:
"""Global configuration options."""

enable_pyslang: bool = False


class PortInfo:
"""Port information extracted from a Verilog module definition."""

Expand Down

0 comments on commit 795c155

Please sign in to comment.