Skip to content

Commit 61a8cd1

Browse files
committed
setup.py is updated for the dependency attributes.
1 parent 3fc340e commit 61a8cd1

File tree

12 files changed

+62
-79
lines changed

12 files changed

+62
-79
lines changed

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,33 @@ Pyverilog includes **(1) code parser, (2) dataflow analyzer, (3) control-flow an
5151
You can create your own design analyzer, code translator and code generator of Verilog HDL based on this toolkit.
5252

5353

54-
Software Requirements
54+
Installation
5555
==============================
5656

57-
* Python (2.7, 3.3 or later)
58-
* Icarus Verilog (0.9.6 or later)
59-
- pyverilog.vparser.preprocessor.py uses 'iverilog -E' command as the preprocessor.
60-
- 'apt-get install iverilog'
61-
* Graphviz and Pygraphviz (Python3 does not support Pygraphviz)
62-
- pyverilog.dataflow.graphgen and pyverilog.controlflow.controlflow (without --nograph option) use Pygraphviz (on Python 2.7).
63-
- If you do not use graphgen and controlflow (without --nograph) option, Python 3.x is fine.
64-
* Jinja2 (2.7 or later)
65-
- ast\_code\_generator requires jinja2 module.
66-
- 'pip3 install jinja2' (for Python 3.x) or 'pip install jinja2' (for Python 2.7)
57+
Software Requirements
58+
--------------------
6759

60+
- Python: 2.7, 3.4 or later
6861

69-
Installation
70-
==============================
62+
- Icarus Verilog: 0.9.7 or later
7163

72-
If you want to use Pyverilog as a general library, you can install on your environment by using setup.py.
73-
If Python 2.7 is used,
64+
Install on your platform. For exmple, on Ubuntu:
7465

75-
python setup.py install
66+
sudo apt-get install iverilog
67+
68+
- Jinja2: 2.8 or later
69+
- pytest: 2.8.2 or later
70+
- pytest-pythonpath: 0.7 or lator
71+
- Pygraphviz: 1.3.1 or later (Option for graph visualization in dataflow/graphgen.py and controlflow/controlflow_analyzer.py)
72+
73+
Install on your python environment by using pip.
7674

77-
If Python 3.x is used,
75+
pip install jinja2 pytest pytest-pythonpath
76+
(pip install pygraphviz) # option
7877

79-
python3 setup.py install
78+
Finally, install Pyverilog.
79+
80+
python setup.py install
8081

8182

8283
Tools

README.rst

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,40 @@ control-flow analyzer and (4) code generator**. You can create your own
5353
design analyzer, code translator and code generator of Verilog HDL based
5454
on this toolkit.
5555

56-
Software Requirements
57-
=====================
58-
59-
- Python (2.7, 3.3 or later)
60-
- Icarus Verilog (0.9.6 or later)
61-
- pyverilog.vparser.preprocessor.py uses 'iverilog -E' command as the
62-
preprocessor.
63-
- 'apt-get install iverilog'
64-
- Graphviz and Pygraphviz (Python3 does not support Pygraphviz)
65-
- pyverilog.dataflow.graphgen and pyverilog.controlflow.controlflow
66-
(without --nograph option) use Pygraphviz (on Python 2.7).
67-
- If you do not use graphgen and controlflow (without --nograph)
68-
option, Python 3.x is fine.
69-
- Jinja2 (2.7 or later)
70-
- ast\_code\_generator requires jinja2 module.
71-
- 'pip3 install jinja2' (for Python 3.x) or 'pip install jinja2' (for
72-
Python 2.7)
73-
7456
Installation
7557
============
7658

77-
If you want to use Pyverilog as a general library, you can install on
78-
your environment by using setup.py. If Python 2.7 is used,
59+
Software Requirements
60+
---------------------
61+
62+
- Python: 2.7, 3.4 or later
63+
64+
- Icarus Verilog: 0.9.7 or later
65+
66+
Install on your platform. For exmple, on Ubuntu:
7967

8068
::
8169

82-
python setup.py install
70+
sudo apt-get install iverilog
71+
72+
- Jinja2: 2.8 or later
73+
- pytest: 2.8.2 or later
74+
- pytest-pythonpath: 0.7 or lator
75+
- Pygraphviz: 1.3.1 or later (Option for graph visualization in
76+
dataflow/graphgen.py and controlflow/controlflow\_analyzer.py)
8377

84-
If Python 3.x is used,
78+
Install on your python environment by using pip.
8579

8680
::
8781

88-
python3 setup.py install
82+
pip install jinja2 pytest pytest-pythonpath
83+
(pip install pygraphviz) # option
84+
85+
Finally, install Pyverilog.
86+
87+
::
88+
89+
python setup.py install
8990

9091
Tools
9192
=====

pyverilog/ast_code_generator/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
PYTHON=python3
2+
#PYTHON=python
23
#OPT=-m pdb
34
#OPT=-m cProfile -s time
45
#OPT=-m cProfile -o profile.rslt

