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: 1639a25f35d4
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 96216948ae57
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 6, 2019

  1. cli: allow overriding revision requirement.

    This is useful for hacked revA/B devices that had the FXMA removed
    and replaced with a 0R bank, for 3V3 only operation.
    whitequark committed Aug 6, 2019
    Copy the full SHA
    9621694 View commit details
Showing with 15 additions and 5 deletions.
  1. +15 −5 software/glasgow/cli.py
20 changes: 15 additions & 5 deletions software/glasgow/cli.py
Original file line number Diff line number Diff line change
@@ -198,8 +198,14 @@ def add_toolchain_args(parser):
"--synthesis-opts", metavar="OPTIONS", type=str, default="",
help="(advanced) pass OPTIONS to FPGA synthesis toolchain")

def add_run_args(parser):
def add_build_args(parser):
add_toolchain_args(parser)
parser.add_argument(
"--override-required-revision", default=False, action="store_true",
help="(advanced) override applet revision requirement")

def add_run_args(parser):
add_build_args(parser)
parser.add_argument(
"--rebuild", default=False, action="store_true",
help="rebuild bitstream even if an identical one is already loaded")
@@ -235,7 +241,7 @@ def add_run_args(parser):
p_flash = subparsers.add_parser(
"flash", formatter_class=TextHelpFormatter,
help="program FX2 firmware or applet bitstream into EEPROM")
add_toolchain_args(p_flash)
add_build_args(p_flash)

g_flash_firmware = p_flash.add_mutually_exclusive_group()
g_flash_firmware.add_argument(
@@ -271,7 +277,7 @@ def serial(arg):
p_build = subparsers.add_parser(
"build", formatter_class=TextHelpFormatter,
help="(advanced) build applet logic and save it as a file")
add_toolchain_args(p_build)
add_build_args(p_build)

p_build.add_argument(
"--rev", metavar="REVISION", type=revision, required=True,
@@ -317,9 +323,13 @@ def _applet(revision, args):
with_analyzer=hasattr(args, "trace") and args.trace)
applet = GlasgowApplet.all_applets[args.applet]()
try:
message = ("applet requires device rev{}+, rev{} found"
.format(applet.required_revision, revision))
if revision < applet.required_revision:
raise GlasgowAppletError("applet requires device rev{}+, rev{} found"
.format(applet.required_revision, revision))
if args.override_required_revision:
applet.logger.warn(message)
else:
raise GlasgowAppletError(message)
applet.build(target, args)
except GlasgowAppletError as e:
applet.logger.error(e)