Skip to content

Conversation

fifield
Copy link
Collaborator

@fifield fifield commented Jun 18, 2025

This PR implements a control packet lowering of aiex.configure:

  • Modify control packet lowering (aie-opt --convert-aie-to-control-packets) to insert configuration control packet ops using aiex.configure as insertion point.
  • Modify control packet control sequence generation (aie-opt --aie-ctrl-packet-to-dma) to be "in-place", instead of creating new control sequence.

The effect of the above is to combine the control packet configuration and user control runtime sequences into one transaction binary. When used with aiecc --aie-generate-ctrlpkt --aie-generate-elf, the output elf will contain the combined transaction binary as well as the control packet payload.

The control packet reconfiguration tests are updated to use the combined runtime sequences (instruction binaries).

Test ctrl_packet_reconfig_elf is updated to use the combined elf for configuration and control. The xclbin contains only the routing necessary to enable configuration with packets and all control packet configuration details are hidden from the host program:

  // Skeleton xclbin (pdi) containing only the control packet network
  auto xclbin = xrt::xclbin(std::string("aie1.xclbin"));
  ...
  // elf containing the design's configuration (as packet data) and control (as txn binary)
  xrt::elf elf0("aie2.elf");
  xrt::module mod0{elf0};
  ...
  unsigned int opcode = 3;
  auto kernel0 = xrt::ext::kernel(context, mod0, kernelName);
  ...
  // Arguments 1, 2 (both zero) are for the xrt managed runtime sequence and control packet payload.
  // The control packet payload buffer, managed by the runtime, is the arg after the last user argument. 
  // These are loaded from the elf, managed by xrt, and do not appear in the host code.
  kernel0(opcode, 0, 0, bo_in, bo_out).wait2();

fixes

fixup tests

Move control packet data to end of runtime_sequence argument list
@fifield
Copy link
Collaborator Author

fifield commented Sep 5, 2025

rebased onto / depends on #2532

just this pr

@fifield fifield changed the title [experiment] sketch of npu.configure op with ctrl pkt config [experiment] sketch of aie.configure op with ctrl pkt config Sep 5, 2025
@fifield fifield changed the title [experiment] sketch of aie.configure op with ctrl pkt config control packet lowering for aiex.configure Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants