Skip to content
Snippets Groups Projects
Commit 8315f708 authored by Lucian Petrica's avatar Lucian Petrica
Browse files

Added optional name for AXI-MM interface

parent 246ed946
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,8 @@ from finn.custom_op.fpgadataflow import HLSCustomOp ...@@ -46,6 +46,8 @@ from finn.custom_op.fpgadataflow import HLSCustomOp
# - no additional alignment restrictions beyond anything specified in the AXI spec # - no additional alignment restrictions beyond anything specified in the AXI spec
# Interfaces # Interfaces
# - AXI-MM name specified by intfName unless this is set to "" (empty, the default)
# in which case output AXI-MM are named "out" and input AXI-MM are named "in0"
# - AXI-MM interface width (in bits) is specified by intfWidth # - AXI-MM interface width (in bits) is specified by intfWidth
# - AXI-Stream interface width (in bits) is specified by streamWidth # - AXI-Stream interface width (in bits) is specified by streamWidth
# - If inftWidth and streamWidth are not equal, the DMA core performs # - If inftWidth and streamWidth are not equal, the DMA core performs
...@@ -89,6 +91,8 @@ class IODMA(HLSCustomOp): ...@@ -89,6 +91,8 @@ class IODMA(HLSCustomOp):
"direction": ("s", False, "in"), "direction": ("s", False, "in"),
# shape describing input vecs per execution # shape describing input vecs per execution
"numInputVectors": ("ints", False, [1]), "numInputVectors": ("ints", False, [1]),
# name of axi-mm interface
"intfName": ("s", False, ""),
} }
my_attrs.update(super().get_nodeattr_types()) my_attrs.update(super().get_nodeattr_types())
return my_attrs return my_attrs
...@@ -291,10 +295,16 @@ class IODMA(HLSCustomOp): ...@@ -291,10 +295,16 @@ class IODMA(HLSCustomOp):
"#pragma HLS INTERFACE s_axilite port=return bundle=control" "#pragma HLS INTERFACE s_axilite port=return bundle=control"
) )
direction = self.get_nodeattr("direction") direction = self.get_nodeattr("direction")
intfname = self.get_nodeattr("intfName")
if direction == "in": if direction == "in":
self.code_gen_dict["$PRAGMAS$"].append( if intfname == "":
"#pragma HLS INTERFACE m_axi offset=slave port=in0" self.code_gen_dict["$PRAGMAS$"].append(
) "#pragma HLS INTERFACE m_axi offset=slave port=in0"
)
else:
self.code_gen_dict["$PRAGMAS$"].append(
"#pragma HLS INTERFACE m_axi offset=slave port=%s" % (intfname)
)
self.code_gen_dict["$PRAGMAS$"].append( self.code_gen_dict["$PRAGMAS$"].append(
"#pragma HLS INTERFACE s_axilite port=in0 bundle=control" "#pragma HLS INTERFACE s_axilite port=in0 bundle=control"
) )
...@@ -305,9 +315,14 @@ class IODMA(HLSCustomOp): ...@@ -305,9 +315,14 @@ class IODMA(HLSCustomOp):
self.code_gen_dict["$PRAGMAS$"].append( self.code_gen_dict["$PRAGMAS$"].append(
"#pragma HLS INTERFACE axis port=in0" "#pragma HLS INTERFACE axis port=in0"
) )
self.code_gen_dict["$PRAGMAS$"].append( if intfname == "":
"#pragma HLS INTERFACE m_axi offset=slave port=out" self.code_gen_dict["$PRAGMAS$"].append(
) "#pragma HLS INTERFACE m_axi offset=slave port=out"
)
else:
self.code_gen_dict["$PRAGMAS$"].append(
"#pragma HLS INTERFACE m_axi offset=slave port=%s" % (intfname)
)
self.code_gen_dict["$PRAGMAS$"].append( self.code_gen_dict["$PRAGMAS$"].append(
"#pragma HLS INTERFACE s_axilite port=out bundle=control" "#pragma HLS INTERFACE s_axilite port=out bundle=control"
) )
......
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