Skip to content
Snippets Groups Projects
Unverified Commit 2d2d03cb authored by Yaman Umuroglu's avatar Yaman Umuroglu Committed by GitHub
Browse files

Merge pull request #307 from surangamh/link-optional

Make linking optional
parents e68d7a3a 657ec60d
No related branches found
No related tags found
No related merge requests found
...@@ -116,7 +116,7 @@ class CreateVitisXO(Transformation): ...@@ -116,7 +116,7 @@ class CreateVitisXO(Transformation):
) )
arg_id += 1 arg_id += 1
args_string.append( args_string.append(
"{numReps:0:%s:%s:0x4:0x1C:uint:0}" "{numReps:0:%s:%s:0x4:0x1C:uint:0}"
% (str(arg_id), axilite_intf_name) % (str(arg_id), axilite_intf_name)
) )
arg_id += 1 arg_id += 1
...@@ -340,7 +340,8 @@ class VitisBuild(Transformation): ...@@ -340,7 +340,8 @@ class VitisBuild(Transformation):
floorplan_file: path to a JSON containing a dictionary with SLR assignments floorplan_file: path to a JSON containing a dictionary with SLR assignments
for each node in the ONNX graph. Must be parse-able by for each node in the ONNX graph. Must be parse-able by
the ApplyConfig transform. the ApplyConfig transform.
enable_link: enable linking kernels (.xo files), otherwise just synthesize
them independently.
""" """
def __init__( def __init__(
...@@ -351,6 +352,7 @@ class VitisBuild(Transformation): ...@@ -351,6 +352,7 @@ class VitisBuild(Transformation):
strategy=VitisOptStrategy.PERFORMANCE, strategy=VitisOptStrategy.PERFORMANCE,
enable_debug=False, enable_debug=False,
floorplan_file=None, floorplan_file=None,
enable_link=True,
): ):
super().__init__() super().__init__()
self.fpga_part = fpga_part self.fpga_part = fpga_part
...@@ -359,16 +361,14 @@ class VitisBuild(Transformation): ...@@ -359,16 +361,14 @@ class VitisBuild(Transformation):
self.strategy = strategy self.strategy = strategy
self.enable_debug = enable_debug self.enable_debug = enable_debug
self.floorplan_file = floorplan_file self.floorplan_file = floorplan_file
self.enable_link = enable_link
def apply(self, model): def apply(self, model):
_check_vitis_envvars() _check_vitis_envvars()
# first infer layouts # first infer layouts
model = model.transform(InferDataLayouts()) model = model.transform(InferDataLayouts())
# prepare at global level, then break up into kernels # prepare at global level, then break up into kernels
prep_transforms = [ prep_transforms = [InsertIODMA(512), InsertDWC()]
InsertIODMA(512),
InsertDWC(),
]
for trn in prep_transforms: for trn in prep_transforms:
model = model.transform(trn) model = model.transform(trn)
model = model.transform(GiveUniqueNodeNames()) model = model.transform(GiveUniqueNodeNames())
...@@ -405,17 +405,18 @@ class VitisBuild(Transformation): ...@@ -405,17 +405,18 @@ class VitisBuild(Transformation):
kernel_model.set_metadata_prop("platform", "alveo") kernel_model.set_metadata_prop("platform", "alveo")
kernel_model.save(dataflow_model_filename) kernel_model.save(dataflow_model_filename)
# Assemble design from kernels # Assemble design from kernels
model = model.transform( if self.enable_link:
VitisLink( model = model.transform(
self.platform, VitisLink(
round(1000 / self.period_ns), self.platform,
strategy=self.strategy, round(1000 / self.period_ns),
enable_debug=self.enable_debug, strategy=self.strategy,
enable_debug=self.enable_debug,
)
) )
)
# set platform attribute for correct remote execution # set platform attribute for correct remote execution
model.set_metadata_prop("platform", "alveo") model.set_metadata_prop("platform", "alveo")
#create driver # create driver
model = model.transform(MakePYNQDriver(platform="alveo")) model = model.transform(MakePYNQDriver(platform="alveo"))
return (model, False) return (model, False)
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