Skip to content

Commit fc5bd95

Browse files
committed
Removed python 2.7 compatibility
1 parent c1c1856 commit fc5bd95

37 files changed

+477
-745
lines changed

doc/source/manual/conversion.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Conversion to Verilog and VHDL
1212
Introduction
1313
============
1414

15-
Subject to some limitations,
15+
Subject to some limitations,
1616
MyHDL supports the automatic conversion of MyHDL code to
1717
Verilog or VHDL code. This feature provides a path from MyHDL into a
1818
standard Verilog or VHDL based design environment.
@@ -30,8 +30,8 @@ defined as the :dfn:`convertible subset`. This is described
3030
in detail in :ref:`conv-subset`.
3131

3232
A convertible design can be converted to an equivalent model in Verilog
33-
or VHDL, using the function :func:`toVerilog` or :func:`toVHDL` from the MyHDL
34-
library.
33+
or VHDL, using the function :func:`toVerilog` or :func:`toVHDL` from the MyHDL
34+
library.
3535

3636
When the design is intended for implementation
3737
a third-party :dfn:`synthesis tool` is used to compile the Verilog or VHDL
@@ -77,7 +77,7 @@ The module ports are inferred from signal usage
7777
declared. The converter investigates signal usage in the design hierarchy to
7878
infer whether a signal is used as input, output, or as an internal signal.
7979

80-
Interfaces are convertible
80+
Interfaces are convertible
8181
An *interface*: an object that has a number of :class:`Signal` objects as its
8282
attributes. The convertor supports this by name expansion and mangling.
8383

@@ -190,8 +190,8 @@ Supported types
190190
---------------
191191

192192
The most important restriction regards object types. Only a limited
193-
amount of types can be converted. Python :class:`int` and
194-
:class:`long` objects are mapped to Verilog or VHDL integers. All
193+
amount of types can be converted. Python :class:`int` is mapped
194+
to Verilog or VHDL integers. All
195195
other supported types need to have a defined bit width. The
196196
supported types are the Python :class:`bool` type, the MyHDL
197197
:class:`intbv` type, and MyHDL enumeration types returned by function
@@ -246,7 +246,7 @@ MyHDL types is summarized in the following table.
246246

247247
Notes:
248248

249-
(1)
249+
(1)
250250
The VHDL ``std_logic`` type is defined in the standard VHDL package
251251
``IEEE.std_logic_1164``.
252252

@@ -262,9 +262,9 @@ Notes:
262262
(4)
263263
All list members should have identical value constraints.
264264

265-
265+
266266
(5)
267-
Lists are mapped to Verilog memories.
267+
Lists are mapped to Verilog memories.
268268

269269

270270
The table as presented applies to MyHDL variables. The convertor also
@@ -340,7 +340,7 @@ converter, possibly qualified with restrictions or usage notes.
340340

341341
is not supported.
342342

343-
343+
344344
:keyword:`raise`
345345
This statement is mapped to statements that end the simulation with an
346346
error message.
@@ -440,7 +440,7 @@ objects as its attributes. Grouping signals into an interface simplifies the
440440
code, improves efficiency, and reduces errors.
441441

442442
The convertor supports interface using hierarchical name expansion and name
443-
mangling.
443+
mangling.
444444

445445
.. _conv-meth-assign:
446446

@@ -574,15 +574,15 @@ The value of :attr:`verilog_code` or :attr:`vhdl_code` should be a Python
574574
template string. A template string supports ``$``-based substitutions.
575575
The ``$name`` notation can be used to refer to the
576576
variable names in the context of the string. The convertor will
577-
substitute the appropriate values in the string and then insert it
577+
substitute the appropriate values in the string and then insert it
578578
instead of the regular converted output.
579579

580580
There is one more issue with user-defined code.
581581
Normally, the converter infers inputs, internal signals,
582582
and outputs. It also detects undriven and multiple driven signals. To
583583
do this, it assumes that signals are not driven by default. It then
584584
processes the code to find out which signals are driven from
585-
where.
585+
where.
586586

587587
Proper signal usage inference cannot be done with user-defined code. Without
588588
user help, this will result in warnings or errors during the
@@ -710,7 +710,7 @@ non-synthesizable feature that are of interest for test benches.
710710

711711
the :keyword:`while` loop
712712
:keyword:`while` loops can be used for high-level control structures.
713-
713+
714714
the :keyword:`raise` statement
715715
A :keyword:`raise` statement can stop the simulation on an error condition.
716716

@@ -795,7 +795,7 @@ Known issues
795795
Verilog and VHDL integers are 32 bit wide
796796
Usually, Verilog and VHDL integers are 32 bit wide. In contrast,
797797
Python is moving toward integers with undefined width. Python
798-
:class:`int` and :class:`long` variables are mapped to Verilog
798+
:class:`int` is mapped to Verilog
799799
integers; so for values wider than 32 bit this mapping is
800800
incorrect.
801801

