Skip to content

Commit

Permalink
Changed reference to board names to lower case.
Browse files Browse the repository at this point in the history
  • Loading branch information
zapta committed Dec 5, 2024
1 parent d5447ba commit bdcf92b
Show file tree
Hide file tree
Showing 91 changed files with 65 additions and 62 deletions.
38 changes: 19 additions & 19 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"program": "${workspaceFolder}/apio_run.py",
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio boards",
Expand All @@ -21,7 +21,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio build",
Expand All @@ -33,7 +33,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio clean",
Expand All @@ -45,7 +45,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio create",
Expand All @@ -62,7 +62,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio drivers",
Expand All @@ -75,7 +75,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio examples",
Expand All @@ -88,7 +88,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio graph",
Expand All @@ -101,7 +101,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio install",
Expand All @@ -116,7 +116,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio lint",
Expand All @@ -128,7 +128,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio modify",
Expand All @@ -144,7 +144,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio packages",
Expand All @@ -158,7 +158,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio raw",
Expand All @@ -171,7 +171,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio report",
Expand All @@ -183,7 +183,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio system",
Expand All @@ -196,7 +196,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio time",
Expand All @@ -208,7 +208,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio uninstall",
Expand All @@ -221,7 +221,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio upload [alhambra-ii]",
Expand All @@ -233,7 +233,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Apio upload [TinyFPGA-BX]",
Expand Down Expand Up @@ -281,7 +281,7 @@
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${workspaceFolder}/test-examples/Alhambra-II/02-jumping-LED"
"cwd": "${workspaceFolder}/test-examples/alhambra-ii/02-jumping-LED"
},
{
"name": "Attach remote",
Expand Down
17 changes: 10 additions & 7 deletions apio/apio_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,16 @@ def __init__(
resolver = _ProjectResolverImpl(self)
self._project = load_project_from_file(self.project_dir, resolver)

def lookup_board_id(self, board: str) -> str:
def lookup_board_id(
self, board: str, *, warn: bool = True, strict: bool = True
) -> str:
"""Lookup and return the board's canonical board id which is its key
in boards.json(). 'board' can be the canonical id itself or a
legacy id of the board as defined in boards.json. The method exists
with a fatal error if the board is unknown, and prints a warning
message if 'board' is a legacy name rather then the canonical board
id"""
legacy id of the board as defined in boards.json. The method prints
a warning if 'board' is a legacy board id that is mapped to its
canonical name and 'warn' is True. If the board is not found, the
method returns None if 'strict' is False or exit the program with a
message if 'strict' is True."""
# -- If this fails, it's a programming error.
assert board is not None

Expand All @@ -194,15 +197,15 @@ def lookup_board_id(self, board: str) -> str:
break

# -- Fatal error if unknown board.
if canonical_id is None:
if strict and canonical_id is None:
click.secho(f"Error: no such board '{board}'", fg="red")
click.secho(
"\nRun 'apio boards' for the list of board ids.", fg="yellow"
)
sys.exit(1)

# -- Warning if caller used a legacy board id.
if board != canonical_id:
if warn and canonical_id and board != canonical_id:
click.secho(
f"Warning: '{board}' board name was changed. "
f"Please use '{canonical_id}' instead.",
Expand Down
10 changes: 5 additions & 5 deletions apio/managers/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def list_examples(self) -> None:

def copy_example_dir(self, example: str, project_dir: Path, sayno: bool):
"""Copy the example creating the folder
Ex. The example Alhambra-II/ledon --> the folder Alhambra-II/ledon
Ex. The example alhambra-ii/ledon --> the folder alhambra-ii/ledon
is created
* INPUTS:
* example: Example name (Ex. 'Alhambra-II/ledon')
* example: Example name (Ex. 'alhambra-ii/ledon')
* project_dir: (optional)
* sayno: Automatically answer no
"""
Expand Down Expand Up @@ -205,7 +205,7 @@ def copy_example_dir(self, example: str, project_dir: Path, sayno: bool):
def copy_example_files(self, example: str, project_dir: Path, sayno: bool):
"""Copy the example files (not the initial folders)
* INPUTS:
* example: Example name (Ex. 'Alhambra-II/ledon')
* example: Example name (Ex. 'alhambra-ii/ledon')
* project_dir: (optional)
* sayno: Automatically answer no
"""
Expand Down Expand Up @@ -239,7 +239,7 @@ def _copy_files(
):
"""Copy the example files to the destination folder
* INPUTS:
* example: Name of the example (Ex. 'Alhambra-II/ledon')
* example: Name of the example (Ex. 'alhambra-ii/ledon')
* src_path: Source folder to copy
* dest_path: Destination folder
"""
Expand Down Expand Up @@ -304,7 +304,7 @@ def _copy_files(
def _copy_dir(self, example: str, src_path: Path, dest_path: Path):
"""Copy example of the src_path on the dest_path
* INPUT
* example: Name of the example (Ex. 'Alhambra-II/ledon')
* example: Name of the example (Ex. 'alhambra-ii/ledon')
* src_path: Source folder to copy
* dest_path: Destination folder
"""
Expand Down
6 changes: 3 additions & 3 deletions test-boards/Alhambra-II/test_leds.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Testing the ledon example on the Alhambra-II board
Testing the ledon example on the alhambra-ii board
"""

import os
Expand Down Expand Up @@ -30,7 +30,7 @@
cwd = Path.cwd()

# -- Create the new path
ledon_dir = cwd / "test-examples" / "Alhambra-II" / "01-LEDs-buttons"
ledon_dir = cwd / "test-examples" / "alhambra-ii" / "01-LEDs-buttons"

# -- Change to the new folder!
os.chdir(ledon_dir)
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_ledon_verify():


def test_ledon_upload():
"""Test the apio upload. This requires a connected Alhambra-II board."""
"""Test the apio upload. This requires a connected alhambra-ii board."""

# ----------------------------
# -- Execute "apio upload"
Expand Down
4 changes: 2 additions & 2 deletions test-examples/TB/Alhambra-II/icestudio/ledon/ledon_tb.gtkw
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
[*] GTKWave Analyzer v3.4.0 (w)1999-2022 BSI
[*] Wed Nov 20 22:19:57 2024
[*]
[dumpfile] "/Users/user/projects/apio_dev/repo/test-examples/TB/Alhambra-II/icestudio/ledon/_build/ledon_tb.vcd"
[dumpfile] "/Users/user/projects/apio_dev/repo/test-examples/TB/alhambra-ii/icestudio/ledon/_build/ledon_tb.vcd"
[dumpfile_mtime] "Wed Nov 20 22:19:35 2024"
[dumpfile_size] 580
[savefile] "/Users/user/projects/apio_dev/repo/test-examples/TB/Alhambra-II/icestudio/ledon/ledon_tb.gtkw"
[savefile] "/Users/user/projects/apio_dev/repo/test-examples/TB/alhambra-ii/icestudio/ledon/ledon_tb.gtkw"
[timestart] 0
[size] 1000 600
[pos] -1 -1
Expand Down
4 changes: 2 additions & 2 deletions test-examples/TB/Alhambra-II/icestudio/tff/tff_tb.gtkw
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
[*] GTKWave Analyzer v3.3.103 (w)1999-2019 BSI
[*] Thu Apr 28 09:24:55 2022
[*]
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/TB/Alhambra-II/icestudio/tff/tff_tb.vcd"
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/TB/alhambra-ii/icestudio/tff/tff_tb.vcd"
[dumpfile_mtime] "Thu Apr 28 09:24:05 2022"
[dumpfile_size] 1734
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/TB/Alhambra-II/icestudio/tff/tff_tb.gtkw"
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/TB/alhambra-ii/icestudio/tff/tff_tb.gtkw"
[timestart] 0
[size] 1860 1016
[pos] -89 -89
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"id": "65f463c9-91d8-4a92-aafa-fa050e5fc32b",
"type": "basic.info",
"data": {
"info": "# Alhambra-II: LEDs and Buttons test\n\nTesting the LEDs and buttons",
"info": "# alhambra-ii: LEDs and Buttons test\n\nTesting the LEDs and buttons",
"readonly": true
},
"position": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
[*] GTKWave Analyzer v3.3.103 (w)1999-2019 BSI
[*] Thu Apr 28 10:19:00 2022
[*]
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/Alhambra-II/01-LEDs-buttons/01-LEDs-buttons_tb.vcd"
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/alhambra-ii/01-LEDs-buttons/01-LEDs-buttons_tb.vcd"
[dumpfile_mtime] "Thu Apr 28 10:16:09 2022"
[dumpfile_size] 10049
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/Alhambra-II/01-LEDs-buttons/01-LEDs-buttons_tb.gtkw"
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/alhambra-ii/01-LEDs-buttons/01-LEDs-buttons_tb.gtkw"
[timestart] 0
[size] 1000 600
[pos] 793 49
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
[*] GTKWave Analyzer v3.3.103 (w)1999-2019 BSI
[*] Thu Apr 28 10:41:03 2022
[*]
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/Alhambra-II/02-jumping-LED/02-jumping-LED_tb.vcd"
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/alhambra-ii/02-jumping-LED/02-jumping-LED_tb.vcd"
[dumpfile_mtime] "Thu Apr 28 10:38:49 2022"
[dumpfile_size] 739918
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/Alhambra-II/02-jumping-LED/02-jumping-LED_tb.gtkw"
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/alhambra-ii/02-jumping-LED/02-jumping-LED_tb.gtkw"
[timestart] 0
[size] 1860 1016
[pos] 60 27
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"id": "548537d2-05af-4772-8269-4a4a038e8fd5",
"type": "basic.info",
"data": {
"info": "## Alhambra-II: RISC-V stopwatch on LEDs",
"info": "## alhambra-ii: RISC-V stopwatch on LEDs",
"readonly": true
},
"position": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
[*] GTKWave Analyzer v3.3.103 (w)1999-2019 BSI
[*] Thu Apr 28 10:51:01 2022
[*]
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/Alhambra-II/03-riscv-stop-watch/03-riscv-stop-watch_tb.vcd"
[dumpfile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/alhambra-ii/03-riscv-stop-watch/03-riscv-stop-watch_tb.vcd"
[dumpfile_mtime] "Thu Apr 28 10:47:25 2022"
[dumpfile_size] 264544
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/Alhambra-II/03-riscv-stop-watch/03-riscv-stop-watch_tb.gtkw"
[savefile] "/home/obijuan/Develop/FPGAwars/apio/test-examples/alhambra-ii/03-riscv-stop-watch/03-riscv-stop-watch_tb.gtkw"
[timestart] 0
[size] 1920 1043
[pos] 1771 -116
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit bdcf92b

Please sign in to comment.