Skip to content

Commit 7738cc3

Browse files
Update README with install instructions
1 parent a557702 commit 7738cc3

File tree

2 files changed

+46
-17
lines changed

2 files changed

+46
-17
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
tests/*-out.vhdl
2-
__pycache__
1+
__pycache__
2+
dist
3+
vhdlproc.egg-info

README.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# VHDLproc
22

3-
VHDLproc is a simple command line VHDL preprocessor written in Python following the conditional compilation directives outlined in VHDL-2019
3+
VHDLproc is a simple command line VHDL preprocessor written in Python following the conditional compilation directives outlined in VHDL-2019, with a few addons
4+
5+
## Installation
6+
7+
VHDLproc can be installed via pip:
8+
```
9+
$ pip install vhdlproc
10+
$ vhdlproc --help
11+
```
12+
13+
It can also be installed from source
14+
```
15+
$ git clone https://github.com/nobodywasishere/vhdlproc
16+
$ cd vhdlproc
17+
$ python setup.py install --user
18+
$ vhdlproc --help
19+
```
20+
21+
It can also simply be run as a standalone file
22+
```
23+
$ git clone https://github.com/nobodywasishere/vhdlproc
24+
$ cd vhdlproc
25+
$ ./vhdlproc/vhdlproc.py --help
26+
```
427

528
## Usage
629

@@ -51,9 +74,14 @@ processor = VHDLproc()
5174

5275
identifiers = {"VHDL_VERSION": "2008"}
5376

54-
code = '''
55-
`warning "Hello"
56-
'''
77+
code = [
78+
'`warning "Hello"',
79+
'constant test_var : integer := 100',
80+
'`if TOOL_VERSION < "2.0" then',
81+
'`error "UNSUPPORTED VHDLPROC VERSION"',
82+
'`end',
83+
'`include "some/file.vhdl"',
84+
]
5785

5886
parsed_text = processor.parse_file(code, identifiers=identifiers, include_path="path/to/pull/include/directives/from")
5987
```
@@ -87,7 +115,7 @@ By default, `TOOL_NAME` is set to `VHDLproc` and `TOOL_VERSION` is set to the cu
87115

88116
## Examples
89117

90-
More examples included under `tests/`.
118+
More examples included under `vhdlproc/tests/`.
91119

92120
### Include File
93121

@@ -168,11 +196,11 @@ Input:
168196
`define b "b"
169197
170198
`if a = "a" then
171-
`if b = "b" then
172-
a = "a" and b = "b"
173-
`else
174-
a = "a" and b /= "b"
175-
`end
199+
`if b = "b" then
200+
a = "a" and b = "b"
201+
`else
202+
a = "a" and b /= "b"
203+
`end
176204
`end
177205
```
178206

@@ -182,11 +210,11 @@ Output:
182210
-- `define b "b"
183211
184212
-- `if a = "a" then
185-
-- `if b = "b" then
186-
a = "a" and b = "b"
187-
-- `else
188-
-- a = "a" and b /= "b"
189-
-- `end
213+
-- `if b = "b" then
214+
a = "a" and b = "b"
215+
-- `else
216+
-- a = "a" and b /= "b"
217+
-- `end
190218
-- `end
191219
```
192220

0 commit comments

Comments
 (0)