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
|
||||
.idea/
|
||||
/.pytest_cache/
|
||||
|
@ -1251,7 +1251,6 @@ class _ConvertVisitor(ast.NodeVisitor, _ConversionMixin):
|
||||
self.write("to_signed(%s, %s)" % (n, node.vhd.size))
|
||||
else:
|
||||
self.write('signed\'("%s")' % tobin(n, node.vhd.size))
|
||||
|
||||
else:
|
||||
if n < 0:
|
||||
self.write("(")
|
||||
@ -2295,18 +2294,18 @@ class _AnnotateTypesVisitor(ast.NodeVisitor, _ConversionMixin):
|
||||
if sys.version_info >= (3, 8, 0):
|
||||
|
||||
def visit_Constant(self, node):
|
||||
if node.value in (True, False, None):
|
||||
# NameConstant
|
||||
node.vhd = inferVhdlObj(node.value)
|
||||
elif isinstance(node.value, str):
|
||||
# Str
|
||||
node.vhd = vhd_string()
|
||||
elif isinstance(node.value, int):
|
||||
if isinstance(node.value, int):
|
||||
# Num
|
||||
if node.value < 0:
|
||||
node.vhd = vhd_int()
|
||||
else:
|
||||
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)
|
||||
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user