@@ -207,7 +207,7 @@ def emit_design_kernel_json(
207207}
208208
209209
210- def emit_partition (mlir_module_str , pdi_name , kernel_id = "0x901" ):
210+ def emit_partition (mlir_module_str , kernel_id = "0x901" ):
211211 with Context (), Location .unknown ():
212212 module = Module .parse (mlir_module_str )
213213 device = find_ops (
@@ -242,7 +242,7 @@ def emit_partition(mlir_module_str, pdi_name, kernel_id="0x901"):
242242 "PDIs" : [
243243 {
244244 "uuid" : str (pdi_uuid ),
245- "file_name" : pdi_name ,
245+ "file_name" : "./design.pdi" ,
246246 "cdo_groups" : [
247247 {
248248 "name" : "DPU" ,
@@ -600,6 +600,10 @@ async def process_txn(self, module_str):
600600 self .prepend_tmp ("txn.mlir" ),
601601 self .opts .verbose ,
602602 )
603+ tmp = self .prepend_tmp ("txn.mlir" )
604+ if opts .verbose :
605+ print (f"copy { tmp } to { opts .txn_name } " )
606+ shutil .copy (tmp , opts .txn_name )
603607
604608 async def process_ctrlpkt (self , module_str ):
605609 with Context (), Location .unknown ():
@@ -616,7 +620,7 @@ async def process_pdi_gen(self):
616620
617621 await write_file_async (
618622 emit_design_bif (self .tmpdirname ),
619- self .prepend_tmp (opts . pdi_name + " .bif" ),
623+ self .prepend_tmp ("design .bif" ),
620624 )
621625
622626 await self .do_call (
@@ -626,12 +630,17 @@ async def process_pdi_gen(self):
626630 "-arch" ,
627631 "versal" ,
628632 "-image" ,
629- self .prepend_tmp (opts . pdi_name + " .bif" ),
633+ self .prepend_tmp ("design .bif" ),
630634 "-o" ,
631- self .prepend_tmp (opts . pdi_name ),
635+ self .prepend_tmp ('design.pdi' ),
632636 "-w" ,
633637 ],
634638 )
639+ if opts .pdi :
640+ tmp = self .prepend_tmp ("design.pdi" )
641+ if opts .verbose :
642+ print (f"copy { tmp } to { opts .pdi_name } " )
643+ shutil .copy (tmp , opts .pdi_name )
635644
636645 # generate an xclbin. The inputs are self.mlir_module_str and the cdo
637646 # binaries from the process_cdo step.
@@ -658,7 +667,7 @@ async def process_xclbin_gen(self):
658667 processes .append (
659668 write_file_async (
660669 json .dumps (
661- emit_partition (self .mlir_module_str , opts .pdi_name , opts . kernel_id ),
670+ emit_partition (self .mlir_module_str , opts .kernel_id ),
662671 indent = 2 ,
663672 ),
664673 self .prepend_tmp ("aie_partition.json" ),
0 commit comments