-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packet switch example #2032
base: main
Are you sure you want to change the base?
Packet switch example #2032
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example needs a lit script so that it runs in the automated testing. See the other programming examples for example .lit
scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# Copyright (C) 2024, Advanced Micro Devices, Inc. | ||
# Modified by Alfred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Alfred an AMD copyright lawyer? 🤔
LDFLAGS += -lxrt_coreutil | ||
LDFLAGS += -lboost_program_options -lboost_filesystem | ||
else ifeq ($(DEVICE),npu2) | ||
CXXFLAGS += -c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to repeat the common lines in the if
blocks.
#define IN_DATATYPE int8_t | ||
#define OUT_DATATYPE int8_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for macros
#define IN_DATATYPE int8_t | |
#define OUT_DATATYPE int8_t | |
using IN_DATATYPE = int8_t; | |
using OUT_DATATYPE = int8_t; |
Co-authored-by: Jeff Fifield <[email protected]>
Co-authored-by: Jeff Fifield <[email protected]>
Co-authored-by: Jeff Fifield <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the I requested. The dates on the copyrights are perhaps a bit off, unless the files were copied from 2023 :)
@AndraBisca would it be possible to assist in upgrading their example from MLIR to the IRON Python API? |
Packet Switch Example
A simple design that shows how to use the packet switch feature of the AIE. It uses two cores, one to multiply and one to add two vectors together. The dataflow diagram is shown below:
There are three data paths in the design:
The initial packet ID is generated by the shim tile (runtime_sequence part) and the packet ID is passed to the memory tile. The packet id is kept in the memory tile therefore the total packet length is increased by 4 bytes. Then the packet is read out from the memory tile the AIE automatically uses the first 4 bytes as the packet ID. Therefore, the packet ID initiated by the shim tile is used again to determine where the packet should be sent (CT0 or CT1). Finally, the processed data is sent back to the host for verification.
During the compilation, only one xclbin is generated and is shared by both add and multiply operations. Two instruction files are generated with respect to the add and multiply configurations in the shim tile.