Skip to content
Snippets Groups Projects
Commit 701f1ac6 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Wrapper] add get_hls_datatype_str

parent 7c917899
No related branches found
No related tags found
No related merge requests found
......@@ -130,3 +130,13 @@ class DataType(Enum):
"""Return whether this DataType represents integer values only."""
# only FLOAT32 is noninteger for now
return self != DataType.FLOAT32
def get_hls_datatype_str(self):
"""Return the corresponding Vivado HLS datatype name."""
if self.is_integer():
if self.signed():
return "ap_int<%d>" % self.bitwidth()
else:
return "ap_uint<%d>" % self.bitwidth()
else:
return "float"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment