mirror of
https://github.com/myhdl/myhdl.git
synced 2024-12-14 07:44:38 +08:00
Merge branch 'Python3_9' of https://github.com/josyb/myhdl into Python3_9
This commit is contained in:
commit
fddbd06595
1
.gitignore
vendored
1
.gitignore
vendored
@ -36,3 +36,4 @@ myhdl/**/*.vhd
|
|||||||
|
|
||||||
# Pycharm ide junk
|
# Pycharm ide junk
|
||||||
.idea/
|
.idea/
|
||||||
|
/.pytest_cache/
|
||||||
|
@ -1251,7 +1251,6 @@ class _ConvertVisitor(ast.NodeVisitor, _ConversionMixin):
|
|||||||
self.write("to_signed(%s, %s)" % (n, node.vhd.size))
|
self.write("to_signed(%s, %s)" % (n, node.vhd.size))
|
||||||
else:
|
else:
|
||||||
self.write('signed\'("%s")' % tobin(n, node.vhd.size))
|
self.write('signed\'("%s")' % tobin(n, node.vhd.size))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if n < 0:
|
if n < 0:
|
||||||
self.write("(")
|
self.write("(")
|
||||||
@ -2295,18 +2294,18 @@ class _AnnotateTypesVisitor(ast.NodeVisitor, _ConversionMixin):
|
|||||||
if sys.version_info >= (3, 8, 0):
|
if sys.version_info >= (3, 8, 0):
|
||||||
|
|
||||||
def visit_Constant(self, node):
|
def visit_Constant(self, node):
|
||||||
if node.value in (True, False, None):
|
if isinstance(node.value, int):
|
||||||
# NameConstant
|
|
||||||
node.vhd = inferVhdlObj(node.value)
|
|
||||||
elif isinstance(node.value, str):
|
|
||||||
# Str
|
|
||||||
node.vhd = vhd_string()
|
|
||||||
elif isinstance(node.value, int):
|
|
||||||
# Num
|
# Num
|
||||||
if node.value < 0:
|
if node.value < 0:
|
||||||
node.vhd = vhd_int()
|
node.vhd = vhd_int()
|
||||||
else:
|
else:
|
||||||
node.vhd = vhd_nat()
|
node.vhd = vhd_nat()
|
||||||
|
elif node.value in (True, False, None):
|
||||||
|
# NameConstant
|
||||||
|
node.vhd = inferVhdlObj(node.value)
|
||||||
|
elif isinstance(node.value, str):
|
||||||
|
# Str
|
||||||
|
node.vhd = vhd_string()
|
||||||
node.vhdOri = copy(node.vhd)
|
node.vhdOri = copy(node.vhd)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user