doc/source/manual/reference.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Regular signals
173173

174174

175175
.. attribute:: driven
176-
176+
177177
Writable attribute that can be used to indicate that the signal is supposed to
178178
be driven from the MyHDL code, and possibly how it should be declared in Verilog after
179179
conversion. The allowed values are ``'reg'``, ``'wire'``, ``True`` and ``False``.
@@ -182,9 +182,9 @@ Regular signals
182182
whether and how a signal is driven. This occurs when the signal is driven from
183183
user-defined code. ``'reg'`` and ``'wire'`` are "true" values that
184184
permit finer control for the Verilog case.
185-
185+
186186
.. attribute:: read
187-
187+
188188
Writable boolean attribute that can be used to indicate that the signal is read.
189189

190190
This attribute is useful when the converter cannot infer automatically
@@ -195,7 +195,7 @@ Regular signals
195195

196196
.. method:: Signal.__call__(left[, right=None])
197197

198-
This method returns a :class:`_SliceSignal` shadow signal.
198+
This method returns a :class:`_SliceSignal` shadow signal.
199199

200200

201201
.. class:: ResetSignal(val, active, async)
@@ -210,7 +210,7 @@ Regular signals
210210
This class should be used in conjunction with the :func:`always_seq`
211211
decorator.
212212

213-
213+
214214
Shadow signals
215215
^^^^^^^^^^^^^^
216216

@@ -234,21 +234,21 @@ Shadow signals
234234

235235
.. class:: ConcatSignal(*args)
236236

237-
This class creates a new shadow signal of the concatenation of its arguments.
237+
This class creates a new shadow signal of the concatenation of its arguments.
238238

239239
You can pass an arbitrary number of arguments to the constructor. The
240240
arguments should be bit-oriented with a defined number of bits. The following
241241
argument types are supported: :class:`intbv` objects with a defined bit width,
242-
:class:`bool` objects, signals of the previous objects, and bit strings.
242+
:class:`bool` objects, signals of the previous objects, and bit strings.
243243

244244
The new signal follows the value changes of the signal arguments. The non-signal
245-
arguments are used to define constant values in the concatenation.
245+
arguments are used to define constant values in the concatenation.
246246

247247
.. class:: TristateSignal(val)
248248

249249
This class is used to construct a new tristate signal. The
250250
underlying type is specified by the *val*
251-
parameter.
251+
parameter.
252252
It is a Signal subclass and has the usual attributes, with
253253
one exception: it doesn't support the ``next``
254254
attribute. Consequently, direct signal assignment to a tristate
@@ -389,7 +389,7 @@ generators from local generator functions.
389389

390390
def _gen_func()
391391
while True:
392-
yield event1, event2, ...
392+
yield event1, event2, ...
393393
_func()
394394
...
395395
inst = _gen_func()
@@ -439,10 +439,10 @@ The :class:`intbv` class
439439

440440
This class represents :class:`int`\ -like objects with some
441441
additional features that make it suitable for hardware
442-
design.
442+
design.
443443

