Skip to content

Commit 87b4fd8

Browse files
authored
v0.11.2
2 parents 24d7919 + a0e6c2e commit 87b4fd8

File tree

8 files changed

+147
-39
lines changed

8 files changed

+147
-39
lines changed

.github/workflows/Pipeline.yml

Lines changed: 89 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Unit Testing, Coverage Collection, Package, Release, Documentation and Pub
22

33
on: [ push ]
44

5+
defaults:
6+
run:
7+
shell: bash
8+
59
jobs:
610
UnitTesting:
711
name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
@@ -22,7 +26,7 @@ jobs:
2226
python: ${{ env.PYTHON }}
2327

2428
steps:
25-
- name: Checkout repository
29+
- name: Checkout repository
2630
uses: actions/checkout@v2
2731

2832
- name: 🐍 Setup Python ${{ matrix.python }}
@@ -35,7 +39,7 @@ jobs:
3539
python -m pip install --upgrade pip
3640
pip install -r tests/requirements.txt
3741
38-
- name: Run unit tests
42+
- name: Run unit tests
3943
run: |
4044
python -m pytest -rA tests/unit
4145
@@ -49,7 +53,7 @@ jobs:
4953
python: ${{ env.PYTHON }}
5054

5155
steps:
52-
- name: 🔋 Checkout repository
56+
- name: Checkout repository
5357
uses: actions/checkout@v2
5458

5559
- name: 🐍 Setup Python ${{ env.PYTHON }}
@@ -87,7 +91,7 @@ jobs:
8791
coverage-reports: ./coverage.xml
8892

8993
Release:
90-
name: Release Page on GitHub
94+
name: 📝 Create 'Release Page' on GitHub
9195
runs-on: ubuntu-latest
9296

9397
if: startsWith(github.ref, 'refs/tags')
@@ -184,7 +188,7 @@ jobs:
184188
retention-days: 1
185189

186190
PublishOnPyPI:
187-
name: Publish to PyPI
191+
name: 🚀 Publish to PyPI
188192
runs-on: ubuntu-latest
189193

190194
if: startsWith(github.ref, 'refs/tags')
@@ -199,7 +203,7 @@ jobs:
199203
artifact: ${{ env.ARTIFACT }}
200204

201205
steps:
202-
- name: Download artifacts '${{ env.ARTIFACT }}' from 'Package' job
206+
- name: 📥 Download artifacts '${{ env.ARTIFACT }}' from 'Package' job
203207
uses: actions/download-artifact@v2
204208
with:
205209
name: ${{ env.ARTIFACT }}
@@ -222,31 +226,87 @@ jobs:
222226
run: |
223227
twine upload dist/*
224228
229+
VerifyDocs:
230+
name: 👍 Verify example snippets using Python 3.9
231+
runs-on: ubuntu-latest
232+
233+
env:
234+
PYTHON: 3.9
235+
outputs:
236+
python: ${{ env.PYTHON }}
237+
238+
steps:
239+
- name: ⏬ Checkout repository
240+
uses: actions/checkout@v2
241+
242+
- name: ⚙ Setup GHDL
243+
uses: ghdl/setup-ghdl-ci@master
244+
245+
- name: 🐍 Setup Python
246+
uses: actions/setup-python@v2
247+
with:
248+
python-version: ${{ env.PYTHON }}
249+
250+
- name: 🐍 Install dependencies
251+
run: |
252+
pip3 install git+https://github.com/ghdl/ghdl.git@$(ghdl version hash)
253+
254+
- name: ✂ Extract code snippet from README
255+
shell: python
256+
run: |
257+
from pathlib import Path
258+
import re
259+
260+
ROOT = Path('.')
261+
262+
with (ROOT / 'README.md').open('r') as rptr:
263+
content = rptr.read()
264+
265+
m = re.search(r"```py(thon)?(?P<code>.*?)```", content, re.MULTILINE|re.DOTALL)
266+
267+
if m is None:
268+
raise Exception("Regular expression did not find the example in the README!")
269+
270+
with (ROOT / 'tests/docs/example.py').open('w') as wptr:
271+
wptr.write(m["code"])
272+
273+
# - name: Print example.py
274+
# run: cat tests/docs/example.py
275+
276+
- name: ☑ Run example snippet
277+
working-directory: tests/docs
278+
run: |
279+
python3 example.py
280+
281+
225282
BuildTheDocs:
226283
name: 📓 Run BuildTheDocs and publish to GH-Pages
227284
runs-on: ubuntu-latest
228-
steps:
229285

230-
- name: Checkout repository
231-
uses: actions/checkout@v2
286+
needs:
287+
- VerifyDocs
288+
289+
steps:
290+
- name: Checkout repository
291+
uses: actions/checkout@v2
232292

233-
- name: 🚢 Build documentation in 'pyVHDLModel/doc'
234-
run: |
235-
docker build -t vhdl/doc - <<-EOF
236-
FROM btdi/sphinx:featured
237-
RUN apk add -U --no-cache graphviz
238-
EOF
293+
- name: 🚢 Build container image 'vhdl/doc'
294+
run: |
295+
docker build -t vhdl/doc - <<-EOF
296+
FROM btdi/sphinx:featured
297+
RUN apk add -U --no-cache graphviz
298+
EOF
239299
240-
- name: 🛳️ Unknown
241-
uses: buildthedocs/btd@v0
242-
with:
243-
token: ${{ github.token }}
300+
- name: 🛳️ Build documentation from './pyVHDLModel/doc'
301+
uses: buildthedocs/btd@v0
302+
with:
303+
token: ${{ github.token }}
244304

245-
- name: Upload artifacts to GitHub Pages
246-
uses: actions/upload-artifact@master
247-
with:
248-
name: doc
249-
path: doc/_build/html
305+
- name: 📤 Upload artifacts to GitHub Pages
306+
uses: actions/upload-artifact@master
307+
with:
308+
name: doc
309+
path: doc/_build/html
250310

251311
ArtifactCleanUp:
252312
name: 🗑️ Artifact Cleanup
@@ -260,8 +320,8 @@ jobs:
260320
ARTIFACT: ${{ needs.Package.outputs.artifact }}
261321

262322
steps:
263-
- name: 🗑️ Delete all Artifacts
264-
uses: geekyeggo/delete-artifact@v1
265-
with:
266-
name: |
267-
${{ env.ARTIFACT }}
323+
- name: 🗑️ Delete all Artifacts
324+
uses: geekyeggo/delete-artifact@v1
325+
with:
326+
name: |
327+
${{ env.ARTIFACT }}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ from pyGHDL.dom.NonStandard import Design, Document
5757
sourceFile = Path("example.vhdl")
5858

5959
design = Design()
60-
library = Design.GetLibrary("lib")
60+
library = design.GetLibrary("lib")
6161
document = Document(sourceFile)
6262
design.AddDocument(document, library)
6363

6464
for entity in document.Entities:
65-
print("{}".format(entity.Name))
65+
print("{}".format(entity.Identifier))
6666
print(" generics:")
67-
for generic in entity.Generics:
67+
for generic in entity.GenericItems:
6868
print(" - {} : {!s} {}".format(
69-
generic.Identifier, generic.Mode, generic.SubTypeIndication)
69+
generic.Identifier, generic.Mode, generic.Subtype)
7070
)
7171
print(" ports:")
72-
for port in entity.Ports:
72+
for port in entity.PortItems:
7373
print(" - {} : {!s} {}".format(
74-
port.Identifier, port.Mode, port.SubTypeIndication)
74+
port.Identifier, port.Mode, port.Subtype)
7575
)
7676
```
7777

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _LatestTagName():
3737

3838
# The full version, including alpha/beta/rc tags
3939
version = "0.11" # The short X.Y version.
40-
release = "0.11.1" # The full version, including alpha/beta/rc tags.
40+
release = "0.11.2" # The full version, including alpha/beta/rc tags.
4141
try:
4242
if _IsUnderGitControl:
4343
latestTagName = _LatestTagName()[1:] # remove prefix "v"

doc/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ Use Cases
5757
News
5858
****
5959

60+
.. only:: html
61+
62+
Jul. 2021 - First adoption and enhancements
63+
===========================================
64+
65+
.. only:: latex
66+
67+
.. rubric:: First adoption and enhancements
68+
69+
* `GHDL's <https://github.com/ghdl/ghdl>`__ is the first big adopter with `pyGHDL.dom <https://ghdl.github.io/ghdl/pyGHDL/pyGHDL.dom.html>`__
70+
to generate a network of instantiated classes derived from ``pyVHDLModel``. |br|
71+
It uses `pyGHDL <https://ghdl.github.io/ghdl/using/pyGHDL/index.html>`__ as a backend (GHDL build as shared object and
72+
loaded into CPython via C-binding API (``ctypes``).
73+
* ...
74+
75+
6076
.. only:: html
6177

6278
Jun. 2021 - Model and documentation enhancements

pyVHDLModel/VHDLModel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ class AscendingRangeExpression(RangeExpression):
13121312

13131313
@export
13141314
class DescendingRangeExpression(RangeExpression):
1315-
_direction = Direction.To
1315+
_direction = Direction.DownTo
13161316
_FORMAT = ("", " downto ", "")
13171317

13181318

pyVHDLModel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
:copyright: Copyright 2007-2021 Patrick Lehmann - Bötzingen, Germany
4141
:license: Apache License, Version 2.0
4242
"""
43-
__version__ = "0.11.1"
43+
__version__ = "0.11.2"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# Assemble all package information
5454
setuptools_setup(
5555
name=projectName,
56-
version="0.11.1",
56+
version="0.11.2",
5757

5858
author="Patrick Lehmann",
5959
author_email="[email protected]",

tests/docs/example.vhdl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
library ieee;
2+
use ieee.std_logic_1164.all;
3+
use ieee.numeric_std.all;
4+
5+
entity entity_1 is
6+
generic (
7+
FREQ : real := (100.0 * 1024.0 * 1024.0);
8+
BITS : positive := 8
9+
);
10+
port (
11+
Clock: in std_logic;
12+
Reset: in std_logic := '0';
13+
Q: out std_logic_vector(BITS - 1 downto 0)
14+
);
15+
end entity entity_1;
16+
17+
architecture behav of entity_1 is
18+
signal Reset_n : std_logic;
19+
begin
20+
Reset_n <= (not Reset);
21+
22+
process(Clock)
23+
begin
24+
if rising_edge(Clock) then
25+
if Reset_n = '0' then
26+
Q <= (others => '0');
27+
else
28+
Q <= std_logic_vector(unsigned(Q) + 1);
29+
end if;
30+
end if;
31+
end process;
32+
end architecture behav;

0 commit comments

Comments
 (0)