pyverilog/controlflow/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PYTHON=python3
2-
#PYTHON=python2.7
2+
#PYTHON=python
33
#OPT=-m pdb
44
#OPT=-m cProfile -s time
55
#OPT=-m cProfile -o profile.rslt

pyverilog/controlflow/controlflow_analyzer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Controlflow analyzer
55
#
66
# for visualization, graphviz and pygraphviz are required
7-
# (only Python 2.7 is supported)
87
#
98
# Copyright (C) 2013, Shinya Takamaeda-Yamazaki
109
# License: Apache 2.0
@@ -205,9 +204,9 @@ def view(self):
205204
print(''.join(s))
206205

207206
def tograph(self, filename='fsm.png', nolabel=False):
208-
import pygraphviz as pgv # Python 3 currently does not support Pygraphviz
209-
210-
graph = pgv.AGraph(directed=True) #pgv.AGraph(strict=False, directed=True)
207+
import pygraphviz as pgv
208+
#graph = pgv.AGraph(strict=False, directed=True)
209+
graph = pgv.AGraph(directed=True)
211210
for src, dstdict in self.fsm.items():
212211
graph.add_node(str(src), label=str(src))
213212
for cond, dst in dstdict.items():

pyverilog/dataflow/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PYTHON=python3
2-
#PYTHON=python2.7
3-
PYTHON27=python2.7
2+
#PYTHON=python
43
#OPT=-m pdb
54
#OPT=-m cProfile -s time
65
#OPT=-m cProfile -o profile.rslt
@@ -46,7 +45,7 @@ codegen:
4645

4746
.PHONY: graphgen
4847
graphgen:
49-
$(PYTHON27) $(OPT) $(GRAPHGEN) $(SRCS) $(TOP) $(TARGETS) $(GRAPHGEN_OPT)
48+
$(PYTHON) $(OPT) $(GRAPHGEN) $(SRCS) $(TOP) $(TARGETS) $(GRAPHGEN_OPT)
5049

5150
.PHONY: clean
5251
clean:

pyverilog/dataflow/codegen.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,8 @@ def _toCode(self, terms, parameter, assign, always_clockedge, always_combination
170170
if __name__ == '__main__':
171171
from optparse import OptionParser
172172
import pyverilog.utils.util as util
173-
if sys.version_info[0] >= 3:
174-
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
175-
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
176-
else:
177-
from dataflow_analyzer import VerilogDataflowAnalyzer
178-
from optimizer import VerilogDataflowOptimizer
173+
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
174+
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
179175
INFO = "Code generator from Verilog dataflow definitions"
180176
VERSION = pyverilog.utils.version.VERSION
181177
USAGE = "Usage: python codegen.py -t TOPMODULE file ..."

pyverilog/dataflow/graphgen.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,8 @@ def add_edge(self, start, end, color='black', label=None):
180180
if __name__ == '__main__':
181181
from optparse import OptionParser
182182
import pyverilog.utils.util as util
183-
if sys.version_info[0] >= 3:
184-
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
185-
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
186-
else:
187-
from dataflow_analyzer import VerilogDataflowAnalyzer
188-
from optimizer import VerilogDataflowOptimizer
183+
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
184+
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
189185
INFO = "Graph generator from dataflow"
190186
VERSION = pyverilog.utils.version.VERSION
191187
USAGE = "Usage: python graphgen.py -t TOPMODULE -s TARGETSIGNAL file ..."

pyverilog/dataflow/merge.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,8 @@ def unmatchedRange(self, matched_range, search_msb, search_lsb, search_ptr):
497497
if __name__ == '__main__':
498498
from optparse import OptionParser
499499
import pyverilog.utils.util as util
500-
if sys.version_info[0] >= 3:
501-
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
502-
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
503-
else:
504-
from dataflow_analyzer import VerilogDataflowAnalyzer
505-
from optimizer import VerilogDataflowOptimizer
500+
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
501+
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
506502
INFO = "Dataflow merge module"
507503
VERSION = pyverilog.utils.version.VERSION
508504
USAGE = "Usage: python merge.py -t TOPMODULE file ..."

pyverilog/dataflow/subset.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,8 @@ def _discretion(self, visited_binddict, visited_sources):
127127
if __name__ == '__main__':
128128
from optparse import OptionParser
129129
import pyverilog.utils.util as util
130-
if sys.version_info[0] >= 3:
131-
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
132-
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
133-
else:
134-
from dataflow_analyzer import VerilogDataflowAnalyzer
135-
from optimizer import VerilogDataflowOptimizer
130+
from pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer
131+
from pyverilog.dataflow.optimizer import VerilogDataflowOptimizer
136132
INFO = "Subset generator from Verilog dataflow definitions"
137133
VERSION = pyverilog.utils.version.VERSION
138134
USAGE = "Usage: python subset.py -t TOPMODULE file ..."

0 commit comments

Comments
 (0)