444-
The *val* argument can be an :class:`int`, a
445-
:class:`long`, an :class:`intbv` or a bit string (a string with
444+
The *val* argument can be an :class:`int`, an :class:`intbv`
445+
or a bit string (a string with
446446
only '0's or '1's). For a bit string argument, the value is
447447
calculated as in ``int(bitstring, 2)``. The optional *min* and
448448
*max* arguments can be used to specify the minimum and maximum
@@ -484,10 +484,10 @@ logical, and conversion operations as :class:`int` objects. See
484484
http://www.python.org/doc/current/lib/typesnumeric.html for more information on
485485
such operations. In all binary operations, :class:`intbv` objects can work
486486
together with :class:`int` objects. For mixed-type numeric operations, the
487-
result type is an :class:`int` or a :class:`long`. For mixed-type bitwise
487+
result type is an :class:`int`. For mixed-type bitwise
488488
operations, the result type is an :class:`intbv`.
489489

490-
In addition, :class:`intbv` supports a number of sequence operators.
490+
In addition, :class:`intbv` supports a number of sequence operators.
491491
In particular, the :func:`len` function returns the object's bit width. Furthermore,
492492
:class:`intbv` objects support indexing and slicing operations:
493493

@@ -552,11 +552,11 @@ The :class:`modbv` class
552552
Instead of throwing an exception when those constraints are exceeded,
553553
the value of :class:`modbv` objects wraps around according to the
554554
following formula::
555-
555+
556556
val = (val - min) % (max - min) + min
557-
557+
558558
This formula is a generalization of modulo wrap-around behavior that
559-
is often useful when describing hardware system behavior.
559+
is often useful when describing hardware system behavior.
560560

561561
The :func:`enum` factory function
562562
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -610,12 +610,12 @@ useful for hardware description.
610610

611611
The following argument types are supported: :class:`intbv` objects with a
612612
defined bit width, :class:`bool` objects, signals of the previous objects, and
613-
bit strings. All these objects have a defined bit width.
613+
bit strings. All these objects have a defined bit width.
614614

615-
The first argument *base* is special as it does not need to have a
615+
The first argument *base* is special as it does not need to have a
616616
defined bit width. In addition to
617-
the previously mentioned objects, unsized :class:`intbv`, :class:`int` and
618-
:class:`long` objects are supported, as well as signals of such objects.
617+
the previously mentioned objects, unsized :class:`intbv` and :class:`int`
618+
objects are supported, as well as signals of such objects.
619619

620620
:rtype: :class:`intbv`
621621

@@ -748,7 +748,7 @@ Conversion
748748
``func(*args, **kwargs)``. It can be assigned to an instance name.
749749
The top-level instance name and the basename of the Verilog
750750
output filename is ``func.func_name`` by default.
751-
751+
752752
:func:`toVHDL` has the following attributes:
753753

754754
.. attribute:: name
@@ -767,17 +767,17 @@ Conversion
767767
VHDL output. When a string is assigned to it, it will be copied
768768
to the appropriate place in the output file.
769769

770-
.. attribute:: library
770+
.. attribute:: library
771771

772772
This attribute can be used to set the library in the VHDL output
773-
file. The assigned value should be a string. The default
773+
file. The assigned value should be a string. The default
774774
library is ``work``.
775775

776776
.. attribute:: std_logic_ports
777777

778778
This boolean attribute can be used to have only ``std_logic`` type
779779
ports on the top-level interface (when ``True``) instead of the
780-
default ``signed/unsigned`` types (when ``False``, the default).
780+
default ``signed/unsigned`` types (when ``False``, the default).
781781

782782

783783

@@ -819,7 +819,7 @@ Conversion output verification
819819

820820
.. module:: myhdl.conversion
821821

822-
MyHDL provides an interface to verify converted designs.
822+
MyHDL provides an interface to verify converted designs.
823823
This is used extensively in the package itself to verify the conversion
824824
functionality. This capability is exported by the package so that users
825825
can use it also.
@@ -846,7 +846,7 @@ the :mod:`myhdl.conversion` package.
846846
.. function:: analyze(func[, *args][, **kwargs])
847847

848848
Used like :func:`toVHDL()` and :func:`toVerilog()`. It converts MyHDL code, and analyzes the
849-
resulting HDL.
849+
resulting HDL.
850850
Used to verify whether the HDL output is syntactically correct.
851851

852852
This function has the following attribute:

doc/source/whatsnew/0.3.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ For example, suppose that we have a mux module described as follows:
124124

125125
def mux(z, a, b, sel):
126126
""" Multiplexer.
127-
127+
128128
z -- mux output
129129
a, b -- data inputs
130130
sel -- control input
@@ -146,7 +146,7 @@ Using :func:`always_comb()`, we can describe it as follows instead:
146146

147147
def mux(z, a, b, sel):
148148
""" Multiplexer.
149-
149+
150150
z -- mux output
151151
a, b -- data inputs
152152
sel -- control input
@@ -182,7 +182,7 @@ returned explicitly. The following is a schematic example:
182182
instance_2 = module_2(...)
183183
...
184184
instance_n = module_n(...)
185-
...
185+
...
186186
return instance_1, instance_2, ... , instance_n
187187

188188
It may be convenient to assemble the list of instances automatically,
@@ -255,7 +255,7 @@ be used as follows:
255255
...
256256
def process_n():
257257
...
258-
...
258+
...
259259
return processes()
260260

261261
To conclude, a top level function with both instances and processes can
@@ -340,7 +340,7 @@ returned a new :class:`intbv` object, even in mixed-mode operations with
340340
:class:`int`, and bitwise operations return a :class:`intbv`. In this
341341
way, the return value corresponds better to the nature of the operation.
342342

343-
Function :func:`concat()`
343+
Function :func:`concat()`
344344
==========================
345345

346346
In previous versions, the :class:`intbv` class provided a method. This
@@ -352,7 +352,7 @@ concatenated: :class:`intbv` objects with a defined bit width,
352352
:class:`bool` objects, the corresponding signal objects, and bit
353353
strings. All these objects have a defined bit width. Moreover, the first
354354
argument doesn’t need to have a defined bit width. It can also be an
355-
unsized :class:`intbv`, an :class:`int`, a :class:`long`, or a
355+
unsized :class:`intbv`, an :class:`int`, or a
356356
corresponding signal object. Function :func:`concat()` returns an
357357
:class:`intbv` object.
358358

0 commit comments

Comments
 (0)