Skip to content

Commit a4af245

Browse files
authored
Merge branch 'amaranth-lang:main' into main
2 parents 189cf1c + aba2300 commit a4af245

File tree

136 files changed

+742
-609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+742
-609
lines changed

.env.toolchain

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AMARANTH_USE_YOSYS=builtin
2+
YOSYS=yowasp-yosys
3+
NEXTPNR_ICE40=yowasp-nextpnr-ice40
4+
ICEPACK=yowasp-icepack
5+
NEXTPNR_ECP5=yowasp-nextpnr-ecp5
6+
ECPPACK=yowasp-ecppack

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

.github/workflows/main.yml

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,60 @@
1-
on: [push, pull_request]
1+
on:
2+
push:
3+
pull_request:
4+
schedule:
5+
- cron: '0 0 * * *' # test daily against git HEAD of dependencies
6+
27
name: CI
38
jobs:
9+
410
test:
511
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version:
15+
- '3.8'
16+
- '3.9'
17+
- '3.10'
18+
- '3.11'
19+
- 'pypy-3.8'
20+
- 'pypy-3.9'
21+
# this version range needs to be synchronized with the one in pyproject.toml
22+
amaranth-version:
23+
- '0.4'
24+
- 'git'
25+
allow-failure:
26+
- true
27+
- false
28+
exclude: # all of these are inverted (this is unfortunately the best way to do this)
29+
- amaranth-version: '0.4'
30+
allow-failure: false
31+
- amaranth-version: 'git'
32+
allow-failure: true
33+
continue-on-error: '${{ matrix.allow-failure }}'
34+
name: "test (${{ matrix.python-version }}, ${{ matrix.amaranth-version }}${{ matrix.allow-failure == 'false' && ', required' || '' }})"
635
steps:
736
- name: Check out source code
8-
uses: actions/checkout@v2
37+
uses: actions/checkout@v3
938
- name: Set up Python
10-
uses: actions/setup-python@v2
11-
- name: Install dependencies
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
- name: Install Amaranth release
43+
if: ${{ matrix.amaranth-version != 'git' }}
1244
run: |
13-
pip install wheel
14-
- name: Test
45+
pip install 'amaranth[builtin-yosys] ==${{ matrix.amaranth-version }}'
46+
- name: Install Amaranth from git
47+
if: ${{ matrix.amaranth-version == 'git' }}
1548
run: |
16-
python setup.py test
49+
pip install 'amaranth[builtin-yosys] @ git+https://github.com/amaranth-lang/amaranth.git'
50+
- name: Run tests
51+
run: |
52+
python -m unittest discover -t . -s amaranth_boards -p '*.py'
53+
54+
required: # group all required workflows into one to avoid reconfiguring this in Actions settings
55+
needs:
56+
- test
57+
if: ${{ always() && !contains(needs.*.result, 'cancelled') }}
58+
runs-on: ubuntu-latest
59+
steps:
60+
- run: ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }}

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Python
2-
*.pyc
3-
/*.egg-info
4-
/.eggs
2+
__pycache__/
3+
*.egg-info
54
/dist
65

6+
# pdm
7+
/.pdm-plugins
8+
/.pdm-python
9+
/.venv
10+
/pdm.lock
11+
712
# misc user-created
813
/build

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2019-2021 Amaranth HDL contributors
1+
Copyright (C) 2019-2023 Amaranth HDL contributors
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

amaranth_boards/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
try:
2-
try:
3-
from importlib import metadata as importlib_metadata # py3.8+ stdlib
4-
except ImportError:
5-
import importlib_metadata # py3.7- shim
2+
from importlib import metadata as importlib_metadata
63
__version__ = importlib_metadata.version(__package__)
4+
del importlib_metadata
75
except ImportError:
86
# No importlib_metadata. This shouldn't normally happen, but some people prefer not installing
97
# packages via pip at all, instead using PYTHONPATH directly or copying the package files into

amaranth_boards/alchitry_au.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import shutil
44

55
from amaranth.build import *
6-
from amaranth.vendor.xilinx_7series import *
6+
from amaranth.vendor import XilinxPlatform
77
from .resources import *
88

99

@@ -20,7 +20,7 @@ def find_loader():
2020
return (loader_prgm, bridge_bin)
2121

2222

23-
class AlchitryAuPlatform(Xilinx7SeriesPlatform):
23+
class AlchitryAuPlatform(XilinxPlatform):
2424
device = "XC7A35T" # Artix 7 33K LEs
2525
package = "FTG256"
2626
speed = "1"

amaranth_boards/arrow_deca.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import subprocess
33

44
from amaranth.build import *
5-
from amaranth.vendor.intel import *
5+
from amaranth.vendor import IntelPlatform
66
from .resources import *
77

88

amaranth_boards/arty_a7.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import os
22
import subprocess
3+
import unittest
34

45
from amaranth.build import *
5-
from amaranth.vendor.xilinx_7series import *
6+
from amaranth.vendor import XilinxPlatform
67
from .resources import *
78

89

910
__all__ = ["ArtyA7_35Platform", "ArtyA7_100Platform"]
1011

1112

12-
class _ArtyA7Platform(Xilinx7SeriesPlatform):
13+
class _ArtyA7Platform(XilinxPlatform):
1314
package = "csg324"
1415
speed = "1L"
1516
default_clk = "clk100"
@@ -225,6 +226,12 @@ class ArtyA7_100Platform(_ArtyA7Platform):
225226
device = "xc7a100ti"
226227

227228

229+
class TestCase(unittest.TestCase):
230+
def test_smoke(self):
231+
from .test.blinky import Blinky
232+
ArtyA7_35Platform().build(Blinky(), do_build=False)
233+
234+
228235
if __name__ == "__main__":
229236
from .test.blinky import *
230237
ArtyA7_35Platform().build(Blinky(), do_program=True)

0 commit comments

Comments
 (0)