Skip to content
Snippets Groups Projects
Commit 56f0fc12 authored by auphelia's avatar auphelia
Browse files

[HLSCustomOp] Refactoring fpgadataflow custom ops by adding comments and...

[HLSCustomOp] Refactoring fpgadataflow custom ops by adding comments and adding two functions to base class
parent 7387df58
No related branches found
No related tags found
No related merge requests found
......@@ -496,6 +496,14 @@ compilation transformations?
HLSCustomOp class but has to be filled by every node."""
pass
def get_normal_input_shape(self):
"""Returns normal input shape if implemented."""
raise Exception("get_normal_input_shape not implemented for this op")
def get_normal_output_shape(self):
"""Returns folded output shape if implemented."""
raise Exception("get_normal_output_shape not implemented for this op")
def get_folded_input_shape(self):
"""Returns folded input shape (according to synapse folding), if implemented."""
raise Exception("get_folded_input_shape not implemented for this op")
......
......@@ -146,10 +146,6 @@ class StreamingDataWidthConverter_Batch(HLSCustomOp):
folded_oshape = self.get_folded_output_shape()
return np.prod(folded_oshape[:-1])
def get_number_input_values(self):
folded_ishape = self.get_folded_input_shape()
return np.prod(folded_ishape[:-1])
def get_instream_width(self):
in_width = self.get_nodeattr("inWidth")
return in_width
......
......@@ -290,6 +290,7 @@ class StreamingFCLayer_Batch(HLSCustomOp):
return out_width
def get_weightstream_width(self):
"""Returns weight stream width. Used in decoupled mode."""
pe = self.get_nodeattr("PE")
simd = self.get_nodeattr("SIMD")
wp = self.get_weight_datatype().bitwidth()
......@@ -297,6 +298,8 @@ class StreamingFCLayer_Batch(HLSCustomOp):
return w_width
def get_weightstream_width_padded(self):
"""Returns weight stream width padded to a multiple of 8. This is required
by the AXI Stream spec. Used in decoupled mode."""
weight_width = self.get_weightstream_width()
return roundup_to_integer_multiple(weight_width, 8)
......
......@@ -278,10 +278,6 @@ class StreamingFIFO(HLSCustomOp):
folded_oshape = self.get_folded_output_shape()
return np.prod(folded_oshape[:-1])
def get_number_input_values(self):
folded_ishape = self.get_folded_input_shape()
return np.prod(folded_ishape[:-1])
def global_includes(self):
pass
......
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