Compare commits
235 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
4c067fdf9b | |
|
|
b7dc18c157 | |
|
|
4580a83ea1 | |
|
|
99d18a3b96 | |
|
|
9e41eecfef | |
|
|
39a399c2c6 | |
|
|
7b9e9128fe | |
|
|
650058d9f9 | |
|
|
e980d5ec92 | |
|
|
4aef763290 | |
|
|
4d1ba8dd47 | |
|
|
f2bd0a19af | |
|
|
76461a18fd | |
|
|
6dd1d02da2 | |
|
|
9895b186d2 | |
|
|
d2476547e6 | |
|
|
d80fb9cba6 | |
|
|
526fb1c02f | |
|
|
a895557eee | |
|
|
00e59113f7 | |
|
|
c5da187a28 | |
|
|
66fe9beff8 | |
|
|
766d2769a6 | |
|
|
87322afefd | |
|
|
952374fbcd | |
|
|
6704c7ada7 | |
|
|
d8e5ff06e7 | |
|
|
919571fd7c | |
|
|
b1da5292ff | |
|
|
df56e50412 | |
|
|
d8b8d31429 | |
|
|
f95e083590 | |
|
|
1cb53b68c4 | |
|
|
a6a8029be9 | |
|
|
9b4bf6c53b | |
|
|
55897f59ae | |
|
|
0e63ad0b53 | |
|
|
ce1321963e | |
|
|
658d769d95 | |
|
|
dc3d81da0e | |
|
|
26055b82cb | |
|
|
e12f19776f | |
|
|
62b1c8866b | |
|
|
ced3e55be4 | |
|
|
69a37ddad8 | |
|
|
2fd4c598ad | |
|
|
c8be0e59d3 | |
|
|
0f7cacce29 | |
|
|
0e98e93e21 | |
|
|
2e2f14fe68 | |
|
|
4c31f919e8 | |
|
|
24e7ac4a77 | |
|
|
0a703814d9 | |
|
|
4019c18370 | |
|
|
f6384a6975 | |
|
|
5d8ddb2763 | |
|
|
8e69d9b7e8 | |
|
|
9fec7fb0ec | |
|
|
885cc99b0a | |
|
|
3c2f1f497f | |
|
|
f53e76177f | |
|
|
ba3c1cada8 | |
|
|
6c07b90ecc | |
|
|
8b10cc622c | |
|
|
5a94cf3a5c | |
|
|
df3b61b61d | |
|
|
7f5aaf886c | |
|
|
2789048cc4 | |
|
|
d9b61c97c3 | |
|
|
873bb37a9b | |
|
|
355bc24f5c | |
|
|
47b8c62aee | |
|
|
7ba1ffaeac | |
|
|
24bcf8ac36 | |
|
|
fe33a92014 | |
|
|
3e259fe369 | |
|
|
0f075470a9 | |
|
|
b89739930f | |
|
|
2c74747343 | |
|
|
9a2414e4bd | |
|
|
39388ffd70 | |
|
|
13a797b648 | |
|
|
5218ff9a35 | |
|
|
52ad5c735b | |
|
|
b940b390bf | |
|
|
d9d74f90c1 | |
|
|
221c7095b0 | |
|
|
a3c97a8c80 | |
|
|
1256425cab | |
|
|
5ba7d3a631 | |
|
|
67e1fdb938 | |
|
|
380226beb1 | |
|
|
7610bfa8af | |
|
|
d635a87ff9 | |
|
|
c15e4ff3f8 | |
|
|
b4861c54e9 | |
|
|
b748bf46b8 | |
|
|
c2fa867657 | |
|
|
c761b127b0 | |
|
|
330cc57b69 | |
|
|
c283820389 | |
|
|
938d464a8a | |
|
|
29e3b3dbce | |
|
|
824529c5bb | |
|
|
031bf74b88 | |
|
|
620a669c3a | |
|
|
cc92d1c4a5 | |
|
|
ce4e5c6a3c | |
|
|
f23cd2ac21 | |
|
|
6b60143601 | |
|
|
ef7b4b421f | |
|
|
9f25f8f573 | |
|
|
b7fc82c990 | |
|
|
2a5f39c6c7 | |
|
|
0e00cb320d | |
|
|
b6bcd8cea3 | |
|
|
69fcaa886e | |
|
|
4234d92254 | |
|
|
f334bbfe19 | |
|
|
0a5e452110 | |
|
|
b982da5fb4 | |
|
|
a26f66b1c6 | |
|
|
cb4eb92ff3 | |
|
|
dabc7b2739 | |
|
|
a0b8ac4da3 | |
|
|
04cf277b54 | |
|
|
84fa22954f | |
|
|
4dfbf9aa6b | |
|
|
718e2e187b | |
|
|
f62164286a | |
|
|
955408c5ca | |
|
|
2291adb404 | |
|
|
00f99e5b99 | |
|
|
a442ebeccd | |
|
|
3cc968d6af | |
|
|
8adacd4875 | |
|
|
090d88acb6 | |
|
|
313d9c7bcb | |
|
|
d87a3b1ed9 | |
|
|
1912c2029d | |
|
|
2a265d6c1f | |
|
|
911d45f44d | |
|
|
883b31ea91 | |
|
|
54c3c7ab85 | |
|
|
cb3c3f3e27 | |
|
|
3f63fbb6ad | |
|
|
d098bbf69c | |
|
|
f93a46d4fd | |
|
|
9e7ced14f2 | |
|
|
cf1f9f2908 | |
|
|
9bff28afdc | |
|
|
b14326740d | |
|
|
3d199b19f9 | |
|
|
207af67aa7 | |
|
|
a8e061a92f | |
|
|
068f9102ef | |
|
|
1769e08256 | |
|
|
6142e0ffd7 | |
|
|
3b6612a0da | |
|
|
a00e62db5f | |
|
|
a73054725f | |
|
|
5fa097a564 | |
|
|
043ee7a0f9 | |
|
|
259dcb4d9f | |
|
|
3076bf8efd | |
|
|
4015087748 | |
|
|
84033315bc | |
|
|
533c5658ed | |
|
|
df74d35558 | |
|
|
fe7987e093 | |
|
|
09a9be953f | |
|
|
d0ec87909e | |
|
|
eea06c9dee | |
|
|
4762013289 | |
|
|
989c4b9a7f | |
|
|
1e0a3b30eb | |
|
|
72d0391b29 | |
|
|
d75437c771 | |
|
|
d48d2cb03a | |
|
|
d996b7d227 | |
|
|
82d18f907b | |
|
|
cda8132232 | |
|
|
5d03cc8b37 | |
|
|
81de9b06b0 | |
|
|
a6c264075d | |
|
|
ee67ef0a73 | |
|
|
2b5670a62b | |
|
|
5a6c3e45ec | |
|
|
070699cea8 | |
|
|
d70b72c4b8 | |
|
|
e866be03e8 | |
|
|
fceac27841 | |
|
|
ecd955d686 | |
|
|
040405f3ad | |
|
|
e22edf0d71 | |
|
|
84f62f3b6e | |
|
|
4b56079fd8 | |
|
|
7a7ad605b4 | |
|
|
c786afbd67 | |
|
|
587052b276 | |
|
|
e02087dc8f | |
|
|
54fb8761bb | |
|
|
285768d3eb | |
|
|
bd8541b702 | |
|
|
a595084ffa | |
|
|
4cb3be55f5 | |
|
|
6a68806d9e | |
|
|
c3b9b537a9 | |
|
|
78cd5ec485 | |
|
|
a6e745c809 | |
|
|
4c0120a5a4 | |
|
|
78b7cf3bb6 | |
|
|
aecb5f63b9 | |
|
|
bf5057891c | |
|
|
3d58538005 | |
|
|
c5184bf694 | |
|
|
399ef06989 | |
|
|
54405d9e8e | |
|
|
d6422f774d | |
|
|
cc678cb21f | |
|
|
12473270ea | |
|
|
009cb1b0e0 | |
|
|
8e16b801d6 | |
|
|
286d592642 | |
|
|
431504ecbc | |
|
|
4b43d5744a | |
|
|
d34592f34b | |
|
|
ec4910cd0f | |
|
|
28ff282b79 | |
|
|
83a6e68f03 | |
|
|
75cbdfe002 | |
|
|
b9607b0267 | |
|
|
6b15d115c0 | |
|
|
96b9be47d2 | |
|
|
5669062a64 |
|
|
@ -14,6 +14,7 @@ on:
|
|||
env:
|
||||
BUILD_PYTHON_FOR_BUILD: "3.10"
|
||||
BUILD_PYTHON_FOR_BUILD_ALIAS: "py310"
|
||||
SKIP_TEST_ON_GITHUB: "True"
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
|
|
@ -98,6 +99,7 @@ jobs:
|
|||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
- "3.13"
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@ release_notes.txt
|
|||
# IDE files
|
||||
.idea/
|
||||
.vscode/
|
||||
venv
|
||||
.venv/
|
||||
.uv-cache/
|
||||
.uv-python/
|
||||
.ci-*/
|
||||
.package-build/
|
||||
|
||||
# Ignore external repos used for tests
|
||||
tests/external_repos/repos
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ repos:
|
|||
exclude: '^(.*\.vhd|.*\.svg)$'
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
|
|
@ -63,14 +63,14 @@ repos:
|
|||
)$"
|
||||
- id: fix-encoding-pragma
|
||||
|
||||
- repo: https://github.com/mgedmin/check-manifest
|
||||
rev: "0.49"
|
||||
hooks:
|
||||
- id: check-manifest
|
||||
additional_dependencies:
|
||||
- setuptools-git-versioning
|
||||
args:
|
||||
- --no-build-isolation
|
||||
# - repo: https://github.com/mgedmin/check-manifest
|
||||
# rev: "0.50"
|
||||
# hooks:
|
||||
# - id: check-manifest
|
||||
# additional_dependencies:
|
||||
# - setuptools-git-versioning
|
||||
# args:
|
||||
# - --no-build-isolation
|
||||
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.2.6
|
||||
|
|
|
|||
|
|
@ -0,0 +1,104 @@
|
|||
# Authorship, LLM Use, and Safety Disclosure
|
||||
|
||||
This document describes the narrow stream-integration fork of VSG: how it was
|
||||
developed, where an LLM was used, what is tested, and which operations can
|
||||
affect source code. It does not make claims about the development process of
|
||||
the complete upstream project.
|
||||
|
||||
## Authorship
|
||||
|
||||
The original VSG parser, rule library, fix engine, command-line application,
|
||||
and most of this repository predate the fork. They are the work of Jeremy C.
|
||||
Leary and upstream contributors. The fork maintainer chose the integration
|
||||
requirements, keeps the patch set deliberately narrow, and accepts releases.
|
||||
|
||||
The fork-specific standard-input and standard-output integration,
|
||||
machine-readable diagnostics, rule-scoped fix adapter, packaging automation,
|
||||
tests, and related documentation were developed or refined with an LLM coding
|
||||
assistant under maintainer direction. Development has been iterative, so this
|
||||
repository does not claim reliable line-by-line attribution between human and
|
||||
LLM-assisted work. The fork commits above the tracked upstream branch keep the
|
||||
integration changes reviewable as a separate patch series.
|
||||
|
||||
## What the fork adds
|
||||
|
||||
The fork builds on VSG's existing `--stdin` and `--no-failure` options and adds
|
||||
a small command-line boundary around existing behavior:
|
||||
|
||||
- `--diagnostics_json` emits a versioned diagnostic document;
|
||||
- `--stdout` emits corrected VHDL instead of writing it to a source file;
|
||||
- `--fix_rule RULE:LINE` adapts a selection to VSG's existing `--fix_only`
|
||||
mechanism; and
|
||||
- packaging and CI exercise the complete stream interface as an installed
|
||||
artifact.
|
||||
|
||||
The parser, rules, phase ordering, and correction engine remain VSG's. The fork
|
||||
does not add a second VHDL parser or formatter.
|
||||
|
||||
## Diagnostic JSON and side effects
|
||||
|
||||
`--diagnostics_json` requires `--stdin` and is incompatible with fixing and
|
||||
other options that claim standard output. VSG parses the submitted text and
|
||||
runs its normal rules, then serializes the resulting findings and effective
|
||||
rule metadata. The JSON does not contain or execute replacement text and does
|
||||
not introduce a path that writes back to the submitted source.
|
||||
|
||||
In this mode, producing JSON cannot change the VHDL, its behavior, or its
|
||||
formatting. Output is always one valid JSON document: successful analysis is
|
||||
marked complete, while argument, configuration, parsing, or unexpected failures
|
||||
produce an incomplete envelope with empty findings and structured error
|
||||
metadata. Details may also go to standard error. The process does not use or
|
||||
contact an LLM at runtime.
|
||||
|
||||
This source-integrity statement is specifically about diagnostic mode. VSG
|
||||
still reads explicitly supplied configuration and local-rule files, and local
|
||||
rules are Python code that must be trusted. Operating-system logging, wrappers,
|
||||
or custom rules are outside this fork's boundary.
|
||||
|
||||
Fixing is intentionally different. With `--stdin --fix --stdout`, VSG returns
|
||||
corrected VHDL on standard output and does not write the input to a source file;
|
||||
a caller such as the bridge may choose to apply that output. If parsing or
|
||||
fixing cannot complete, this stream mode returns the original input unchanged;
|
||||
an empty or partial result is never presented as a correction. Existing VSG
|
||||
file workflows retain their upstream behavior, including any explicitly
|
||||
requested file changes.
|
||||
|
||||
## What is tested
|
||||
|
||||
Focused fork tests cover:
|
||||
|
||||
- required and conflicting option validation;
|
||||
- deterministic, versioned JSON and empty diagnostic collections;
|
||||
- effective severity, fixability, documentation metadata, and Unicode text;
|
||||
- invalid VHDL, invalid configuration, and unexpected failures with a valid
|
||||
incomplete JSON document, including parser locations when available;
|
||||
- rule selector parsing, validation, and deduplication;
|
||||
- selected rules on the same line and across correction phases;
|
||||
- corrections that insert lines; and
|
||||
- unchanged output when a selected rule is unknown.
|
||||
|
||||
CI also runs the upstream unit and style suites, builds both wheel and source
|
||||
distributions, and installs and smoke-tests the wheel through both pip and uv.
|
||||
The smoke tests exercise stdin/stdout formatting from the installed artifact.
|
||||
|
||||
The tests cover known cases; they are not formal verification. In particular,
|
||||
they do not prove VHDL semantic equivalence after formatting, cover every
|
||||
third-party local rule, or remove upstream parser limitations such as embedded
|
||||
PSL and VHDL 2019.
|
||||
|
||||
## Risk by operation
|
||||
|
||||
| Operation | Source-change risk | Main remaining risk |
|
||||
| --- | --- | --- |
|
||||
| `--stdin --diagnostics_json` | None by design | A finding or its metadata may be incomplete or incorrect. |
|
||||
| `--stdin --stdout --fix` | Returns changed text by design | Applying the output may introduce an unwanted formatting change. |
|
||||
| `--fix_rule` | Returns selected changes by design | Correction phases can move later findings, making original line selections stale. |
|
||||
| Existing file-based VSG commands | Unchanged by the fork | They retain the behavior and risks documented by upstream VSG. |
|
||||
|
||||
The machine interface uses one-based line ranges because VSG does not provide
|
||||
generally valid character spans. Consumers must validate the schema and must
|
||||
not reinterpret internal token indexes as source columns.
|
||||
|
||||
For important or safety-critical HDL, keep work in version control, inspect
|
||||
corrected output, and run the normal simulation, synthesis, linting, and review
|
||||
process before accepting a change.
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
// Add the Gitea webhook configured for this Jenkins installation.
|
||||
|
||||
pipeline {
|
||||
agent { label 'rust_no_docker' }
|
||||
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
skipDefaultCheckout(true)
|
||||
}
|
||||
|
||||
environment {
|
||||
PYTHONUNBUFFERED = '1'
|
||||
UV_CACHE_DIR = "${WORKSPACE}/.uv-cache"
|
||||
UV_PYTHON_INSTALL_DIR = "${WORKSPACE}/.uv-python"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
deleteDir()
|
||||
checkout scm
|
||||
sh 'git fetch --force --tags origin'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Set up development environment') {
|
||||
steps {
|
||||
sh '''
|
||||
set -eu
|
||||
command -v uv >/dev/null 2>&1 || {
|
||||
echo "ERROR: uv is required on the Jenkins worker." >&2
|
||||
exit 1
|
||||
}
|
||||
uv --version
|
||||
command -v python3
|
||||
python3 --version
|
||||
uv venv --python python3 .venv
|
||||
uv pip install --python .venv/bin/python -e '.[tests,dev]'
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Style') {
|
||||
steps {
|
||||
sh 'uv run --no-sync pre-commit run --all-files'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Tests') {
|
||||
steps {
|
||||
sh 'uv run --no-sync python -m unittest'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build package') {
|
||||
steps {
|
||||
sh './build-package.sh'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Wheel install with pip') {
|
||||
steps {
|
||||
sh '''
|
||||
set -eu
|
||||
wheel="$(find dist -maxdepth 1 -type f -name 'vsg-*.whl' -print -quit)"
|
||||
test -n "${wheel}" || {
|
||||
echo "ERROR: built wheel was not found." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
python3 -m venv .ci-pip-venv
|
||||
.ci-pip-venv/bin/python -m pip install "${wheel}"
|
||||
|
||||
output="$(
|
||||
printf 'entity smoke is\nend entity smoke;\n' |
|
||||
.ci-pip-venv/bin/vsg --stdin --stdout --fix --style jcl --no-failure
|
||||
)"
|
||||
printf '%s\n' "${output}" | grep -F 'entity SMOKE is'
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Wheel install with uv') {
|
||||
steps {
|
||||
sh '''
|
||||
set -eu
|
||||
wheel="$(find dist -maxdepth 1 -type f -name 'vsg-*.whl' -print -quit)"
|
||||
test -n "${wheel}" || {
|
||||
echo "ERROR: built wheel was not found." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
uv venv --python .venv/bin/python .ci-uv-venv
|
||||
uv pip install --python .ci-uv-venv/bin/python "${wheel}"
|
||||
|
||||
output="$(
|
||||
printf 'entity smoke is\nend entity smoke;\n' |
|
||||
.ci-uv-venv/bin/vsg --stdin --stdout --fix --style jcl --no-failure
|
||||
)"
|
||||
printf '%s\n' "${output}" | grep -F 'entity SMOKE is'
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive package') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'dist/*', fingerprint: true, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish package') {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
steps {
|
||||
withCredentials([
|
||||
string(
|
||||
credentialsId: 'vsg-gitea-package-token',
|
||||
variable: 'GITEA_TOKEN'
|
||||
)
|
||||
]) {
|
||||
sh '''
|
||||
set +x
|
||||
set -eu
|
||||
|
||||
test -n "${GITEA_TOKEN}" || {
|
||||
echo "ERROR: Jenkins supplied an empty Gitea package token." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
for artifact in dist/vsg-*.tar.gz dist/vsg-*.whl; do
|
||||
test -f "${artifact}" || {
|
||||
echo "ERROR: expected package artifact was not found: ${artifact}" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
|
||||
UV_PUBLISH_USERNAME='Dandaedre' \
|
||||
UV_PUBLISH_PASSWORD="${GITEA_TOKEN}" \
|
||||
uv publish \
|
||||
--publish-url 'https://proxy.dandaedre.com/gitea/api/packages/MadGobblins/pypi' \
|
||||
--check-url 'https://proxy.dandaedre.com/gitea/api/packages/MadGobblins/pypi/simple/' \
|
||||
--no-attestations \
|
||||
dist/vsg-*.tar.gz \
|
||||
dist/vsg-*.whl
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
publishChecks(
|
||||
conclusion: 'SUCCESS',
|
||||
name: 'VSG fork CI',
|
||||
summary: 'VSG tests and package installation checks passed.',
|
||||
text: 'The wheel was tested through both pip and uv, including stdin/stdout formatting.',
|
||||
title: 'Build Successful'
|
||||
)
|
||||
}
|
||||
failure {
|
||||
publishChecks(
|
||||
conclusion: 'FAILURE',
|
||||
name: 'VSG fork CI',
|
||||
summary: 'A VSG fork check failed.',
|
||||
text: 'Review the Jenkins log for style, tests, build, installation, or publishing failures.',
|
||||
title: 'Build Failed'
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
98
README.rst
98
README.rst
|
|
@ -22,28 +22,14 @@ VHDL Style Guide (VSG)
|
|||
Announcements
|
||||
-------------
|
||||
|
||||
Update 01/01/2025
|
||||
Update 11/09/2025
|
||||
|
||||
The regex definitions for camelCase and PascalCase are going to be changing for release 3.30.0 to better align with industry "standards".
|
||||
Where has Jeremy been?
|
||||
|
||||
The current regex allows for an unlimited number of uppercase characters in a row:
|
||||
Just wanted to let everyone know that I have not abandoned this project.
|
||||
There was a family emergency I had to handle and now work is taking a significant amount of my time.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
myFIFO
|
||||
MyFIFO
|
||||
|
||||
A more strict version of camelCase and PascalCase will be implemented to limit the number of consecutive uppercase characters to 2.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
myFIfo
|
||||
MyFIfo
|
||||
|
||||
The original regex definition for camelCase will be moved to relaxedCamelCase.
|
||||
The original regex definition for PascalCase will be moved to RelaxedPascalCase.
|
||||
|
||||
If you have a strong opinion on how the regex is defined, your feedback would be appreciated on issue #1202.
|
||||
I plan to start working on this again in December.
|
||||
|
||||
Regards,
|
||||
|
||||
|
|
@ -162,6 +148,80 @@ Build locally, artifacts will appear in ``dist`` directory.
|
|||
|
||||
tox
|
||||
|
||||
Fork for ``vsg_bridge_ls``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This fork adds stream integration options so VSG can serve editor buffers.
|
||||
``--diagnostics_json`` reads VHDL from ``--stdin`` and always writes one
|
||||
versioned JSON diagnostic document to standard output. Failed analysis is a
|
||||
valid document marked incomplete rather than missing or malformed JSON. Parser
|
||||
failures include their best available one-based line and column so an editor can
|
||||
replace stale style findings with a useful syntax error.
|
||||
``--stdout`` writes fixed VHDL to standard output; if stdin cannot be parsed or
|
||||
fixing otherwise fails, it returns the original input unchanged so callers get
|
||||
a safe no-op rather than an empty replacement. Repeatable ``--fix_rule
|
||||
RULE:LINE`` arguments restrict
|
||||
``--fix`` to selected rules and one-based lines; they require ``--fix`` and
|
||||
cannot be combined with ``--fix_only``. ``--no-failure`` permits diagnostic
|
||||
findings without a nonzero process status. It is the VSG backend required for
|
||||
`vsg_bridge_ls <https://proxy.dandaedre.com/gitea/MadGobblins/vsg-bridge-ls>`_.
|
||||
The bridge README is the main user guide for installing both projects and
|
||||
configuring an editor.
|
||||
|
||||
LLM disclosure and safety
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* **Human foundation:** the original VSG parser, rules, fix engine, and command
|
||||
line tool predate this fork and are the work of Jeremy C. Leary and upstream
|
||||
contributors. The fork maintainer chooses its scope and accepts releases.
|
||||
* **LLM-assisted work:** the fork-specific stream interface, machine-readable
|
||||
diagnostics, scoped-fix adapter, packaging, tests, and related documentation
|
||||
were developed or refined with an LLM coding assistant under maintainer
|
||||
direction.
|
||||
* **What is tested:** focused tests cover option validation, deterministic JSON,
|
||||
Unicode, clean and invalid input, stdout/stderr separation, selected fixes,
|
||||
and unchanged output for an unknown rule. CI also runs the upstream test and
|
||||
style suites, builds the package, and smoke-tests installed wheels through
|
||||
both pip and uv. Tests reduce risk; they do not prove the absence of defects.
|
||||
* **Practical risk:** ``--diagnostics_json`` only serializes information
|
||||
collected during normal parsing and rule analysis. It does not modify the
|
||||
submitted VHDL, change formatting, write the source file, or use an LLM at
|
||||
runtime. Existing VSG behavior is unchanged when the fork options are absent.
|
||||
Explicit ``--fix``/``--stdout`` operations are different: they intentionally
|
||||
return corrected VHDL, which a caller may then apply. Review generated edits
|
||||
and use version control, especially for safety-critical HDL. See the
|
||||
`full authorship, testing, and risk disclosure <DISCLOSURE.md>`_ for details.
|
||||
|
||||
The preferred installation uses uv and the prebuilt Gitea package:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
uv venv .venv
|
||||
uv pip install --python .venv/bin/python \
|
||||
--index https://proxy.dandaedre.com/gitea/api/packages/MadGobblins/pypi/simple/ \
|
||||
vsg
|
||||
|
||||
Installing from ``master`` also works with uv, and either source works with
|
||||
standard pip. See the bridge's
|
||||
`installation guide <https://proxy.dandaedre.com/gitea/MadGobblins/vsg-bridge-ls/src/branch/main/doc/installation.md>`_
|
||||
for all supported commands and environment setup.
|
||||
|
||||
Fork maintainers can build locally with ``./build-package.sh`` and publish the
|
||||
new artifacts with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./build-package.sh ../gitea_token.txt --publish
|
||||
|
||||
On ``master``, Jenkins fetches the Git tags used by
|
||||
``setuptools-git-versioning``, runs both installation smoke tests, archives the
|
||||
generated distributions, and publishes those exact artifacts to Gitea. The
|
||||
required Jenkins credential is documented in the bridge development guide.
|
||||
|
||||
Use ``./update-fork.sh`` to fetch upstream tags and rebase the small fork patch
|
||||
series onto the latest upstream ``master``. The script requires a clean
|
||||
worktree and automatically aborts a failed rebase.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,135 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
show_help() {
|
||||
cat <<'EOF'
|
||||
Usage: ./build-package.sh [TOKEN_FILE] [--publish]
|
||||
|
||||
Build the VSG source distribution and wheel. With --publish, upload the newly
|
||||
built artifacts to Gitea. TOKEN_FILE overrides all other token sources.
|
||||
|
||||
Optional publishing settings:
|
||||
GITEA_TOKEN token value used when TOKEN_FILE is omitted
|
||||
GITEA_TOKEN_FILE
|
||||
token file used when TOKEN_FILE and GITEA_TOKEN are omitted
|
||||
(default: ../gitea_token.txt)
|
||||
GITEA_USERNAME Gitea login name (default: Dandaedre)
|
||||
GITEA_OWNER package owner (default: MadGobblins)
|
||||
GITEA_URL Gitea base URL (default: https://proxy.dandaedre.com/gitea)
|
||||
EOF
|
||||
}
|
||||
|
||||
fail_usage() {
|
||||
echo "ERROR: $1" >&2
|
||||
show_help >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
publish=false
|
||||
token_file_argument=""
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--publish)
|
||||
[ "${publish}" = false ] || fail_usage "--publish was specified more than once."
|
||||
publish=true
|
||||
;;
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
fail_usage "unknown option: $1"
|
||||
;;
|
||||
*)
|
||||
[ -z "${token_file_argument}" ] || fail_usage "more than one token file was specified."
|
||||
token_file_argument="$1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -n "${token_file_argument}" ] && [ "${publish}" = false ]; then
|
||||
fail_usage "TOKEN_FILE requires --publish."
|
||||
fi
|
||||
|
||||
repo_root="$(git rev-parse --show-toplevel 2>/dev/null)" || {
|
||||
echo "ERROR: build-package.sh must run inside a Git worktree." >&2
|
||||
exit 1
|
||||
}
|
||||
gitea_token="${GITEA_TOKEN:-}"
|
||||
if [ -n "${token_file_argument}" ]; then
|
||||
gitea_token=""
|
||||
gitea_token_file="${token_file_argument}"
|
||||
else
|
||||
gitea_token_file="${GITEA_TOKEN_FILE:-${repo_root}/../gitea_token.txt}"
|
||||
fi
|
||||
if [ "${publish}" = true ] && [ -z "${gitea_token}" ]; then
|
||||
if [ ! -f "${gitea_token_file}" ] || [ ! -r "${gitea_token_file}" ]; then
|
||||
fail_usage "token file is not a readable regular file: ${gitea_token_file}"
|
||||
fi
|
||||
IFS= read -r gitea_token <"${gitea_token_file}" || :
|
||||
fi
|
||||
if [ "${publish}" = true ] && [ -z "${gitea_token}" ]; then
|
||||
fail_usage "token file is empty: ${gitea_token_file}"
|
||||
fi
|
||||
|
||||
cd "${repo_root}"
|
||||
|
||||
if ! command -v uv >/dev/null 2>&1; then
|
||||
echo "ERROR: uv is required to build the package." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -x .venv/bin/python ]; then
|
||||
echo "Creating the required local virtual environment..."
|
||||
uv venv .venv
|
||||
fi
|
||||
|
||||
readonly build_dir=".package-build"
|
||||
if [ -e "${build_dir}" ]; then
|
||||
rm -rf -- "${build_dir}"
|
||||
fi
|
||||
|
||||
echo "Building the source distribution and wheel..."
|
||||
uv build --no-sources --out-dir "${build_dir}"
|
||||
|
||||
shopt -s nullglob
|
||||
artifacts=("${build_dir}"/vsg-*.tar.gz "${build_dir}"/vsg-*.whl)
|
||||
if [ "${#artifacts[@]}" -lt 2 ]; then
|
||||
echo "ERROR: uv build completed without producing both expected package formats." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p dist
|
||||
built_artifacts=()
|
||||
for artifact in "${artifacts[@]}"; do
|
||||
destination="dist/${artifact##*/}"
|
||||
cp -- "${artifact}" "${destination}"
|
||||
built_artifacts+=("${destination}")
|
||||
done
|
||||
rm -rf -- "${build_dir}"
|
||||
|
||||
echo "Built package artifacts:"
|
||||
printf ' %s\n' "${built_artifacts[@]}"
|
||||
|
||||
if [ "${publish}" = true ]; then
|
||||
readonly gitea_username="${GITEA_USERNAME:-Dandaedre}"
|
||||
readonly gitea_owner="${GITEA_OWNER:-MadGobblins}"
|
||||
readonly gitea_url="${GITEA_URL:-https://proxy.dandaedre.com/gitea}"
|
||||
|
||||
echo
|
||||
echo "Publishing package artifacts to Gitea..."
|
||||
UV_PUBLISH_USERNAME="${gitea_username}" \
|
||||
UV_PUBLISH_PASSWORD="${gitea_token}" \
|
||||
uv publish \
|
||||
--publish-url "${gitea_url}/api/packages/${gitea_owner}/pypi" \
|
||||
--check-url "${gitea_url}/api/packages/${gitea_owner}/pypi/simple/" \
|
||||
--no-attestations \
|
||||
"${built_artifacts[@]}"
|
||||
echo "Published package artifacts successfully."
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Install the wheel into a uv environment with:"
|
||||
printf ' uv pip install %q\n' "${built_artifacts[-1]}"
|
||||
13
docs/api.rst
13
docs/api.rst
|
|
@ -1,13 +0,0 @@
|
|||
API
|
||||
---
|
||||
|
||||
VSG was written to be included in other tools.
|
||||
The command line script provides one means of using VSG.
|
||||
It also provides an example of how to use the API.
|
||||
|
||||
There are two main modules you will use when incorporating VSG into another program:
|
||||
|
||||
.. toctree::
|
||||
|
||||
vsg.vhdlFile
|
||||
vsg.rule_list
|
||||
|
|
@ -516,6 +516,7 @@ architecture_025
|
|||
This rule checks for valid names for the architecture.
|
||||
Typical architecture names are: RTL, EMPTY, and BEHAVE.
|
||||
This rule allows the user to restrict what can be used for an architecture name.
|
||||
Note that regular expressions are accepted in the **names** field.
|
||||
|
||||
.. NOTE:: This rule is disabled by default.
|
||||
You can enable and configure the names using the following configuration.
|
||||
|
|
@ -531,6 +532,7 @@ This rule allows the user to restrict what can be used for an architecture name.
|
|||
- rtl
|
||||
- empty
|
||||
- behave
|
||||
- my_pattern.*
|
||||
|
||||
**Violation**
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,27 @@
|
|||
Array Constraint Rules
|
||||
----------------------
|
||||
|
||||
array_constraint_100
|
||||
####################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for whitespace before the opening parenthesis.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_array3 is my_array2 (open)(7 downto 0);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_array3 is my_array2(open)(7 downto 0);
|
||||
|
||||
array_constraint_500
|
||||
####################
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,111 @@
|
|||
Case Generate Alternative Rules
|
||||
-------------------------------
|
||||
|
||||
case_generate_alternative_100
|
||||
#############################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **when** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
when 3 =>
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
when 3 =>
|
||||
|
||||
case_generate_alternative_101
|
||||
#############################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **=>** operator.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
when 3 =>
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
when 3 =>
|
||||
|
||||
case_generate_alternative_200
|
||||
#############################
|
||||
|
||||
|phase_3| |error| |blank_line|
|
||||
|
||||
This rule checks for a blank line below the **=>** keyword.
|
||||
|
||||
|configuring_blank_lines_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
when 0 =>
|
||||
a <= b;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
when 0 =>
|
||||
|
||||
a <= b;
|
||||
|
||||
case_generate_alternative_201
|
||||
#############################
|
||||
|
||||
|phase_3| |error| |blank_line|
|
||||
|
||||
This rule checks for blank lines or comments above the **when** keyword.
|
||||
|
||||
|configuring_previous_line_rules_link|
|
||||
|
||||
The default style is :code:`allow_comment`.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data is
|
||||
when 3 =>
|
||||
-- Comment
|
||||
when 4 =>
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data is
|
||||
|
||||
when 3 =>
|
||||
|
||||
-- Comment
|
||||
when 4 =>
|
||||
|
||||
case_generate_alternative_300
|
||||
#############################
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,75 @@
|
|||
Case Generate Statement Rules
|
||||
-----------------------------
|
||||
|
||||
case_generate_statement_100
|
||||
###########################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **case** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
case_generate_statement_101
|
||||
###########################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **generate** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
case data generate
|
||||
|
||||
case_generate_statement_200
|
||||
###########################
|
||||
|
||||
|phase_3| |error| |blank_line|
|
||||
|
||||
This rule checks for blank lines or comments above the **end** keyword.
|
||||
|
||||
|configuring_blank_lines_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
when others =>
|
||||
null;
|
||||
end generate;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
when others =>
|
||||
null;
|
||||
|
||||
end generate;
|
||||
|
||||
case_generate_statement_400
|
||||
###########################
|
||||
|
||||
|
|
|
|||
|
|
@ -539,6 +539,7 @@ case_300
|
|||
|phase_4| |error| |indent|
|
||||
|
||||
This rule checks the indentation of the label.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ comment_010
|
|||
|
||||
This rule checks the indent lines starting with comments.
|
||||
|
||||
|configuring_comment_indenting_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ import vsg.version
|
|||
# ones.
|
||||
extensions = ["sphinx.ext.coverage", "sphinx.ext.autodoc", "sphinx.ext.autosectionlabel", "sphinx_rtd_theme"]
|
||||
|
||||
suppress_warnings = ["autosectionlabel.*"]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ["_templates"]
|
||||
|
||||
|
|
@ -89,7 +91,6 @@ html_theme = "sphinx_rtd_theme"
|
|||
#
|
||||
html_theme_options = {
|
||||
"logo_only": False,
|
||||
"display_version": True,
|
||||
"prev_next_buttons_location": "bottom",
|
||||
"style_external_links": False,
|
||||
"vcs_pageview_mode": "",
|
||||
|
|
@ -104,7 +105,7 @@ html_theme_options = {
|
|||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ["_static"]
|
||||
# html_static_path = ["_static"]
|
||||
|
||||
# Custom sidebar templates, must be a dictionary that maps document names
|
||||
# to template names.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Configuring
|
|||
configuring_array_multiline_structure_rules.rst
|
||||
configuring_blank_lines.rst
|
||||
configuring_block_comments.rst
|
||||
configuring_comment_indenting.rst
|
||||
configuring_comment_keywords.rst
|
||||
configuring_conditional_multiline_indent_rules.rst
|
||||
configuring_consecutive_blank_line_rules.rst
|
||||
|
|
@ -18,11 +19,13 @@ Configuring
|
|||
configuring_indent_rules.rst
|
||||
configuring_keyword_alignment_rules.rst
|
||||
configuring_length_rules.rst
|
||||
configuring_library_and_package_name_restriction_rules.rst
|
||||
configuring_move_token_rules.rst
|
||||
configuring_multiline_assert_rule.rst
|
||||
configuring_multiline_constraint_rules.rst
|
||||
configuring_multiline_indent_rules.rst
|
||||
configuring_number_of_signals_in_signal_declaration.rst
|
||||
configuring_number_of_variables_in_variable_declaration.rst
|
||||
configuring_optional_items.rst
|
||||
configuring_port_map_new_line.rst
|
||||
configuring_port_mode_alignment.rst
|
||||
|
|
@ -36,6 +39,7 @@ Configuring
|
|||
configuring_type_of_instantiations.rst
|
||||
configuring_uppercase_and_lowercase_rules.rst
|
||||
configuring_use_clause_indenting.rst
|
||||
configuring_user_error_messages.rst
|
||||
configuring_whitespace_rules.rst
|
||||
configuring_whitespace_after_comment_rules.rst
|
||||
configuring_vhdl_reserved_words.rst
|
||||
|
|
|
|||
|
|
@ -566,4 +566,6 @@ Rules Enforcing Array Multiline Structure Rules
|
|||
* `concurrent_012 <concurrent_rules.html#concurrent-012>`_
|
||||
* `constant_016 <constant_rules.html#constant-016>`_
|
||||
* `sequential_009 <sequential_rules.html#sequential-009>`_
|
||||
* `signal_403 <signal_rules.html#signal-403>`_
|
||||
* `variable_403 <variable_rules.html#variable-403>`_
|
||||
* `variable_assignment_008 <variable_assignment_rules.html#variable-assignment-008>`_
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ Rules Enforcing Blank Lines
|
|||
* `case_009 <case_rules.html#case-009>`_
|
||||
* `case_010 <case_rules.html#case-010>`_
|
||||
* `case_200 <case_rules.html#case-200>`_
|
||||
* `case_generate_alternative_200 <case_generate_alternative_rules.html#case-generate-alternative-200>`_
|
||||
* `case_generate_statement_200 <case_generate_statement_rules.html#case-generate-statement-200>`_
|
||||
* `component_016 <component_rules.html#component-016>`_
|
||||
* `component_018 <component_rules.html#component-018>`_
|
||||
* `constant_200 <constant_rules.html#constant-200>`_
|
||||
|
|
|
|||
|
|
@ -121,20 +121,20 @@ To configure the following example...
|
|||
|
||||
rule:
|
||||
block_comment_001:
|
||||
disable : False
|
||||
header_left : ''
|
||||
header_left_repeat : '-'
|
||||
header_string : ''
|
||||
header_right_repeat : ''
|
||||
disable: false
|
||||
header_left:
|
||||
header_left_repeat: '-'
|
||||
header_string:
|
||||
header_right_repeat:
|
||||
block_comment_002:
|
||||
disable : False
|
||||
comment_left : ''
|
||||
disable: false
|
||||
comment_left:
|
||||
block_comment_003:
|
||||
disable : False
|
||||
footer_left : ''
|
||||
footer_left_repeat : '-'
|
||||
footer_string : ''
|
||||
footer_right_repeat : ''
|
||||
disable: false
|
||||
footer_left:
|
||||
footer_left_repeat: '-'
|
||||
footer_string:
|
||||
footer_right_repeat:
|
||||
|
||||
Complex Block Comment
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -0,0 +1,153 @@
|
|||
.. _configuring-comment-indenting:
|
||||
|
||||
Configuring Comment Indenting
|
||||
-----------------------------
|
||||
|
||||
The desired indenting of comments can vary depending on where the comment occurs.
|
||||
|
||||
There are currently two options for configuring indents.
|
||||
|
||||
.. |boolean_value| replace::
|
||||
:code:`<boolean>`
|
||||
|
||||
.. |True| replace::
|
||||
:code:`True`
|
||||
|
||||
.. |False| replace::
|
||||
:code:`False`
|
||||
|
||||
.. |align_with_end_of_declarative_part| replace::
|
||||
:code:`align_with_end_of_declarative_part`
|
||||
|
||||
.. |align_with_end_of_statement_part| replace::
|
||||
:code:`align_with_end_of_statement_part`
|
||||
|
||||
.. |align_with_end_of_part_default| replace::
|
||||
|False|
|
||||
|
||||
.. |align_with_end_of_part_True| replace::
|
||||
|True| = Sets indent to current indent level.
|
||||
|
||||
.. |align_with_end_of_part_False| replace::
|
||||
|False| = Sets indent to next indent level.
|
||||
|
||||
+--------------------------------------+-----------------+---------------+----------------------------------+
|
||||
| Option | Values | Default | Description |
|
||||
+======================================+=================+===============+==================================+
|
||||
| |align_with_end_of_declarative_part| | |boolean_value| | :code:`False` | * |align_with_end_of_part_True| |
|
||||
| | | | * |align_with_end_of_part_False| |
|
||||
+--------------------------------------+-----------------+---------------+----------------------------------+
|
||||
| |align_with_end_of_statement_part| | |boolean_value| | :code:`False` | * |align_with_end_of_part_True| |
|
||||
| | | | * |align_with_end_of_part_False| |
|
||||
+--------------------------------------+-----------------+---------------+----------------------------------+
|
||||
|
||||
This is an example of how to configure these options.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
indent:
|
||||
options:
|
||||
comment:
|
||||
align_with_end_of_declarative_part: False
|
||||
align_with_end_of_statement_part: False
|
||||
|
||||
The following code snippet is used for all examples.
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
signal a : std_logic;
|
||||
-- end of signal declarations
|
||||
|
||||
begin
|
||||
|
||||
o_output <= a;
|
||||
-- end of output assignments
|
||||
|
||||
end architecture rtl;
|
||||
|
||||
Example: |align_with_end_of_declarative_part| set to |True|
|
||||
###########################################################
|
||||
|
||||
The |align_with_end_of_declarative_part| option controls the indent of comments at the end of a declarative part.
|
||||
Setting this option to |True| will set the indent of the comment to the previous indent level.
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
signal a : std_logic;
|
||||
-- end of signal declarations
|
||||
|
||||
begin
|
||||
|
||||
o_output <= a;
|
||||
-- end of output assignments
|
||||
|
||||
end architecture rtl;
|
||||
|
||||
Example: |align_with_end_of_declarative_part| set to |False|
|
||||
############################################################
|
||||
|
||||
The |align_with_end_of_declarative_part| option controls the indent of comments at the end of a declarative part.
|
||||
Setting this option to |False| will set the indent of the comment to the next indent level.
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
signal a : std_logic;
|
||||
-- end of signal declarations
|
||||
|
||||
begin
|
||||
|
||||
o_output <= a;
|
||||
-- end of output assignments
|
||||
|
||||
end architecture rtl;
|
||||
|
||||
Example: |align_with_end_of_statement_part| set to |True|
|
||||
#########################################################
|
||||
|
||||
The |align_with_end_of_statement_part| option controls the indent of comments at the end of a statement part.
|
||||
Setting this option to |True| will set the indent of the comment to the previous indent level.
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
signal a : std_logic;
|
||||
-- end of signal declarations
|
||||
|
||||
begin
|
||||
|
||||
o_output <= a;
|
||||
-- end of output assignments
|
||||
|
||||
end architecture rtl;
|
||||
|
||||
Example: |align_with_end_of_statement_part| set to |False|
|
||||
##########################################################
|
||||
|
||||
The |align_with_end_of_statement_part| option controls the indent of comments at the end of a statement part.
|
||||
Setting this option to |False| will set the indent of the comment to the next indent level.
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
signal a : std_logic;
|
||||
-- end of signal declarations
|
||||
|
||||
begin
|
||||
|
||||
o_output <= a;
|
||||
-- end of output assignments
|
||||
|
||||
end architecture rtl;
|
||||
|
||||
Rules Enforcing Comment Indenting
|
||||
#################################
|
||||
|
||||
* `comment_010 <comment_rules.html#comment-010>`_
|
||||
|
|
@ -59,6 +59,9 @@ Rules Disabled by Default
|
|||
* `generic_map_601 <generic_map_rules.html#generic-map-601>`_
|
||||
* `instantiation_600 <instantiation_rules.html#instantiation-600>`_
|
||||
* `instantiation_601 <instantiation_rules.html#instantiation-601>`_
|
||||
* `interface_incomplete_type_declaration_600 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-600>`_
|
||||
* `interface_incomplete_type_declaration_601 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-601>`_
|
||||
* `library_012 <library_rules.html#library-012>`_
|
||||
* `loop_statement_006 <loop_statement_rules.html#loop-statement-006>`_
|
||||
* `loop_statement_007 <loop_statement_rules.html#loop-statement-007>`_
|
||||
* `loop_statement_600 <loop_statement_rules.html#loop-statement-600>`_
|
||||
|
|
@ -98,6 +101,7 @@ Rules Disabled by Default
|
|||
* `type_100 <type_rules.html#type-100>`_
|
||||
* `type_200 <type_rules.html#type-200>`_
|
||||
* `type_600 <type_rules.html#type-600>`_
|
||||
* `use_clause_001 <use_clause_rules.html#use-clause-001>`_
|
||||
* `variable_012 <variable_rules.html#variable-012>`_
|
||||
* `variable_100 <variable_rules.html#variable-100>`_
|
||||
* `variable_600 <variable_rules.html#variable-600>`_
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ The :code:`indent_style` option can be set globally for all rules and locally fo
|
|||
|
||||
.. code-block:: yaml
|
||||
|
||||
rules:
|
||||
rule:
|
||||
global:
|
||||
indent_style: 'smart_tabs'
|
||||
indent_size: 2
|
||||
|
|
|
|||
|
|
@ -989,6 +989,8 @@ Rules Enforcing Keyword Alignment
|
|||
* `protected_type_body_401 <protected_type_body_rules.html#protected-type-body-401>`_
|
||||
* `protected_type_body_402 <protected_type_body_rules.html#protected-type-body-402>`_
|
||||
* `sequential_400 <sequential_rules.html#sequential-400>`_
|
||||
* `signal_401 <signal_rules.html#signal-401>`_
|
||||
* `subprogram_body_400 <subprogram_body_rules.html#subprogram-body-400>`_
|
||||
* `subprogram_body_401 <subprogram_body_rules.html#subprogram-body-401>`_
|
||||
* `type_400 <type_rules.html#type-400>`_
|
||||
* `variable_401 <variable_rules.html#variable-401>`_
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
|
||||
.. _configuring-library-and-package-name-restriction-rules:
|
||||
|
||||
Configuring Library and Package Name Restriction Rules
|
||||
------------------------------------------------------
|
||||
|
||||
There are rules which will check for invalid package names in library and use clauses.
|
||||
These rules are disabled by default and must be enabled before they will perform any checks.
|
||||
|
||||
There is one option for these rules:
|
||||
|
||||
.. |names| replace::
|
||||
:code:`names`
|
||||
|
||||
.. |default| replace::
|
||||
:code:`std_logic_arith` for **use_clause_001**. None for **library_012**
|
||||
|
||||
.. |values__names| replace::
|
||||
List of strings
|
||||
|
||||
.. |action__names| replace::
|
||||
Search for libraries and packages with the user defined names
|
||||
|
||||
+--------------------------------------+-----------------+-----------+------------------------------------------------+
|
||||
| Option | Values | Default | Description |
|
||||
+======================================+=================+===========+================================================+
|
||||
| |names| | |values__names| | |default| | * |action__names| |
|
||||
+--------------------------------------+-----------------+-----------+------------------------------------------------+
|
||||
|
||||
This is an example of how to configure the option.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
rule :
|
||||
library_012:
|
||||
names:
|
||||
- "work"
|
||||
- "std_logic_arith"
|
||||
|
||||
.. NOTE:: All examples below are using the rule **use_clause_001**.
|
||||
|
||||
Example: |names| set to list ["std_logic_arith"]
|
||||
################################################
|
||||
|
||||
The following code would fail with this option:
|
||||
|
||||
.. code-Block:: vhdl
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_arith.all;
|
||||
|
||||
Example: |names| set to ["std_logic_arith", "my_package"]
|
||||
##############################################
|
||||
|
||||
The following code would fail three times with this option:
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_arith.all;
|
||||
|
||||
library work;
|
||||
use work.my_package.all;
|
||||
|
||||
|
||||
Rules Enforcing Valid Names
|
||||
###########################
|
||||
|
||||
* `library_012 <library_rules.html#library-012>`_
|
||||
* `use_clause_001 <use_clause_rules.html#use-clause-001>`_
|
||||
|
|
@ -20,7 +20,7 @@ The method of indenting can be configured using one of the following options:
|
|||
:code:`left`, :code:`report`
|
||||
|
||||
.. |default_value| replace::
|
||||
:code:`left`
|
||||
:code:`report`
|
||||
|
||||
.. |report| replace::
|
||||
:code:'report`
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ Rules Enforcing Multiline Indent Rules
|
|||
* `sequential_004 <sequential_rules.html#sequential-004>`_
|
||||
* `sequential_402 <sequential_rules.html#sequential-402>`_
|
||||
* `signal_400 <signal_rules.html#signal-400>`_
|
||||
* `signal_402 <signal_rules.html#signal-402>`_
|
||||
* `variable_400 <signal_rules.html#variable-400>`_
|
||||
* `variable_402 <variable_rules.html#variable-402>`_
|
||||
* `variable_assignment_004 <variable_assignment_rules.html#variable-assignment-004>`_
|
||||
* `variable_assignment_401 <variable_assignment_rules.html#variable-assignment-401>`_
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
.. _configuring-number-of-variables-in-variable-declaration:
|
||||
|
||||
Configuring Number of Variables in Variable Declaration
|
||||
-------------------------------------------------------
|
||||
|
||||
VHDL allows of any number of variables to be declared within a single variable declaration.
|
||||
While this may be allowed, in practice there are limits imposed by the designers.
|
||||
Limiting the number of variables declared improves the readability of VHDL code.
|
||||
|
||||
The default number of variables allowed, 2, can be set by configuring rule **variable_015**.
|
||||
|
||||
Overriding Number of variables
|
||||
##############################
|
||||
|
||||
The default setting can be changed using a configuration.
|
||||
We can use the following configuration to change the number of variables allowed to 1.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
|
||||
rule :
|
||||
variable_015 :
|
||||
consecutive : 1
|
||||
|
||||
Rules Enforcing Number of variables
|
||||
###################################
|
||||
|
||||
* `variable_015 <variable_rules.html#variable-015>`_
|
||||
|
|
@ -98,6 +98,7 @@ Rules Enforcing Optional Items
|
|||
* `function_020 <function_rules.html#function-020>`_
|
||||
* `generate_011 <generate_rules.html#generate-011>`_
|
||||
* `instantiation_033 <instantiation_rules.html#instantiation-033>`_
|
||||
* `instantiation_036 <instantiation_rules.html#instantiation-036>`_
|
||||
* `loop_statement_007 <loop_statement_rules.html#loop-statement-007>`_
|
||||
* `package_007 <package_rules.html#package-007>`_
|
||||
* `package_014 <package_rules.html#package-014>`_
|
||||
|
|
|
|||
|
|
@ -62,42 +62,44 @@ The keywords are treated as case insensitive and support regular expressions.
|
|||
Rules Enforcing Prefixes and Suffixes
|
||||
#####################################
|
||||
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| **Element** | **Prefix Rule** | **Suffix Rule** |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Block Label | `block_601 <block_rules.html#block-601>`_ | `block_600 <block_rules.html#block-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Constant Identifier | `constant_015 <constant_rules.html#constant-015>`_ | `constant_600 <constant_rules.html#constant-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Function Designator | `function_600 <function_rules.html#function-600>`_ | `function_601 <function_rules.html#function-601>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Generate Label | `generate_017 <generate_rules.html#generate-017>`_ | `generate_600 <generate_rules.html#generate-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Generate Parameter Identifier | `generate_601 <generate_rules.html#generate-601>`_ | `generate_602 <generate_rules.html#generate-602>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Generic Identifier | `generic_020 <generic_rules.html#generic-020>`_ | `generic_600 <generic_rules.html#generic-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Generic Map Identifier | `generic_map_601 <generic_map_rules.html#generic-map-601>`_ | `generic_map_600 <generic_map_rules.html#generic-map-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Loop Label | `loop_600 <loop_statement_rules.html#loop-statement-600>`_ | `loop_601 <loop_statement_rules.html#loop-statement-601>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Loop Parameter Identifier | `loop_602 <loop_statement_rules.html#loop-statement-602>`_ | `loop_603 <loop_statement_rules.html#loop-statement-603>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Package Identifier | `package_017 <package_rules.html#package-017>`_ | `package_016 <package_rules.html#package-016>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Package Body Identifier | `package_body_601 <package_body_rules.html#package-body-601>`_ | `package_body_600 <package_body_rules.html#package-body-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Package Instantiation Identifier | `package_instantiation_601 <package_instantiation_rules.html#package-instantiation-601>`_ | `package_instantiation_600 <package_instantiation_rules.html#package-instantiation-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Port Identifier | `port_011 <port_rules.html#port-011>`_ | `port_025 <port_rules.html#port-025>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Process Label | `process_036 <process_rules.html#process-036>`_ | `process_600 <process_rules.html#process-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Signal Identifier | `signal_008 <signal_rules.html#signal-008>`_ | `signal_600 <signal_rules.html#signal-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Subtype Identifier | `subtype_004 <subtype_rules.html#subtype-004>`_ | `subtype_600 <subtype_rules.html#subtype-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Type Identifier | `type_definition_015 <type_rules.html#type-015>`_ | `type_definition_600 <type_rules.html#type-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
| Variable Identifier | `variable_012 <variable_rules.html#variable-012>`_ | `variable_600 <variable_rules.html#variable-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| **Element** | **Prefix Rule** | **Suffix Rule** |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Block Label | `block_601 <block_rules.html#block-601>`_ | `block_600 <block_rules.html#block-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Constant Identifier | `constant_015 <constant_rules.html#constant-015>`_ | `constant_600 <constant_rules.html#constant-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Function Designator | `function_600 <function_rules.html#function-600>`_ | `function_601 <function_rules.html#function-601>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Generate Label | `generate_017 <generate_rules.html#generate-017>`_ | `generate_600 <generate_rules.html#generate-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Generate Parameter Identifier | `generate_601 <generate_rules.html#generate-601>`_ | `generate_602 <generate_rules.html#generate-602>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Generic Identifier | `generic_020 <generic_rules.html#generic-020>`_ | `generic_600 <generic_rules.html#generic-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Generic Map Identifier | `generic_map_601 <generic_map_rules.html#generic-map-601>`_ | `generic_map_600 <generic_map_rules.html#generic-map-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Loop Label | `loop_600 <loop_statement_rules.html#loop-statement-600>`_ | `loop_601 <loop_statement_rules.html#loop-statement-601>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Loop Parameter Identifier | `loop_602 <loop_statement_rules.html#loop-statement-602>`_ | `loop_603 <loop_statement_rules.html#loop-statement-603>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Generic Type Identifier | `interface_incomplete_type_declaration_600 <interface_incomplete_type_declaration.html#interface-incomplete-type-declaration-600>`_ | `interface_incomplete_type_declaration_601 <interface_incomplete_type_declaration.html#interface-incomplete-type-declaration-601>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Package Identifier | `package_017 <package_rules.html#package-017>`_ | `package_016 <package_rules.html#package-016>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Package Body Identifier | `package_body_601 <package_body_rules.html#package-body-601>`_ | `package_body_600 <package_body_rules.html#package-body-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Package Instantiation Identifier | `package_instantiation_601 <package_instantiation_rules.html#package-instantiation-601>`_ | `package_instantiation_600 <package_instantiation_rules.html#package-instantiation-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Port Identifier | `port_011 <port_rules.html#port-011>`_ | `port_025 <port_rules.html#port-025>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Process Label | `process_036 <process_rules.html#process-036>`_ | `process_600 <process_rules.html#process-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Signal Identifier | `signal_008 <signal_rules.html#signal-008>`_ | `signal_600 <signal_rules.html#signal-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Subtype Identifier | `subtype_004 <subtype_rules.html#subtype-004>`_ | `subtype_600 <subtype_rules.html#subtype-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Type Identifier | `type_definition_015 <type_rules.html#type-015>`_ | `type_definition_600 <type_rules.html#type-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Variable Identifier | `variable_012 <variable_rules.html#variable-012>`_ | `variable_600 <variable_rules.html#variable-600>`_ |
|
||||
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ Rules Enforcing Previous Lines
|
|||
* `block_200 <block_rules.html#block-200>`_
|
||||
* `case_007 <case_rules.html#case-007>`_
|
||||
* `case_201 <case_rules.html#case-201>`_
|
||||
* `case_generate_alternative_201 <case_generate_alternative_rules.html#case-generate-alternative-201>`_
|
||||
* `component_003 <component_rules.html#component-003>`_
|
||||
* `context_003 <context_rules.html#context-003>`_
|
||||
* `entity_003 <entity_rules.html#entity-003>`_
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ There are several options to these rules:
|
|||
+-------------------------+-------------+---------------+-----------------------------------+
|
||||
| Method | Values | Default | Description |
|
||||
+=========================+=============+===============+===================================+
|
||||
| |new_line_after_assign| | |values1| | |default_yes| | * |new_line_after_assign__yes| |
|
||||
| |new_line_after_assign| | |values1| | |default_no| | * |new_line_after_assign__yes| |
|
||||
| | | | * |new_line_after_assign__no| |
|
||||
| | | | * |new_line_after_assign__ignore| |
|
||||
+-------------------------+-------------+---------------+-----------------------------------+
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ This is an example of how to configure these options.
|
|||
.. code-block:: yaml
|
||||
|
||||
rule :
|
||||
instantiation_010:
|
||||
instantiation_034:
|
||||
method: 'component'
|
||||
|
||||
Example: |method| set to |component_option|
|
||||
|
|
|
|||
|
|
@ -23,9 +23,18 @@ There are several options to these rules:
|
|||
.. |camelCase_value| replace::
|
||||
:code:`camelCase`
|
||||
|
||||
.. |relaxedCamelCase_value| replace::
|
||||
:code:`relaxedCamelCase`
|
||||
|
||||
.. |PascalCase_value| replace::
|
||||
:code:`PascalCase`
|
||||
|
||||
.. |RelaxedPascalCase_value| replace::
|
||||
:code:`RelaxedPascalCase`
|
||||
|
||||
.. |PascalSnakeCase_value| replace::
|
||||
:code:`Pascal_Snake_Case`
|
||||
|
||||
.. |regex_value| replace::
|
||||
:code:`regex`
|
||||
|
||||
|
|
@ -39,16 +48,25 @@ There are several options to these rules:
|
|||
|upper_or_lower_value| = Allow upper or lower case
|
||||
|
||||
.. |case_option__camelCase| replace::
|
||||
|camelCase_value| = Enforce camelCase
|
||||
|camelCase_value| = Enforce camelCase with two allowed uppercase characters in a row
|
||||
|
||||
.. |case_option__relaxedCamelCase| replace::
|
||||
|relaxedCamelCase_value| = Enforce camelCase with any number of uppercase characters in a row
|
||||
|
||||
.. |case_option__PascalCase| replace::
|
||||
|PascalCase_value| = Enforce PascalCase
|
||||
|PascalCase_value| = Enforce PascalCase with two allowed uppercase characters in a row
|
||||
|
||||
.. |case_option__RelaxedPascalCase| replace::
|
||||
|RelaxedPascalCase_value| = Enforce PascalCase with any number of uppercase characters in a row
|
||||
|
||||
.. |case_option__PascalSnakeCase| replace::
|
||||
|PascalSnakeCase_value| = Enforce Pascal_Snake_Case
|
||||
|
||||
.. |case_option__regex| replace::
|
||||
|regex_value| = Enforce user defined regex
|
||||
|
||||
.. |case_values| replace::
|
||||
|upper_value|, |lower_value|, |upper_or_lower_value|, |camelCase_value|, |PascalCase_value|, |regex_value|
|
||||
|upper_value|, |lower_value|, |upper_or_lower_value|, |camelCase_value|, |relaxedCamelCase_value|, |PascalCase_value|, |RelaxedPascalCase_value|, |regex_value|
|
||||
|
||||
.. |case_default_value| replace::
|
||||
|lower_value|
|
||||
|
|
@ -101,24 +119,27 @@ There are several options to these rules:
|
|||
.. |regex_description| replace::
|
||||
Enforce case based on regex string
|
||||
|
||||
+----------------------------+------------------------+-----------------------+-----------------------------------+
|
||||
| Option | Values | Default Value | Description |
|
||||
+============================+========================+=======================+===================================+
|
||||
| |case_option| | |case_values| | |case_default_value| | * |case_option__upper| |
|
||||
| | | | * |case_option__lower| |
|
||||
| | | | * |case_option__upper_or_lower| |
|
||||
| | | | * |case_option__camelCase| |
|
||||
| | | | * |case_option__PascalCase| |
|
||||
| | | | * |case_option__regex| |
|
||||
+----------------------------+------------------------+-----------------------+-----------------------------------+
|
||||
| |prefix_exceptions_option| | |pe_values| | |pe_default_value| | |pe_description| |
|
||||
+----------------------------+------------------------+-----------------------+-----------------------------------+
|
||||
| |suffix_exceptions_option| | |se_values| | |se_default_value| | |se_description| |
|
||||
+----------------------------+------------------------+-----------------------+-----------------------------------+
|
||||
| |case_exceptions_option| | |ce_values| | |ce_default_value| | |ce_description| |
|
||||
+----------------------------+------------------------+-----------------------+-----------------------------------+
|
||||
| |regex_option| | |regex_values| | |regex_default_value| | |regex_description| |
|
||||
+----------------------------+------------------------+-----------------------+-----------------------------------+
|
||||
+----------------------------+---------------------------+-----------------------+------------------------------------+
|
||||
| Option | Values | Default Value | Description |
|
||||
+============================+===========================+=======================+====================================+
|
||||
| |case_option| | |upper_value| | |case_default_value| | * |case_option__upper| |
|
||||
| | |lower_value| | | * |case_option__lower| |
|
||||
| | |upper_or_lower_value| | | * |case_option__upper_or_lower| |
|
||||
| | |camelCase_value| | | * |case_option__camelCase| |
|
||||
| | |relaxedCamelCase_value| | | * |case_option__relaxedCamelCase| |
|
||||
| | |PascalCase_value| | | * |case_option__PascalCase| |
|
||||
| | |RelaxedPascalCase_value| | | * |case_option__RelaxedPascalCase| |
|
||||
| | |PascalSnakeCase_value| | | * |case_option__PascalSnakeCase| |
|
||||
| | |regex_value| | | * |case_option__regex| |
|
||||
+----------------------------+---------------------------+-----------------------+------------------------------------+
|
||||
| |prefix_exceptions_option| | |pe_values| | |pe_default_value| | |pe_description| |
|
||||
+----------------------------+---------------------------+-----------------------+------------------------------------+
|
||||
| |suffix_exceptions_option| | |se_values| | |se_default_value| | |se_description| |
|
||||
+----------------------------+---------------------------+-----------------------+------------------------------------+
|
||||
| |case_exceptions_option| | |ce_values| | |ce_default_value| | |ce_description| |
|
||||
+----------------------------+---------------------------+-----------------------+------------------------------------+
|
||||
| |regex_option| | |regex_values| | |regex_default_value| | |regex_description| |
|
||||
+----------------------------+---------------------------+-----------------------+------------------------------------+
|
||||
|
||||
This is an example of how to configure these options.
|
||||
|
||||
|
|
@ -335,7 +356,15 @@ Rules Enforcing Case
|
|||
|
||||
* `external_variable_name_500 <external_variable_name_rules.html#external-variable-name-500>`_
|
||||
|
||||
* `file_open_information_500 <file_open_information_rules.html#file-open-information-500>`_
|
||||
* `file_open_information_501 <file_open_information_rules.html#file-open-information-501>`_
|
||||
* `file_open_information_502 <file_open_information_rules.html#file-open-information-502>`_
|
||||
|
||||
* `file_002 <file_rules.html#file-002>`_
|
||||
* `file_500 <file_rules.html#file-500>`_
|
||||
|
||||
* `file_type_definition_500 <file_type_definition_rules.html#file-type-definition-500>`_
|
||||
* `file_type_definition_501 <file_type_definition_rules.html#file-type-definition-501>`_
|
||||
|
||||
* `for_generate_statement_500 <for_generate_statement_rules.html#for-generate-statement-500>`_
|
||||
* `for_generate_statement_501 <for_generate_statement_rules.html#for-generate-statement-501>`_
|
||||
|
|
@ -387,6 +416,9 @@ Rules Enforcing Case
|
|||
* `instantiation_031 <instantiation_rules.html#instantiation-031>`_
|
||||
* `instantiation_500 <instantiation_rules.html#instantiation-500>`_
|
||||
|
||||
* `interface_incomplete_type_declaration_500 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-500>`_
|
||||
* `interface_incomplete_type_declaration_501 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-501>`_
|
||||
|
||||
* `iteration_scheme_500 <iteration_scheme_rules.html#iteration-scheme-500>`_
|
||||
* `iteration_scheme_501 <iteration_scheme_rules.html#iteration-scheme-501>`_
|
||||
|
||||
|
|
@ -525,6 +557,7 @@ Rules Enforcing Case
|
|||
|
||||
* `variable_002 <variable_rules.html#variable-002>`_
|
||||
* `variable_004 <variable_rules.html#variable-004>`_
|
||||
* `variable_500 <variable_rules.html#variable-500>`_
|
||||
|
||||
* `wait_500 <wait_rules.html#wait-500>`_
|
||||
* `wait_501 <wait_rules.html#wait-501>`_
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
.. _configuring-user-error-messages:
|
||||
|
||||
Configuring User Error Messages
|
||||
-------------------------------
|
||||
|
||||
There is an option to provide additional information to the user when a violation is found.
|
||||
This is accomplished by using the :code:`user_error_message` option.
|
||||
Setting this option for a rule will append the message to the normal output.
|
||||
|
||||
Example without :code:`user_error_message` defined
|
||||
##################################################
|
||||
|
||||
Applying a custom regex does not provide additional information to the user.
|
||||
|
||||
Given the following configuration file which defines a custom regex:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
rule:
|
||||
group:
|
||||
case::name:
|
||||
case: regex
|
||||
regex: (?![a-z||0-9]\u005F)(?!.*\u005F[a-z||0-9]$)([a-z||0-9]+(?:\u005F[a-z||0-9]+)*)
|
||||
|
||||
The following error report is generated:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$vsg -f original.vhd -c config.yaml
|
||||
================================================================================
|
||||
File: original.vhd
|
||||
================================================================================
|
||||
Phase 6 of 7... Reporting
|
||||
Total Rules Checked: 857
|
||||
Total Violations: 2
|
||||
Error : 2
|
||||
Warning : 0
|
||||
-------------+------------+------------+--------------------------------------
|
||||
Rule | severity | line(s) | Solution
|
||||
-------------+------------+------------+--------------------------------------
|
||||
entity_008 | Error | 2 | Format FIFO to match defined regex
|
||||
entity_012 | Error | 3 | Format FIFO to match defined regex
|
||||
-------------+------------+------------+--------------------------------------
|
||||
NOTE: Refer to online documentation at https://vhdl-style-guide.readthedocs.io/en/latest/index.html for more information.
|
||||
|
||||
Example with :code:`user_error_message` defined
|
||||
###############################################
|
||||
|
||||
Adding a custom error message can provide additional information to the user:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
rule:
|
||||
group:
|
||||
case::name:
|
||||
case: regex
|
||||
regex: (?![a-z||0-9]\u005F)(?!.*\u005F[a-z||0-9]$)([a-z||0-9]+(?:\u005F[a-z||0-9]+)*)
|
||||
user_error_message: "UPPERCASE and single letter prefix/suffix not allowed"
|
||||
|
||||
The following error report is generated:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$vsg -f original.vhd -c config.yaml
|
||||
================================================================================
|
||||
File: original.vhd
|
||||
================================================================================
|
||||
Phase 6 of 7... Reporting
|
||||
Total Rules Checked: 857
|
||||
Total Violations: 2
|
||||
Error : 2
|
||||
Warning : 0
|
||||
-------------+------------+------------+--------------------------------------
|
||||
Rule | severity | line(s) | Solution
|
||||
-------------+------------+------------+--------------------------------------
|
||||
entity_008 | Error | 2 | Format FIFO to match defined regex [user_error_message: UPPERCASE and single letter prefix/suffix not allowed]
|
||||
entity_012 | Error | 3 | Format FIFO to match defined regex [user_error_message: UPPERCASE and single letter prefix/suffix not allowed]
|
||||
-------------+------------+------------+--------------------------------------
|
||||
NOTE: Refer to online documentation at https://vhdl-style-guide.readthedocs.io/en/latest/index.html for more information.
|
||||
|
|
@ -28,11 +28,14 @@ These rules provide the following options:
|
|||
.. |standard__2008| replace::
|
||||
:code:`2008` = Use reserved keywords from 2008 standard
|
||||
|
||||
.. |standard__2019| replace::
|
||||
:code:`2019` = Use reserved keywords from 2019 standard
|
||||
|
||||
.. |standard__all| replace::
|
||||
:code:`all` = Use reserved keywords from all standards
|
||||
|
||||
.. |values| replace::
|
||||
:code:`1987`, :code:`1993`, :code:`2000`, :code:`2002`, :code:`2008`
|
||||
:code:`1987`, :code:`1993`, :code:`2000`, :code:`2002`, :code:`2008`, :code:`2019`
|
||||
|
||||
.. |default_value| replace::
|
||||
:code:`all`
|
||||
|
|
@ -45,6 +48,7 @@ These rules provide the following options:
|
|||
| | | | * |standard__2000| |
|
||||
| | | | * |standard__2002| |
|
||||
| | | | * |standard__2008| |
|
||||
| | | | * |standard__2019| |
|
||||
| | | | * |standard__all| |
|
||||
+----------------------+----------+-----------------+----------------------------+
|
||||
|
||||
|
|
@ -96,6 +100,19 @@ The :code:`context` keyword is a reserved word in the 2008 standard.
|
|||
end entity;
|
||||
|
||||
|
||||
Example: |standard_option| set to :code:`2019`
|
||||
##############################################
|
||||
|
||||
The :code:`private` keyword is a reserved word in the 2019 standard.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
entity private is
|
||||
end entity;
|
||||
|
||||
|
||||
Rules Enforcing Optional Items
|
||||
##############################
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ Rules Enforcing Whitespace
|
|||
* `architecture_031 <architecture_rules.html#architecture-031>`_
|
||||
* `architecture_032 <architecture_rules.html#architecture-032>`_
|
||||
* `architecture_033 <architecture_rules.html#architecture-033>`_
|
||||
* `array_constraint_100 <array_constraint_rules.html#array-constraint-100>`_
|
||||
* `assert_100 <assert_rules.html#assert-100>`_
|
||||
* `assert_101 <assert_rules.html#assert-101>`_
|
||||
* `assert_102 <assert_rules.html#assert-102>`_
|
||||
|
|
@ -136,6 +137,10 @@ Rules Enforcing Whitespace
|
|||
* `case_004 <case_rules.html#case-004>`_
|
||||
* `case_005 <case_rules.html#case-005>`_
|
||||
* `case_006 <case_rules.html#case-006>`_
|
||||
* `case_generate_alternative_100 <case_generate_alternative_rules.html#case-generate-alternative-100>`_
|
||||
* `case_generate_alternative_101 <case_generate_alternative_rules.html#case-generate-alternative-101>`_
|
||||
* `case_generate_statement_100 <case_generate_statement_rules.html#case-generate-statement-100>`_
|
||||
* `case_generate_statement_101 <case_generate_statement_rules.html#case-generate-statement-101>`_
|
||||
* `comment_004 <comment_rules.html#comment-004>`_
|
||||
* `component_002 <component_rules.html#component-002>`_
|
||||
* `component_007 <component_rules.html#component-007>`_
|
||||
|
|
@ -156,6 +161,8 @@ Rules Enforcing Whitespace
|
|||
* `constant_010 <constant_rules.html#constant-010>`_
|
||||
* `constant_100 <constant_rules.html#constant-100>`_
|
||||
* `constant_101 <constant_rules.html#constant-101>`_
|
||||
* `constrained_array_definition_100 <constrained_array_definition_rules.html#constrained-array-definition-100>`_
|
||||
* `constrained_array_definition_101 <constrained_array_definition_rules.html#constrained-array-definition-101>`_
|
||||
* `context_002 <context_rules.html#context-002>`_
|
||||
* `context_017 <context_rules.html#context-017>`_
|
||||
* `context_018 <context_rules.html#context-018>`_
|
||||
|
|
@ -184,7 +191,12 @@ Rules Enforcing Whitespace
|
|||
* `external_variable_name_102 <external_variable_name_rules.html#external-variable-name-102>`_
|
||||
* `external_variable_name_103 <external_variable_name_rules.html#external-variable-name-103>`_
|
||||
* `external_variable_name_104 <external_variable_name_rules.html#external-variable-name-104>`_
|
||||
* `file_open_information_100 <file_open_information_rules.html#file-open-information-100>`_
|
||||
* `file_open_information_101 <file_open_information_rules.html#file-open-information-101>`_
|
||||
* `file_open_information_102 <file_open_information_rules.html#file-open-information-102>`_
|
||||
* `file_open_information_103 <file_open_information_rules.html#file-open-information-103>`_
|
||||
* `file_100 <file_rules.html#file-100>`_
|
||||
* `file_101 <file_rules.html#file-101>`_
|
||||
* `function_100 <function_rules.html#function-100>`_
|
||||
* `function_101 <function_rules.html#function-101>`_
|
||||
* `generate_002 <generate_rules.html#generate-002>`_
|
||||
|
|
@ -203,6 +215,9 @@ Rules Enforcing Whitespace
|
|||
* `if_004 <if_rules.html#if-004>`_
|
||||
* `if_005 <if_rules.html#if-005>`_
|
||||
* `if_015 <if_rules.html#if-015>`_
|
||||
* `index_constraint_100 <index_constraint_rules.html#index-constraint-100>`_
|
||||
* `index_subtype_definition_100 <index_subtype_definition_rules.html#index-subtype-definition-100>`_
|
||||
* `index_subtype_definition_101 <index_subtype_definition_rules.html#index-subtype-definition-101>`_
|
||||
* `instantiation_002 <instantiation_rules.html#instantiation-002>`_
|
||||
* `instantiation_003 <instantiation_rules.html#instantiation-003>`_
|
||||
* `instantiation_032 <instantiation_rules.html#instantiation-032>`_
|
||||
|
|
@ -240,6 +255,8 @@ Rules Enforcing Whitespace
|
|||
* `process_014 <process_rules.html#process-014>`_
|
||||
* `process_024 <process_rules.html#process-024>`_
|
||||
* `process_025 <process_rules.html#process-025>`_
|
||||
* `range_constraint_100 <range_constraint_rules.html#range-constraint-100>`_
|
||||
* `range_constraint_101 <range_constraint_rules.html#range-constraint-101>`_
|
||||
* `record_type_definition_100 <record_type_definition_rules.html#record-type-definition-100>`_
|
||||
* `record_type_definition_101 <record_type_definition_rules.html#record-type-definition-101>`_
|
||||
* `report_statement_100 <report_statement_rules.html#report-statement-100>`_
|
||||
|
|
@ -270,6 +287,9 @@ Rules Enforcing Whitespace
|
|||
* `type_006 <type_rules.html#type-006>`_
|
||||
* `type_007 <type_rules.html#type-007>`_
|
||||
* `type_100 <type_rules.html#type-100>`_
|
||||
* `unbounded_array_definition_100 <unbounded_array_definition_rules.html#unbounded-array-definition-100>`_
|
||||
* `unbounded_array_definition_101 <unbounded_array_definition_rules.html#unbounded-array-definition-101>`_
|
||||
* `unbounded_array_definition_102 <unbounded_array_definition_rules.html#unbounded-array-definition-102>`_
|
||||
* `variable_005 <variable_rules.html#variable-005>`_
|
||||
* `variable_006 <variable_rules.html#variable-006>`_
|
||||
* `variable_100 <variable_rules.html#variable-100>`_
|
||||
|
|
@ -279,3 +299,5 @@ Rules Enforcing Whitespace
|
|||
* `variable_assignment_002 <variable_assignment_rules.html#variable-assignment-002>`_
|
||||
* `variable_assignment_003 <variable_assignment_rules.html#variable-assignment-003>`_
|
||||
* `whitespace_007 <whitespace_rules.html#whitespace-007>`_
|
||||
* `whitespace_102 <whitespace_rules.html#whitespace-102>`_
|
||||
* `whitespace_103 <whitespace_rules.html#whitespace-103>`_
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ This rule checks the indent of a constant declaration.
|
|||
architecture RTL of FIFO is
|
||||
|
||||
constant size : integer := 1;
|
||||
constant width : integer := 32
|
||||
constant width : integer := 32;
|
||||
|
||||
**Fix**
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ This rule checks the indent of a constant declaration.
|
|||
architecture RTL of FIFO is
|
||||
|
||||
constant size : integer := 1;
|
||||
constant width : integer := 32
|
||||
constant width : integer := 32;
|
||||
|
||||
constant_002
|
||||
############
|
||||
|
|
@ -126,7 +126,7 @@ constant_007
|
|||
|
||||
|phase_1| |error| |structure|
|
||||
|
||||
This rule checks the **:=** is on the same line at the **constant** keyword.
|
||||
This rule checks the **:=** is on the same line as the **constant** keyword.
|
||||
|
||||
**Violation**
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ This rule checks the **:=** is on the same line at the **constant** keyword.
|
|||
constant size : integer :=
|
||||
1;
|
||||
constant width : integer :=
|
||||
32
|
||||
32;
|
||||
|
||||
constant_010
|
||||
############
|
||||
|
|
|
|||
|
|
@ -3,6 +3,48 @@
|
|||
Constrained Array Definition Rules
|
||||
----------------------------------
|
||||
|
||||
constrained_array_definition_100
|
||||
################################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **of** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array is array(1 downto 0) of unsigned;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array is array(1 downto 0) of unsigned;
|
||||
|
||||
constrained_array_definition_101
|
||||
################################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **of** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array is array(1 downto 0) of unsigned;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array is array(1 downto 0) of unsigned;
|
||||
|
||||
constrained_array_definition_500
|
||||
################################
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,175 @@
|
|||
.. include:: includes.rst
|
||||
|
||||
File Open Information Rules
|
||||
---------------------------
|
||||
|
||||
file_open_information_100
|
||||
#########################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **open** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
file_open_information_101
|
||||
#########################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **open** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
file_open_information_102
|
||||
#########################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **is** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
file_open_information_103
|
||||
#########################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **is** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
file_open_information_500
|
||||
#########################
|
||||
|
||||
|phase_6| |error| |case| |case_keyword|
|
||||
|
||||
This rule checks the **open** keyword has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
file defaultImage : load_file_type OPEN read_mode is load_file_name;
|
||||
|
||||
begin
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
begin
|
||||
|
||||
file_open_information_501
|
||||
#########################
|
||||
|
||||
|phase_6| |error| |case| |case_keyword|
|
||||
|
||||
This rule checks the file open kind expression has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
FILE defaultImage : load_file_type open READ_MODE is load_file_name;
|
||||
|
||||
begin
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
begin
|
||||
|
||||
file_open_information_502
|
||||
#########################
|
||||
|
||||
|phase_6| |error| |case| |case_keyword|
|
||||
|
||||
This rule checks the **is** keyword has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
file defaultimage : load_file_type open read_mode IS load_file_name;
|
||||
|
||||
begin
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
begin
|
||||
|
|
@ -95,3 +95,53 @@ This rule checks for a single space before the identifier.
|
|||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
file_101
|
||||
########
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the identifier.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
file_500
|
||||
########
|
||||
|
||||
|phase_6| |error| |case| |case_name|
|
||||
|
||||
This rule checks the file identifier has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
file DEFAULTIMAGE : load_file_type open read_mode is load_file_name;
|
||||
|
||||
begin
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
file defaultImage : load_file_type open read_mode is load_file_name;
|
||||
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -0,0 +1,56 @@
|
|||
.. include:: includes.rst
|
||||
|
||||
File Type Definition Rules
|
||||
--------------------------
|
||||
|
||||
file_type_definition_500
|
||||
########################
|
||||
|
||||
|phase_6| |error| |case| |case_keyword|
|
||||
|
||||
This rule checks the **file** keyword has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type integer_file is FILE of integer;
|
||||
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
type integer_file is file of integer;
|
||||
|
||||
begin
|
||||
|
||||
file_type_definition_501
|
||||
########################
|
||||
|
||||
|phase_6| |error| |case| |case_keyword|
|
||||
|
||||
This rule checks the **of** keyword has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type integer_file is file OF integer;
|
||||
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
architecture rtl of fifo is
|
||||
|
||||
type integer_file is file of integer;
|
||||
|
||||
begin
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
.. include:: includes.rst
|
||||
|
||||
Index Constraint Rules
|
||||
----------------------
|
||||
|
||||
index_constraint_100
|
||||
####################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for whitespace before the opening parenthesis.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_array3 is my_array2(open) (7 downto 0);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_array3 is my_array2(open)(7 downto 0);
|
||||
|
|
@ -3,6 +3,48 @@
|
|||
Index Subtype Definition Rules
|
||||
------------------------------
|
||||
|
||||
index_subtype_definition_100
|
||||
############################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **range** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type my_array is array (natural range <>) of integer;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type my_array is array (natural range <>) of integer;
|
||||
|
||||
index_subtype_definition_101
|
||||
############################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **range** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type my_array is array (natural range <>) of integer;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type my_array is array (natural range <>) of integer;
|
||||
|
||||
index_subtype_definition_500
|
||||
############################
|
||||
|
||||
|
|
|
|||
|
|
@ -535,6 +535,29 @@ This rule checks the semicolon is not on its own line.
|
|||
A => B,
|
||||
B => C);
|
||||
|
||||
instantiation_036
|
||||
#################
|
||||
|
||||
|phase_1| |error| |unfixable| |structure| |structure_optional|
|
||||
|
||||
This rule checks for the optional architecture specification in entity instantiations.
|
||||
|
||||
The default action is "add".
|
||||
|
||||
|configuring_optional_items_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
cmp_test : entity work.my_module;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
cmp_test : entity work.my_module(rtl);
|
||||
|
||||
instantiation_300
|
||||
#################
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,100 @@
|
|||
.. include:: includes.rst
|
||||
|
||||
Interface Incomplete Type Declaration Rules
|
||||
-------------------------------------------
|
||||
|
||||
interface_incomplete_type_declaration_500
|
||||
#########################################
|
||||
|
||||
|phase_6| |error| |case| |case_keyword|
|
||||
|
||||
This rule checks the **type** keyword has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
TYPE generic_data_type
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
type generic_data_type
|
||||
|
||||
interface_incomplete_type_declaration_501
|
||||
#########################################
|
||||
|
||||
|phase_6| |error| |case| |case_name|
|
||||
|
||||
This rule checks the type name has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
type GENERIC_DATA_TYPE
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
type generic_data_type
|
||||
|
||||
interface_incomplete_type_declaration_600
|
||||
#########################################
|
||||
|
||||
|phase_7| |disabled| |error| |unfixable| |naming|
|
||||
|
||||
This rule checks for valid prefixes of type names.
|
||||
|
||||
.. NOTE:: The default prefix is *gt_*.
|
||||
|
||||
|configuring_prefix_and_suffix_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
type generic_data_type
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
type gt_generic_data_type
|
||||
|
||||
interface_incomplete_type_declaration_601
|
||||
#########################################
|
||||
|
||||
|phase_7| |disabled| |error| |unfixable| |naming|
|
||||
|
||||
This rule checks for valid suffixes of type names.
|
||||
|
||||
.. NOTE:: The default prefix is *_gt*.
|
||||
|
||||
|configuring_prefix_and_suffix_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
type generic_data_type
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
generic (
|
||||
type generic_data_type_gt
|
||||
|
|
@ -275,6 +275,23 @@ This rule checks the **use** keyword is on its own line.
|
|||
context c1 is library ieee;
|
||||
use ieee.std_logic_1164.all; end context c1;
|
||||
|
||||
library_012
|
||||
###########
|
||||
|
||||
|phase_7| |disabled| |error| |unfixable| |naming|
|
||||
|
||||
This rule checks for libraries that have been restricted by the user.
|
||||
|
||||
|configuring_library_and_package_name_restriction_rules_link|
|
||||
|
||||
.. NOTE:: This rule is disabled by default.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
library bad_lib;
|
||||
|
||||
library_500
|
||||
###########
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@
|
|||
.. |configuring_number_of_signals_in_signal_declaration_link| replace::
|
||||
Refer to :ref:`configuring-number-of-signals-in-signal-declaration` for more information.
|
||||
|
||||
.. |configuring_number_of_variables_in_variable_declaration_link| replace::
|
||||
Refer to :ref:`configuring-number-of-variables-in-variable-declaration` for more information.
|
||||
|
||||
.. |configuring_optional_items_link| replace::
|
||||
Refer to :ref:`configuring-optional-items` for more information.
|
||||
|
||||
|
|
@ -94,3 +97,9 @@
|
|||
|
||||
.. |configuring_port_map_new_line_link| replace::
|
||||
Refer to :ref:`configuring-port-map-new-line` for configuration options.
|
||||
|
||||
.. |configuring_comment_indenting_link| replace::
|
||||
Refer to :ref:`configuring-comment-indenting` for configuration options.
|
||||
|
||||
.. |configuring_library_and_package_name_restriction_rules_link| replace::
|
||||
Refer to :ref:`configuring-library-and-package-name-restriction-rules` for configuration options.
|
||||
|
|
|
|||
|
|
@ -64,5 +64,5 @@ Known Limitations
|
|||
VSG is a continual work in progress.
|
||||
As such, this version has the following known limitations:
|
||||
|
||||
* Parser will not process embedded PSL
|
||||
* Minumal support for embedded PSL
|
||||
* Parser will not process VHDL 2019
|
||||
|
|
|
|||
|
|
@ -566,6 +566,7 @@ This rule checks for missing modes in port declarations.
|
|||
WR_EN : std_logic;
|
||||
RD_EN : std_logic;
|
||||
OVERFLOW : std_logic;
|
||||
V_TEST : some_view;
|
||||
DATA : inout std_logic
|
||||
);
|
||||
|
||||
|
|
@ -577,6 +578,7 @@ This rule checks for missing modes in port declarations.
|
|||
WR_EN : in std_logic;
|
||||
RD_EN : in std_logic;
|
||||
OVERFLOW : out std_logic;
|
||||
V_TEST : view some_view;
|
||||
DATA : inout std_logic
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ event configuration
|
|||
edge configuration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. NOTE:: Configuration this by setting the *'clock'* attribute to *'edge'*
|
||||
.. NOTE:: Configure this by setting the *'clock'* attribute to *'edge'*.
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,48 @@
|
|||
Range Constraint Rules
|
||||
----------------------
|
||||
|
||||
range_constraint_100
|
||||
####################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **range** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_range is natural range 0 to 7;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_range is natural range 0 to 7;
|
||||
|
||||
range_constraint_101
|
||||
####################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **range** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_range is natural range 0 to 7;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
subtype my_range is natural range 0 to 7;
|
||||
|
||||
range_constraint_500
|
||||
####################
|
||||
|
||||
|
|
|
|||
|
|
@ -75,10 +75,14 @@ Rules Enforcing Alignment Rule Group
|
|||
* `sequential_402 <../sequential_rules.html#sequential-402>`_
|
||||
* `signal_012 <../signal_rules.html#signal-012>`_
|
||||
* `signal_400 <../signal_rules.html#signal-400>`_
|
||||
* `signal_401 <../signal_rules.html#signal-401>`_
|
||||
* `signal_402 <../signal_rules.html#signal-402>`_
|
||||
* `subprogram_body_400 <../subprogram_body_rules.html#subprogram-body-400>`_
|
||||
* `subprogram_body_401 <../subprogram_body_rules.html#subprogram-body-401>`_
|
||||
* `type_400 <../type_rules.html#type-400>`_
|
||||
* `variable_400 <../variable_rules.html#variable-400>`_
|
||||
* `variable_401 <../variable_rules.html#variable-401>`_
|
||||
* `variable_402 <../variable_rules.html#variable-402>`_
|
||||
* `variable_assignment_004 <../variable_assignment_rules.html#variable-assignment-004>`_
|
||||
* `variable_assignment_400 <../variable_assignment_rules.html#variable-assignment-400>`_
|
||||
* `variable_assignment_401 <../variable_assignment_rules.html#variable-assignment-401>`_
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ Rules Enforcing Blank Line Rule Group
|
|||
* `case_010 <../case_rules.html#case-010>`_
|
||||
* `case_200 <../case_rules.html#case-200>`_
|
||||
* `case_201 <../case_rules.html#case-201>`_
|
||||
* `case_generate_alternative_200 <../case_generate_alternative_rules.html#case-generate-alternative-200>`_
|
||||
* `case_generate_alternative_201 <../case_generate_alternative_rules.html#case-generate-alternative-201>`_
|
||||
* `case_generate_statement_200 <../case_generate_statement_rules.html#case-generate-statement-200>`_
|
||||
* `component_003 <../component_rules.html#component-003>`_
|
||||
* `component_016 <../component_rules.html#component-016>`_
|
||||
* `component_018 <../component_rules.html#component-018>`_
|
||||
|
|
|
|||
|
|
@ -69,7 +69,12 @@ Rules Enforcing Case::Keyword Rule Group
|
|||
* `external_constant_name_500 <../external_constant_name_rules.html#external-constant-name-500>`_
|
||||
* `external_signal_name_500 <../external_signal_name_rules.html#external-signal-name-500>`_
|
||||
* `external_variable_name_500 <../external_variable_name_rules.html#external-variable-name-500>`_
|
||||
* `file_open_information_500 <../file_open_information_rules.html#file-open-information-500>`_
|
||||
* `file_open_information_501 <../file_open_information_rules.html#file-open-information-501>`_
|
||||
* `file_open_information_502 <../file_open_information_rules.html#file-open-information-502>`_
|
||||
* `file_002 <../file_rules.html#file-002>`_
|
||||
* `file_type_definition_500 <../file_type_definition_rules.html#file-type-definition-500>`_
|
||||
* `file_type_definition_501 <../file_type_definition_rules.html#file-type-definition-501>`_
|
||||
* `for_generate_statement_500 <../for_generate_statement_rules.html#for-generate-statement-500>`_
|
||||
* `for_generate_statement_501 <../for_generate_statement_rules.html#for-generate-statement-501>`_
|
||||
* `function_004 <../function_rules.html#function-004>`_
|
||||
|
|
@ -100,6 +105,7 @@ Rules Enforcing Case::Keyword Rule Group
|
|||
* `index_subtype_definition_500 <../index_subtype_definition_rules.html#index-subtype-definition-500>`_
|
||||
* `instantiation_027 <../instantiation_rules.html#instantiation-027>`_
|
||||
* `instantiation_031 <../instantiation_rules.html#instantiation-031>`_
|
||||
* `interface_incomplete_type_declaration_500 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-500>`_
|
||||
* `iteration_scheme_500 <../iteration_scheme_rules.html#iteration-scheme-500>`_
|
||||
* `iteration_scheme_501 <../iteration_scheme_rules.html#iteration-scheme-501>`_
|
||||
* `library_004 <../library_rules.html#library-004>`_
|
||||
|
|
@ -176,6 +182,7 @@ Rules Enforcing Case::Keyword Rule Group
|
|||
* `unbounded_array_definition_501 <../unbounded_array_definition_rules.html#unbounded-array-definition-501>`_
|
||||
* `use_clause_503 <../use_clause_rules.html#use-clause-503>`_
|
||||
* `variable_002 <../variable_rules.html#variable-002>`_
|
||||
* `variable_500 <../variable_rules.html#variable-500>`_
|
||||
* `wait_500 <../wait_rules.html#wait-500>`_
|
||||
* `wait_501 <../wait_rules.html#wait-501>`_
|
||||
* `wait_502 <../wait_rules.html#wait-502>`_
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ Rules Enforcing Case::Name Rule Group
|
|||
* `entity_008 <../entity_rules.html#entity-008>`_
|
||||
* `entity_012 <../entity_rules.html#entity-012>`_
|
||||
* `entity_specification_503 <../entity_specification_rules.html#entity-specification-503>`_
|
||||
* `file_500 <file_rules.html#file-500>`_
|
||||
* `function_017 <../function_rules.html#function-017>`_
|
||||
* `function_506 <../function_rules.html#function-506>`_
|
||||
* `function_507 <../function_rules.html#function-507>`_
|
||||
|
|
@ -31,6 +32,9 @@ Rules Enforcing Case::Name Rule Group
|
|||
* `instantiation_009 <../instantiation_rules.html#instantiation-009>`_
|
||||
* `instantiation_028 <../instantiation_rules.html#instantiation-028>`_
|
||||
* `instantiation_500 <../instantiation_rules.html#instantiation-500>`_
|
||||
|
||||
* `interface_incomplete_type_declaration_501 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-501>`_
|
||||
|
||||
* `library_500 <../library_rules.html#library-500>`_
|
||||
* `package_008 <../package_rules.html#package-008>`_
|
||||
* `package_010 <../package_rules.html#package-010>`_
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ Rules Enforcing Case Rule Group
|
|||
* `attribute_specification_501 <../attribute_specification_rules.html#attribute-specification-501>`_
|
||||
* `attribute_specification_502 <../attribute_specification_rules.html#attribute-specification-502>`_
|
||||
* `attribute_specification_503 <../attribute_specification_rules.html#attribute-specification-503>`_
|
||||
* `bit_string_literal_500 <bit_string_literal_rules.html#bit-string-literal-500>`_
|
||||
* `bit_string_literal_501 <bit_string_literal_rules.html#bit-string-literal-501>`_
|
||||
* `bit_string_literal_500 <../bit_string_literal_rules.html#bit-string-literal-500>`_
|
||||
* `bit_string_literal_501 <../bit_string_literal_rules.html#bit-string-literal-501>`_
|
||||
* `block_500 <../block_rules.html#block-500>`_
|
||||
* `block_501 <../block_rules.html#block-501>`_
|
||||
* `block_502 <../block_rules.html#block-502>`_
|
||||
|
|
@ -95,7 +95,13 @@ Rules Enforcing Case Rule Group
|
|||
* `external_constant_name_500 <../external_constant_name_rules.html#external-constant-name-500>`_
|
||||
* `external_signal_name_500 <../external_signal_name_rules.html#external-signal-name-500>`_
|
||||
* `external_variable_name_500 <../external_variable_name_rules.html#external-variable-name-500>`_
|
||||
* `file_open_information_500 <../file_open_information_rules.html#file-open-information-500>`_
|
||||
* `file_open_information_501 <../file_open_information_rules.html#file-open-information-501>`_
|
||||
* `file_open_information_502 <../file_open_information_rules.html#file-open-information-502>`_
|
||||
* `file_002 <../file_rules.html#file-002>`_
|
||||
* `file_500 <../file_rules.html#file-500>`_
|
||||
* `file_type_definition_500 <../file_type_definition_rules.html#file-type-definition-500>`_
|
||||
* `file_type_definition_501 <../file_type_definition_rules.html#file-type-definition-501>`_
|
||||
* `for_generate_statement_500 <../for_generate_statement_rules.html#for-generate-statement-500>`_
|
||||
* `for_generate_statement_501 <../for_generate_statement_rules.html#for-generate-statement-501>`_
|
||||
* `function_004 <../function_rules.html#function-004>`_
|
||||
|
|
@ -139,6 +145,10 @@ Rules Enforcing Case Rule Group
|
|||
* `instantiation_028 <../instantiation_rules.html#instantiation-028>`_
|
||||
* `instantiation_031 <../instantiation_rules.html#instantiation-031>`_
|
||||
* `instantiation_500 <../instantiation_rules.html#instantiation-500>`_
|
||||
|
||||
* `interface_incomplete_type_declaration_500 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-500>`_
|
||||
* `interface_incomplete_type_declaration_501 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-501>`_
|
||||
|
||||
* `iteration_scheme_500 <../iteration_scheme_rules.html#iteration-scheme-500>`_
|
||||
* `iteration_scheme_501 <../iteration_scheme_rules.html#iteration-scheme-501>`_
|
||||
* `library_004 <../library_rules.html#library-004>`_
|
||||
|
|
@ -252,6 +262,7 @@ Rules Enforcing Case Rule Group
|
|||
* `variable_002 <../variable_rules.html#variable-002>`_
|
||||
* `variable_004 <../variable_rules.html#variable-004>`_
|
||||
* `variable_011 <../variable_rules.html#variable-011>`_
|
||||
* `variable_500 <../variable_rules.html#variable-500>`_
|
||||
* `wait_500 <../wait_rules.html#wait-500>`_
|
||||
* `wait_501 <../wait_rules.html#wait-501>`_
|
||||
* `wait_502 <../wait_rules.html#wait-502>`_
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ Rules Enforcing Naming Rule Group
|
|||
* `generic_map_601 <../generic_map_rules.html#generic-map-601>`_
|
||||
* `instantiation_600 <../instantiation_rules.html#instantiation-600>`_
|
||||
* `instantiation_601 <../instantiation_rules.html#instantiation-601>`_
|
||||
* `interface_incomplete_type_declaration_600 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-600>`_
|
||||
* `interface_incomplete_type_declaration_601 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-601>`_
|
||||
* `library_012 <../library_rules.html#library-012>`_
|
||||
* `loop_statement_600 <../loop_statement_rules.html#loop-statement-600>`_
|
||||
* `loop_statement_601 <../loop_statement_rules.html#loop-statement-601>`_
|
||||
* `loop_statement_602 <../loop_statement_rules.html#loop-statement-602>`_
|
||||
|
|
@ -54,5 +57,6 @@ Rules Enforcing Naming Rule Group
|
|||
* `subtype_600 <../subtype_rules.html#subtype-600>`_
|
||||
* `type_015 <../type_rules.html#type-015>`_
|
||||
* `type_600 <../type_rules.html#type-600>`_
|
||||
* `use_clause_001 <../use_clause_rules.html#use-clause-001>`_
|
||||
* `variable_012 <../variable_rules.html#variable-012>`_
|
||||
* `variable_600 <../variable_rules.html#variable-600>`_
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ Rules Enforcing Structure::Optional Rule Group
|
|||
* `function_020 <../function_rules.html#function-020>`_
|
||||
* `generate_011 <../generate_rules.html#generate-011>`_
|
||||
* `instantiation_033 <../instantiation_rules.html#instantiation-033>`_
|
||||
* `instantiation_036 <../instantiation_rules.html#instantiation-036>`_
|
||||
* `loop_statement_007 <../loop_statement_rules.html#loop-statement-007>`_
|
||||
* `package_007 <../package_rules.html#package-007>`_
|
||||
* `package_014 <../package_rules.html#package-014>`_
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ Rules Enforcing Structure Rule Group
|
|||
* `instantiation_033 <../instantiation_rules.html#instantiation-033>`_
|
||||
* `instantiation_034 <../instantiation_rules.html#instantiation-034>`_
|
||||
* `instantiation_035 <../instantiation_rules.html#instantiation-035>`_
|
||||
* `instantiation_036 <../instantiation_rules.html#instantiation-036>`_
|
||||
* `library_010 <../library_rules.html#library-010>`_
|
||||
* `library_011 <../library_rules.html#library-011>`_
|
||||
* `loop_statement_001 <../loop_statement_rules.html#loop-statement-001>`_
|
||||
|
|
@ -172,6 +173,8 @@ Rules Enforcing Structure Rule Group
|
|||
* `signal_007 <../signal_rules.html#signal-007>`_
|
||||
* `signal_015 <../signal_rules.html#signal-015>`_
|
||||
* `signal_017 <../signal_rules.html#signal-017>`_
|
||||
* `signal_018 <../signal_rules.html#signal-018>`_
|
||||
* `signal_403 <../signal_rules.html#signal-403>`_
|
||||
* `source_file_001 <../source_file_rules.html#source-file-001>`_
|
||||
* `subprogram_instantiation_001 <../subprogram_instantiation_rules.html#subprogram-instantiation-001>`_
|
||||
* `subprogram_instantiation_002 <../subprogram_instantiation_rules.html#subprogram-instantiation-002>`_
|
||||
|
|
@ -185,7 +188,10 @@ Rules Enforcing Structure Rule Group
|
|||
* `type_017 <../type_rules.html#type-017>`_
|
||||
* `type_018 <../type_rules.html#type-018>`_
|
||||
* `variable_007 <../variable_rules.html#variable-007>`_
|
||||
* `variable_015 <../variable_rules.html#variable-015>`_
|
||||
* `variable_017 <../variable_rules.html#variable-017>`_
|
||||
* `variable_018 <../variable_rules.html#variable-018>`_
|
||||
* `variable_403 <../variable_rules.html#variable-403>`_
|
||||
* `variable_assignment_006 <../variable_assignment_rules.html#variable-assignment-006>`_
|
||||
* `variable_assignment_007 <../variable_assignment_rules.html#variable-assignment-007>`_
|
||||
* `variable_assignment_008 <../variable_assignment_rules.html#variable-assignment-008>`_
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `architecture_031 <../architecture_rules.html#architecture-031>`_
|
||||
* `architecture_032 <../architecture_rules.html#architecture-032>`_
|
||||
* `architecture_033 <../architecture_rules.html#architecture-033>`_
|
||||
* `array_constraint_100 <../array_constraint_rules.html#array-constraint-100>`_
|
||||
* `assert_100 <../assert_rules.html#assert-100>`_
|
||||
* `assert_101 <../assert_rules.html#assert-101>`_
|
||||
* `assert_102 <../assert_rules.html#assert-102>`_
|
||||
|
|
@ -29,6 +30,10 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `case_004 <../case_rules.html#case-004>`_
|
||||
* `case_005 <../case_rules.html#case-005>`_
|
||||
* `case_006 <../case_rules.html#case-006>`_
|
||||
* `case_generate_alternative_100 <../case_generate_alternative_rules.html#case-generate-alternative-100>`_
|
||||
* `case_generate_alternative_101 <../case_generate_alternative_rules.html#case-generate-alternative-101>`_
|
||||
* `case_generate_statement_100 <../case_generate_statement_rules.html#case-generate-statement-100>`_
|
||||
* `case_generate_statement_101 <../case_generate_statement_rules.html#case-generate-statement-101>`_
|
||||
* `comment_004 <../comment_rules.html#comment-004>`_
|
||||
* `comment_100 <../comment_rules.html#comment-100>`_
|
||||
* `component_002 <../component_rules.html#component-002>`_
|
||||
|
|
@ -50,6 +55,8 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `constant_010 <../constant_rules.html#constant-010>`_
|
||||
* `constant_100 <../constant_rules.html#constant-100>`_
|
||||
* `constant_101 <../constant_rules.html#constant-101>`_
|
||||
* `constrained_array_definition_100 <../constrained_array_definition_rules.html#constrained-array-definition-100>`_
|
||||
* `constrained_array_definition_101 <../constrained_array_definition_rules.html#constrained-array-definition-101>`_
|
||||
* `context_002 <../context_rules.html#context-002>`_
|
||||
* `context_017 <../context_rules.html#context-017>`_
|
||||
* `context_018 <../context_rules.html#context-018>`_
|
||||
|
|
@ -78,7 +85,12 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `external_variable_name_102 <../external_variable_name_rules.html#external-variable-name-102>`_
|
||||
* `external_variable_name_103 <../external_variable_name_rules.html#external-variable-name-103>`_
|
||||
* `external_variable_name_104 <../external_variable_name_rules.html#external-variable-name-104>`_
|
||||
* `file_open_information_100 <../file_open_information_rules.html#file-open-information-100>`_
|
||||
* `file_open_information_101 <../file_open_information_rules.html#file-open-information-101>`_
|
||||
* `file_open_information_102 <../file_open_information_rules.html#file-open-information-102>`_
|
||||
* `file_open_information_103 <../file_open_information_rules.html#file-open-information-103>`_
|
||||
* `file_100 <../file_rules.html#file-100>`_
|
||||
* `file_101 <../file_rules.html#file-101>`_
|
||||
* `function_100 <../function_rules.html#function-100>`_
|
||||
* `function_101 <../function_rules.html#function-101>`_
|
||||
* `generate_002 <../generate_rules.html#generate-002>`_
|
||||
|
|
@ -97,6 +109,9 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `if_004 <../if_rules.html#if-004>`_
|
||||
* `if_005 <../if_rules.html#if-005>`_
|
||||
* `if_015 <../if_rules.html#if-015>`_
|
||||
* `index_constraint_100 <../index_constraint_rules.html#index-constraint-100>`_
|
||||
* `index_subtype_definition_100 <../index_subtype_definition_rules.html#index-subtype-definition-100>`_
|
||||
* `index_subtype_definition_101 <../index_subtype_definition_rules.html#index-subtype-definition-101>`_
|
||||
* `instantiation_002 <../instantiation_rules.html#instantiation-002>`_
|
||||
* `instantiation_003 <../instantiation_rules.html#instantiation-003>`_
|
||||
* `instantiation_032 <../instantiation_rules.html#instantiation-032>`_
|
||||
|
|
@ -137,6 +152,8 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `process_014 <../process_rules.html#process-014>`_
|
||||
* `process_024 <../process_rules.html#process-024>`_
|
||||
* `process_025 <../process_rules.html#process-025>`_
|
||||
* `range_constraint_100 <../range_constraint_rules.html#range-constraint-100>`_
|
||||
* `range_constraint_101 <../range_constraint_rules.html#range-constraint-101>`_
|
||||
* `record_type_definition_100 <../record_type_definition_rules.html#record-type-definition-100>`_
|
||||
* `record_type_definition_101 <../record_type_definition_rules.html#record-type-definition-101>`_
|
||||
* `report_statement_100 <../report_statement_rules.html#report-statement-100>`_
|
||||
|
|
@ -167,6 +184,9 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `type_006 <../type_rules.html#type-006>`_
|
||||
* `type_007 <../type_rules.html#type-007>`_
|
||||
* `type_100 <../type_rules.html#type-100>`_
|
||||
* `unbounded_array_definition_100 <../unbounded_array_definition_rules.html#unbounded-array-definition-100>`_
|
||||
* `unbounded_array_definition_101 <../unbounded_array_definition_rules.html#unbounded-array-definition-101>`_
|
||||
* `unbounded_array_definition_102 <../unbounded_array_definition_rules.html#unbounded-array-definition-102>`_
|
||||
* `variable_005 <../variable_rules.html#variable-005>`_
|
||||
* `variable_006 <../variable_rules.html#variable-006>`_
|
||||
* `variable_100 <../variable_rules.html#variable-100>`_
|
||||
|
|
@ -182,9 +202,10 @@ Rules Enforcing Whitespace Rule Group
|
|||
* `whitespace_005 <../whitespace_rules.html#whitespace-005>`_
|
||||
* `whitespace_006 <../whitespace_rules.html#whitespace-006>`_
|
||||
* `whitespace_007 <../whitespace_rules.html#whitespace-007>`_
|
||||
* `whitespace_008 <../whitespace_rules.html#whitespace-008>`_
|
||||
* `whitespace_010 <../whitespace_rules.html#whitespace-010>`_
|
||||
* `whitespace_011 <../whitespace_rules.html#whitespace-011>`_
|
||||
* `whitespace_013 <../whitespace_rules.html#whitespace-013>`_
|
||||
* `whitespace_100 <../whitespace_rules.html#whitespace-100>`_
|
||||
* `whitespace_101 <../whitespace_rules.html#whitespace-101>`_
|
||||
* `whitespace_102 <../whitespace_rules.html#whitespace-102>`_
|
||||
* `whitespace_103 <../whitespace_rules.html#whitespace-103>`_
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ The rules are divided into categories depending on the part of the VHDL code bei
|
|||
external_signal_name_rules.rst
|
||||
external_variable_name_rules.rst
|
||||
file_rules.rst
|
||||
file_open_information_rules.rst
|
||||
file_type_definition_rules.rst
|
||||
for_loop_rules.rst
|
||||
for_generate_statement_rules.rst
|
||||
function_rules.rst
|
||||
|
|
@ -51,8 +53,10 @@ The rules are divided into categories depending on the part of the VHDL code bei
|
|||
ieee_rules.rst
|
||||
if_rules.rst
|
||||
if_generate_statement_rules.rst
|
||||
index_constraint_rules.rst
|
||||
index_subtype_definition_rules.rst
|
||||
instantiation_rules.rst
|
||||
interface_incomplete_type_declaration_rules.rst
|
||||
iteration_scheme_rules.rst
|
||||
length_rules.rst
|
||||
library_rules.rst
|
||||
|
|
|
|||
|
|
@ -334,6 +334,31 @@ This rule checks the structure of signal constraints.
|
|||
element2(3 downto 0)
|
||||
);
|
||||
|
||||
signal_018
|
||||
##########
|
||||
|
||||
|phase_1| |error| |structure|
|
||||
|
||||
This rule checks the **:=** is on the same line as the **signal** keyword.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal size : integer
|
||||
:= 1;
|
||||
signal width : integer
|
||||
:= 32;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal size : integer :=
|
||||
1;
|
||||
signal width : integer :=
|
||||
32;
|
||||
|
||||
signal_100
|
||||
##########
|
||||
|
||||
|
|
@ -456,6 +481,96 @@ This rule checks alignment of multiline constraints in signal declarations.
|
|||
element2(3 downto 0)
|
||||
);
|
||||
|
||||
signal_401
|
||||
##########
|
||||
|
||||
|phase_5| |error| |alignment|
|
||||
|
||||
This rule checks the alignment of assignment keywords in signal declarations.
|
||||
|
||||
|configuring_keyword_alignment_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal c_default_values : t_address_en := (
|
||||
c_address_control => false,
|
||||
c_address_data => true,
|
||||
others => false
|
||||
);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal c_default_values : t_address_en := (
|
||||
c_address_control => false,
|
||||
c_address_data => true,
|
||||
others => false
|
||||
);
|
||||
|
||||
signal_402
|
||||
##########
|
||||
|
||||
|phase_5| |error| |alignment|
|
||||
|
||||
This rule checks the alignment of multiline signal initializations that contain arrays.
|
||||
|
||||
|configuring_multiline_indent_rules_link|
|
||||
|
||||
.. NOTE:: The structure of multiline array signal initializations is handled by the rule `signal_403 <signal_rules.html#signal-403>`_.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal rom : romq_type :=
|
||||
(
|
||||
0,
|
||||
65535,
|
||||
32768
|
||||
);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal rom : romq_type :=
|
||||
(
|
||||
0,
|
||||
65535,
|
||||
32768
|
||||
);
|
||||
|
||||
signal_403
|
||||
##########
|
||||
|
||||
|phase_5| |error| |structure|
|
||||
|
||||
This rule checks the structure of multiline signal initializations that contain arrays.
|
||||
|
||||
|configuring_array_multiline_structure_rules_link|
|
||||
|
||||
.. NOTE:: The indenting of multiline array signal initializations is handled by the rule `signal_402 <signal_rules.html#signal-402>`_.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal rom : romq_type := (0, 65535, 32768);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal rom : romq_type :=
|
||||
(
|
||||
0,
|
||||
65535,
|
||||
32768
|
||||
);
|
||||
|
||||
signal_600
|
||||
##########
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,71 @@
|
|||
Unbounded Array Definition Rules
|
||||
--------------------------------
|
||||
|
||||
unbounded_array_definition_100
|
||||
##############################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for whitespace after the **array** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array_unconstrained is array (natural range <>) of unsigned;
|
||||
type t_u_array_unconstrained is array (natural range <>) of unsigned;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array_unconstrained is array(natural range <>) of unsigned;
|
||||
type t_u_array_unconstrained is array(natural range <>) of unsigned;
|
||||
|
||||
unbounded_array_definition_101
|
||||
##############################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before the **of** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array_unconstrained is array(natural range <>) of unsigned;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array_unconstrained is array(natural range <>) of unsigned;
|
||||
|
||||
unbounded_array_definition_102
|
||||
##############################
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after the **of** keyword.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array_unconstrained is array(natural range <>) of unsigned;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
type t_u_array_unconstrained is array(natural range <>) of unsigned;
|
||||
|
||||
unbounded_array_definition_500
|
||||
##############################
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ Identifier Restrictions
|
|||
With multiple options available, the user is required to make the decision.
|
||||
|
||||
* `architecture_025 <architecture_rules.html#architecture-025>`_
|
||||
* `instantiation_036 <instantiation_rules.html#instantiation-036>`_
|
||||
* `library_012 <../library_rules.html#library-012>`_
|
||||
* `use_clause_001 <../use_clause_rules.html#use-clause-001>`_
|
||||
|
||||
Lengths
|
||||
-------
|
||||
|
|
@ -103,6 +106,8 @@ With multiple options available, the user is required to make the decision.
|
|||
* `generic_map_601 <generic_map_rules.html#generic-map-601>`_
|
||||
* `instantiation_600 <instantiation_rules.html#instantiation-600>`_
|
||||
* `instantiation_601 <instantiation_rules.html#instantiation-601>`_
|
||||
* `interface_incomplete_type_declaration_600 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-600>`_
|
||||
* `interface_incomplete_type_declaration_601 <../interface_incomplete_type_declaration_rules.html#interface-incomplete-type-declaration-601>`_
|
||||
* `loop_statement_600 <loop_statement_rules.html#loop-statement-600>`_
|
||||
* `loop_statement_601 <loop_statement_rules.html#loop-statement-601>`_
|
||||
* `loop_statement_602 <loop_statement_rules.html#loop-statement-602>`_
|
||||
|
|
|
|||
|
|
@ -3,6 +3,25 @@
|
|||
Use Clause Rules
|
||||
----------------
|
||||
|
||||
use_clause_001
|
||||
##############
|
||||
|
||||
|phase_7| |disabled| |error| |unfixable| |naming|
|
||||
|
||||
This rule checks for packages that have been restricted by the user.
|
||||
|
||||
|configuring_library_and_package_name_restriction_rules_link|
|
||||
|
||||
.. NOTE:: This rule is disabled by default.
|
||||
|
||||
.. NOTE:: This rule is configured to restrict the std_logic_arith package by default.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
use ieee.std_logic_arith.all;
|
||||
|
||||
use_clause_500
|
||||
##############
|
||||
|
||||
|
|
|
|||
|
|
@ -240,6 +240,41 @@ The default variable prefix is *v_*.
|
|||
|
||||
variable v_my_var : natural;
|
||||
|
||||
variable_015
|
||||
############
|
||||
|
||||
|phase_1| |error| |structure|
|
||||
|
||||
This rule checks for multiple (shared) variable names defined in a single (shared) variable declaration.
|
||||
By default, this rule will only flag more than two (shared) variable declarations.
|
||||
|
||||
|configuring_number_of_variables_in_variable_declaration_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable var1, var2
|
||||
var3, var4,
|
||||
var5
|
||||
: std_logic;
|
||||
|
||||
shared variable var6, var7, var8 : std_logic;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable var1 : std_logic;
|
||||
variable var2 : std_logic;
|
||||
variable var3 : std_logic;
|
||||
variable var4 : std_logic;
|
||||
variable var5 : std_logic;
|
||||
|
||||
shared variable var6 : std_logic;
|
||||
shared variable var7 : std_logic;
|
||||
shared variable var8 : std_logic;
|
||||
|
||||
variable_017
|
||||
############
|
||||
|
||||
|
|
@ -266,6 +301,31 @@ This rule checks the structure of variable constraints.
|
|||
element2(3 downto 0)
|
||||
);
|
||||
|
||||
variable_018
|
||||
############
|
||||
|
||||
|phase_1| |error| |structure|
|
||||
|
||||
This rule checks the **:=** is on the same line as the **variable** keyword.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable size : integer
|
||||
:= 1;
|
||||
variable width : integer
|
||||
:= 32;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable size : integer :=
|
||||
1;
|
||||
variable width : integer :=
|
||||
32;
|
||||
|
||||
variable_100
|
||||
############
|
||||
|
||||
|
|
@ -383,6 +443,117 @@ This rule checks alignment of multiline constraints in variable declarations.
|
|||
element2(3 downto 0)
|
||||
);
|
||||
|
||||
variable_401
|
||||
############
|
||||
|
||||
|phase_5| |error| |alignment|
|
||||
|
||||
This rule checks the alignment of assignment keywords in variable declarations.
|
||||
|
||||
|configuring_keyword_alignment_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable v_default_values : t_address_en := (
|
||||
c_address_control => false,
|
||||
c_address_data => true,
|
||||
others => false
|
||||
);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable v_default_values : t_address_en := (
|
||||
c_address_control => false,
|
||||
c_address_data => true,
|
||||
others => false
|
||||
);
|
||||
|
||||
variable_402
|
||||
############
|
||||
|
||||
|phase_5| |error| |alignment|
|
||||
|
||||
This rule checks the alignment of multiline variable initializations that contain arrays.
|
||||
|
||||
|configuring_multiline_indent_rules_link|
|
||||
|
||||
.. NOTE:: The structure of multiline array variables is handled by the rule `variable_403 <variable_rules.html#variable-403>`_.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable rom : romq_type :=
|
||||
(
|
||||
0,
|
||||
65535,
|
||||
32768
|
||||
);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable rom : romq_type :=
|
||||
(
|
||||
0,
|
||||
65535,
|
||||
32768
|
||||
);
|
||||
|
||||
variable_403
|
||||
############
|
||||
|
||||
|phase_5| |error| |structure|
|
||||
|
||||
This rule checks the structure of multiline variable initializations that contain arrays.
|
||||
|
||||
|configuring_array_multiline_structure_rules_link|
|
||||
|
||||
.. NOTE:: The indenting of multiline array variables is handled by the rule `variable_402 <variable_rules.html#variable-402>`_.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable rom : romq_type := (0, 65535, 32768);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
variable rom : romq_type :=
|
||||
(
|
||||
0,
|
||||
65535,
|
||||
32768
|
||||
);
|
||||
|
||||
variable_500
|
||||
############
|
||||
|
||||
|phase_6| |error| |case| |case_keyword|
|
||||
|
||||
This rule checks that the keyword **shared** has proper case.
|
||||
|
||||
|configuring_uppercase_and_lowercase_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
SHARED variable size : integer;
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
shared variable size : integer;
|
||||
|
||||
variable_600
|
||||
############
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
vsg.rule_list
|
||||
=============
|
||||
|
||||
This is one of two classes you will use when incorporating vsg into another python program.
|
||||
|
||||
.. autoclass:: vsg.rule_list.rule_list
|
||||
:members:
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
vsg.vhdlFile
|
||||
============
|
||||
|
||||
This is one of two classes you will use when incorporating vsg into another python program.
|
||||
|
||||
.. autoclass:: vsg.vhdlFile.vhdlFile
|
||||
:members:
|
||||
|
|
@ -91,7 +91,8 @@ whitespace_005
|
|||
This rule checks for spaces after an open parenthesis.
|
||||
|
||||
.. NOTE::
|
||||
Spaces before numbers are allowed.
|
||||
Spaces before numbers are ignored.
|
||||
This can be disabled by setting the *'ignore_spaces_before_numbers'* attribute to *'False'*.
|
||||
|
||||
**Violation**
|
||||
|
||||
|
|
@ -156,23 +157,7 @@ This rule checks for spaces after a comma.
|
|||
whitespace_008
|
||||
##############
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for spaces after the **std_logic_vector** keyword.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal data : std_logic_vector (7 downto 0);
|
||||
signal counter : std_logic_vector (7 downto 0);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
signal data : std_logic_vector(7 downto 0);
|
||||
signal counter : std_logic_vector(7 downto 0);
|
||||
This rule has been deprecated and replaced with rule `index_constraint_100 <index_constraint_rules.html#index_constraint-100>`_.
|
||||
|
||||
whitespace_010
|
||||
##############
|
||||
|
|
@ -198,7 +183,7 @@ whitespace_011
|
|||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for at least a single space before and after math operators +, -, /, * and \*\*.
|
||||
This rule checks for at least a single space before and after math operators +, -, /, * and **.
|
||||
|
||||
**Violation**
|
||||
|
||||
|
|
@ -290,6 +275,52 @@ This rule checks for at least a single space before and after logical operators.
|
|||
if (a = '1') sll (b = '0')
|
||||
if (a = '0') rol (b = '1')
|
||||
|
||||
whitespace_102
|
||||
##############
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space before direction keywords.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
x <= y(7 downto 0);
|
||||
x <= y(0 to 7);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
x <= y(7 downto 0);
|
||||
x <= y(0 to 7);
|
||||
|
||||
whitespace_103
|
||||
##############
|
||||
|
||||
|phase_2| |error| |whitespace|
|
||||
|
||||
This rule checks for a single space after direction keywords.
|
||||
|
||||
|configuring_whitespace_rules_link|
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
x <= y(7 downto 0);
|
||||
x <= y(0 to 7);
|
||||
|
||||
**Fix**
|
||||
|
||||
.. code-block:: vhdl
|
||||
|
||||
x <= y(7 downto 0);
|
||||
x <= y(0 to 7);
|
||||
|
||||
whitespace_200
|
||||
##############
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@ dependencies = [
|
|||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pre-commit",
|
||||
"pre-commit>=3.2.0",
|
||||
"pylint",
|
||||
"wheel",
|
||||
]
|
||||
tests = [
|
||||
"pytest",
|
||||
|
|
@ -60,9 +61,6 @@ docs = [
|
|||
name = "Jeremiah C Leary"
|
||||
email = "jeremiah.c.leary@gmail.com"
|
||||
|
||||
[project.license]
|
||||
file = "LICENSE"
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/jeremiah-c-leary/vhdl-style-guide"
|
||||
Download = "https://github.com/jeremiah-c-leary/vhdl-style-guide"
|
||||
|
|
@ -73,6 +71,8 @@ vsg = "vsg.__main__:main"
|
|||
[tool.setuptools-git-versioning]
|
||||
enabled = true
|
||||
template = "{tag}"
|
||||
dev_template = "{tag}.post{ccount}+git.{sha}"
|
||||
dirty_template = "{tag}.post{ccount}+git.{sha}.dirty"
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
"vsg.rules" = [
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_001_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_after_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ lExpected_no_no_no.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_002_test_input.fixed_no_no_no.vhd"), lExpected_no_no_no)
|
||||
|
||||
|
||||
class test_after_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_003_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_after_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_after_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_001_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_100_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_101_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_102_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_103_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_300_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_501_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_502_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ sTestDir = os.path.dirname(__file__)
|
|||
lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_600_test_input.vhd"))
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ sTestDir = os.path.dirname(__file__)
|
|||
lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_601_test_input.vhd"))
|
||||
|
||||
|
||||
class test_alias_declaration_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -118,3 +118,10 @@ begin
|
|||
);
|
||||
|
||||
end architecture;
|
||||
|
||||
-- Testing case where entity name is not detected
|
||||
architecture beh of test3 is
|
||||
|
||||
begin
|
||||
|
||||
end architecture beh;
|
||||
|
|
|
|||
|
|
@ -118,3 +118,10 @@ begin
|
|||
);
|
||||
|
||||
end architecture;
|
||||
|
||||
-- Testing case where entity name is not detected
|
||||
architecture beh of test3 is
|
||||
|
||||
begin
|
||||
|
||||
end architecture beh;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_001_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_003_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_004_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_005_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_006_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_007_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_008_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_009_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_remove.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_010_test_input.fixed_remove.vhd"), lExpected_remove)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_011_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ lExpected.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_012_test_input.fixed.vhd"), lExpected)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_013_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ lExpected_upper.append("")
|
|||
utils.read_file(os.path.join(sTestDir, "rule_014_test_input.fixed_upper.vhd"), lExpected_upper)
|
||||
|
||||
|
||||
class test_architecture_rule(unittest.TestCase):
|
||||
class test_rule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.oFile = vhdlFile.vhdlFile(lFile)
|
||||
self.assertIsNone(eError)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue