Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/petalinux.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# When updating Petalinux build please file a SH ticket to retain the build
# https://jira.xilinx.com/secure/CreateIssue!default.jspa
PETALINUX="/proj/petalinux/2024.1/petalinux-v2024.1_11011506/tool/petalinux-v2024.1-final"
#PETALINUX="/proj/petalinux/2024.1/petalinux-v2024.1_11011506/tool/petalinux-v2024.1-final"
PETALINUX="/proj/petalinux/2024.1/petalinux-v2024.1_11291502/tool/petalinux-v2024.1-final/"
17 changes: 4 additions & 13 deletions src/runtime_src/xdp/profile/database/static_info/aie_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,13 @@ namespace xdp::aie {
std::string graphName = graph.second.get<std::string>("name");
graphs.push_back(graphName);
}
xrt_core::message::send(severity_level::warning, "XRT", "metadataReader->getValidGraphs(): " );
for(auto name : graphs) {
xrt_core::message::send(severity_level::warning, "XRT", "\t " + name );
}
return graphs;
}

/****************************************************************************
* Read AIE metadata from axlf section
***************************************************************************/
std::unique_ptr<xdp::aie::BaseFiletypeImpl>
readAIEMetadata(const char* data, size_t size, pt::ptree& aie_project)
{
std::stringstream aie_stream;
aie_stream.write(data,size);
pt::read_json(aie_stream, aie_project);

return determineFileType(aie_project);
}

/****************************************************************************
* Read AIE metadata from file
***************************************************************************/
Expand Down
9 changes: 3 additions & 6 deletions src/runtime_src/xdp/profile/database/static_info/aie_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ namespace xdp::aie {
void
throwIfError(bool err, const char* msg);

// A function to read the JSON from an axlf section inside the xclbin and
// return the type of the file
XDP_CORE_EXPORT
std::unique_ptr<BaseFiletypeImpl>
readAIEMetadata(const char* data, size_t size,
boost::property_tree::ptree& aie_project);
XDP_CORE_EXPORT
std::unique_ptr<xdp::aie::BaseFiletypeImpl>
determineFileType(boost::property_tree::ptree& aie_project);

// A function to read the JSON from a file on disk and return the type of
// the file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,26 @@ AIEControlConfigFiletype::AIEControlConfigFiletype(boost::property_tree::ptree&
: BaseFiletypeImpl(aie_project) {}

std::string
AIEControlConfigFiletype::getMessage(std::string secName)
AIEControlConfigFiletype::getMessage(std::string secName) const
{
return "Ignoring AIE metadata section " + secName + " since not found.";
}

driver_config
AIEControlConfigFiletype::getDriverConfig() {
AIEControlConfigFiletype::getDriverConfig() const
{
return xdp::aie::getDriverConfig(aie_meta, "aie_metadata.driver_config");
}

int
AIEControlConfigFiletype::getHardwareGeneration() {
AIEControlConfigFiletype::getHardwareGeneration() const
{
return xdp::aie::getHardwareGeneration(aie_meta, "aie_metadata.driver_config.hw_gen");
}

aiecompiler_options
AIEControlConfigFiletype::getAIECompilerOptions() {
AIEControlConfigFiletype::getAIECompilerOptions() const
{
aiecompiler_options aiecompiler_options;
aiecompiler_options.broadcast_enable_core =
aie_meta.get("aie_metadata.aiecompiler_options.broadcast_enable_core", false);
Expand All @@ -60,17 +63,19 @@ AIEControlConfigFiletype::getAIECompilerOptions() {
}

uint8_t
AIEControlConfigFiletype::getAIETileRowOffset() {
AIEControlConfigFiletype::getAIETileRowOffset() const {
return xdp::aie::getAIETileRowOffset(aie_meta, "aie_metadata.driver_config.aie_tile_row_start");
}

std::vector<std::string>
AIEControlConfigFiletype::getValidGraphs() {
AIEControlConfigFiletype::getValidGraphs() const
{
return xdp::aie::getValidGraphs(aie_meta, "aie_metadata.graphs");
}

std::vector<std::string>
AIEControlConfigFiletype::getValidPorts() {
AIEControlConfigFiletype::getValidPorts() const
{
auto ios = getAllIOs();
if (ios.empty()) {
xrt_core::message::send(severity_level::info, "XRT", "No valid ports found.");
Expand All @@ -90,7 +95,8 @@ AIEControlConfigFiletype::getValidPorts() {
}

std::vector<std::string>
AIEControlConfigFiletype::getValidKernels() {
AIEControlConfigFiletype::getValidKernels() const
{
std::vector<std::string> kernels;

// Grab all kernel to tile mappings
Expand All @@ -99,6 +105,7 @@ AIEControlConfigFiletype::getValidKernels() {
xrt_core::message::send(severity_level::info, "XRT", getMessage("TileMapping.AIEKernelToTileMapping"));
return {};
}
xrt_core::message::send(severity_level::info, "XRT", "metadataReader found key: TileMapping.AIEKernelToTileMapping");

for (auto const &mapping : kernelToTileMapping.get()) {
std::vector<std::string> names;
Expand All @@ -107,16 +114,22 @@ AIEControlConfigFiletype::getValidKernels() {
std::unique_copy(names.begin(), names.end(), std::back_inserter(kernels));
}

xrt_core::message::send(severity_level::warning, "XRT", "metadataReader->getValidKernels(): " );
for(auto name : kernels) {
xrt_core::message::send(severity_level::warning, "XRT", "\t " + name );
}

return kernels;
}

std::unordered_map<std::string, io_config>
AIEControlConfigFiletype::getTraceGMIOs(){
AIEControlConfigFiletype::getTraceGMIOs() const
{
return getChildGMIOs("aie_metadata.TraceGMIOs");
}

std::unordered_map<std::string, io_config>
AIEControlConfigFiletype::getPLIOs()
AIEControlConfigFiletype::getPLIOs() const
{
auto pliosMetadata = aie_meta.get_child_optional("aie_metadata.PLIOs");
if (!pliosMetadata) {
Expand Down Expand Up @@ -146,13 +159,13 @@ AIEControlConfigFiletype::getPLIOs()
}

std::unordered_map<std::string, io_config>
AIEControlConfigFiletype::getGMIOs()
AIEControlConfigFiletype::getGMIOs() const
{
return getChildGMIOs("aie_metadata.GMIOs");
}

std::unordered_map<std::string, io_config>
AIEControlConfigFiletype::getAllIOs()
AIEControlConfigFiletype::getAllIOs() const
{
auto ios = getPLIOs();
auto gmios = getGMIOs();
Expand All @@ -161,7 +174,7 @@ AIEControlConfigFiletype::getAllIOs()
}

std::unordered_map<std::string, io_config>
AIEControlConfigFiletype::getChildGMIOs( const std::string& childStr)
AIEControlConfigFiletype::getChildGMIOs( const std::string& childStr) const
{
auto gmiosMetadata = aie_meta.get_child_optional(childStr);
if (!gmiosMetadata) {
Expand Down Expand Up @@ -205,7 +218,7 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName,
int16_t channelId,
bool useColumn,
uint8_t minCol,
uint8_t maxCol)
uint8_t maxCol) const
{
std::vector<tile_type> tiles;

Expand Down Expand Up @@ -274,7 +287,7 @@ AIEControlConfigFiletype::getInterfaceTiles(const std::string& graphName,

std::vector<tile_type>
AIEControlConfigFiletype::getMemoryTiles(const std::string& graph_name,
const std::string& buffer_name)
const std::string& buffer_name) const
{
if (getHardwareGeneration() == 1)
return {};
Expand Down Expand Up @@ -316,7 +329,7 @@ AIEControlConfigFiletype::getMemoryTiles(const std::string& graph_name,

// Find all AIE tiles in a graph that use the core (kernel_name = all)
std::vector<tile_type>
AIEControlConfigFiletype::getAIETiles(const std::string& graph_name)
AIEControlConfigFiletype::getAIETiles(const std::string& graph_name) const
{
auto graphsMetadata = aie_meta.get_child_optional("aie_metadata.graphs");
if (!graphsMetadata) {
Expand Down Expand Up @@ -374,7 +387,7 @@ AIEControlConfigFiletype::getAIETiles(const std::string& graph_name)

// Find all AIE tiles in a graph that use core and/or memories (kernel_name = all)
std::vector<tile_type>
AIEControlConfigFiletype::getAllAIETiles(const std::string& graph_name)
AIEControlConfigFiletype::getAllAIETiles(const std::string& graph_name) const
{
std::vector<tile_type> tiles;
tiles = getEventTiles(graph_name, module_type::core);
Expand All @@ -385,7 +398,7 @@ AIEControlConfigFiletype::getAllAIETiles(const std::string& graph_name)

std::vector<tile_type>
AIEControlConfigFiletype::getEventTiles(const std::string& graph_name,
module_type type)
module_type type) const
{
if ((type == module_type::shim) || (type == module_type::mem_tile))
return {};
Expand Down Expand Up @@ -431,7 +444,7 @@ AIEControlConfigFiletype::getEventTiles(const std::string& graph_name,
std::vector<tile_type>
AIEControlConfigFiletype::getTiles(const std::string& graph_name,
module_type type,
const std::string& kernel_name)
const std::string& kernel_name) const
{
if (type == module_type::mem_tile)
return getMemoryTiles(graph_name, kernel_name);
Expand Down Expand Up @@ -470,4 +483,13 @@ AIEControlConfigFiletype::getTiles(const std::string& graph_name,
}
return tiles;
}

void
AIEControlConfigFiletype::dumpAieMeta(std::string plugin_name) const
{
std::string filename = "debug_" + plugin_name + "_aie_control.json";
boost::property_tree::json_parser::write_json(filename, aie_meta);
xrt_core::message::send(severity_level::info, "XRT", "AIE_Meta as JSON file saved successfully.");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,38 @@ class AIEControlConfigFiletype : public xdp::aie::BaseFiletypeImpl {
~AIEControlConfigFiletype() = default;

driver_config
getDriverConfig() override;
getDriverConfig() const override;

int getHardwareGeneration() override;
int getHardwareGeneration() const override;

aiecompiler_options
getAIECompilerOptions() override;
getAIECompilerOptions() const override;

uint8_t getAIETileRowOffset() override;
uint8_t getAIETileRowOffset() const override;

std::vector<std::string>
getValidGraphs() override;
getValidGraphs() const override;

std::vector<std::string>
getValidPorts() override;
getValidPorts() const override;

std::vector<std::string>
getValidKernels() override;
getValidKernels() const override;

std::unordered_map<std::string, io_config>
getTraceGMIOs();
getTraceGMIOs() const;

std::unordered_map<std::string, io_config>
getAllIOs();
getAllIOs() const;

std::unordered_map<std::string, io_config>
getPLIOs();
getPLIOs() const;

std::unordered_map<std::string, io_config>
getChildGMIOs(const std::string& childStr);
getChildGMIOs(const std::string& childStr) const;

std::unordered_map<std::string, io_config>
getGMIOs();
getGMIOs() const;

std::vector<tile_type>
getInterfaceTiles(const std::string& graphName,
Expand All @@ -71,29 +71,32 @@ class AIEControlConfigFiletype : public xdp::aie::BaseFiletypeImpl {
int16_t channelId = -1,
bool useColumn = false,
uint8_t minCol = 0,
uint8_t maxCol = 0) override;
uint8_t maxCol = 0) const override;

std::vector<tile_type>
getMemoryTiles(const std::string& graphName,
const std::string& bufferName = "all") override;
const std::string& bufferName = "all") const override;

std::vector<tile_type>
getAIETiles(const std::string& graphName) override;
getAIETiles(const std::string& graphName) const override;

std::vector<tile_type>
getAllAIETiles(const std::string& graphName) override;
getAllAIETiles(const std::string& graphName) const override;

std::vector<tile_type>
getEventTiles(const std::string& graph_name,
module_type type) override;
module_type type) const override;

std::vector<tile_type>
getTiles(const std::string& graph_name,
module_type type,
const std::string& kernel_name = "all") override;
const std::string& kernel_name = "all") const override;

void
dumpAieMeta(std::string plugin_name) const override;

private:
std::string getMessage(std::string secName);
std::string getMessage(std::string secName) const;

};

Expand Down
Loading