Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d188fdb92b8d
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 42c038a11702
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 28, 2019

  1. Copy the full SHA
    1b71f1f View commit details
  2. Copy the full SHA
    29b0b52 View commit details
  3. Copy the full SHA
    42c038a View commit details
Showing with 8 additions and 5 deletions.
  1. +5 −2 software/glasgow/applet/__init__.py
  2. +3 −3 software/glasgow/cli.py
7 changes: 5 additions & 2 deletions software/glasgow/applet/__init__.py
Original file line number Diff line number Diff line change
@@ -216,7 +216,10 @@ def assertBuilds(self, access="direct", args=[]):
parser = argparse.ArgumentParser()
self.applet.add_build_arguments(parser, access_args)

parsed_args = parser.parse_args(args)
try:
parsed_args = parser.parse_args(args)
except SystemExit:
raise AssertionError("argument parsing failed") from None
self.applet.build(target, parsed_args)

target.build_plan().execute()
@@ -283,7 +286,7 @@ async def run_hardware_applet(self, mode):

def synthesis_test(case):
synthesis_available = (shutil.which("yosys") is not None and
shutil.which("arachne-pnr") is not None)
shutil.which("nextpnr-ice40") is not None)

return unittest.skipUnless(synthesis_available, "synthesis not available")(case)

6 changes: 3 additions & 3 deletions software/glasgow/cli.py
Original file line number Diff line number Diff line change
@@ -103,8 +103,8 @@ def add_subparsers(parser, **kwargs):
return subparsers

def add_applet_arg(parser, mode, required=False):
# TODO(py3.7): add required=True
subparsers = add_subparsers(parser, dest="applet", metavar="APPLET")
subparsers.required = required

for applet_name, applet in GlasgowApplet.all_applets.items():
if mode == "test" and not hasattr(applet, "test_cls"):
@@ -292,12 +292,12 @@ def add_run_args(parser):
p_build.add_argument(
"-f", "--filename", metavar="FILENAME", type=str,
help="file to save artifact to (default: <applet-name>.{zip,il,bin})")
add_applet_arg(p_build, mode="build", required=True)
add_applet_arg(p_build, mode="build")

p_test = subparsers.add_parser(
"test", formatter_class=TextHelpFormatter,
help="(advanced) test applet logic without target hardware")
add_applet_arg(p_test, mode="test", required=True)
add_applet_arg(p_test, mode="test")

def factory_serial(arg):
if re.match(r"^\d{8}T\d{6}Z$", arg):