Skip to content

Commit

Permalink
apio verify refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Mar 17, 2024
1 parent 161f204 commit e226a2e
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions apio/commands/verify.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# -*- coding: utf-8 -*-
# -- This file is part of the Apio project
# -- (C) 2016-2019 FPGAwars
# -- Author Jesús Arroyo
# -- (C) 2016-2024 FPGAwars
# -- Authors
# -- * Jesús Arroyo (2016-2019)
# -- * Juan Gonzalez (obijuan) (2019-2024)
# -- Licence GPLv2
"""TODO"""
"""Main implementation of APIO VERIFY command"""

import click

import click
from apio.managers.scons import SCons
from apio import util

# ------------------
# -- CONSTANTS
# ------------------
CMD = "verify" # -- Comand name
BOARD = "board" # -- Option
VERBOSE = "verbose" # -- Option
PROJECT_DIR = "project_dir" # -- Option

@click.command("verify", context_settings=util.context_settings())

@click.command(CMD, context_settings=util.context_settings())
@click.pass_context
@click.option(
"-p",
Expand All @@ -21,17 +31,22 @@
help="Set the target directory for the project.",
)
@click.option(
"-b", "--board", type=str, metavar="board", help="Set the board."
"-b", f"--{BOARD}", type=str, metavar="board", help="Set the board."
)
@click.option(
"-v",
"--verbose",
f"--{VERBOSE}",
is_flag=True,
help="Show the entire output of the command.",
)
def cli(ctx, board, project_dir, verbose):
def cli(ctx, **kwargs):
"""Verify the verilog code."""

# -- Extract the arguments
project_dir = kwargs[PROJECT_DIR]
board = kwargs[BOARD]
verbose = kwargs[VERBOSE]

# -- Crete the scons object
scons = SCons(project_dir)

Expand Down

0 comments on commit e226a2e

Please sign in to comment.