diff --git a/tt_metal/hostdevcommon/dprint_common.h b/tt_metal/hostdevcommon/dprint_common.h index aefc4f41906..e27200cce08 100644 --- a/tt_metal/hostdevcommon/dprint_common.h +++ b/tt_metal/hostdevcommon/dprint_common.h @@ -10,8 +10,6 @@ #pragma once -#include "core_config.h" - // DataFormat comes from tt_backend_api_types.hpp for SW, and tensix_types.h for HW... // But wait there's more, SW also includes tensix_types.h so there's both tt::DataFormat and DataFormat there. Use a // different name here so that this header can be included in both. @@ -19,6 +17,7 @@ #include "common/tt_backend_api_types.hpp" typedef tt::DataFormat CommonDataFormat; #else // HW already includes tensix_types.h +#include "core_config.h" typedef DataFormat CommonDataFormat; #endif diff --git a/tt_metal/hw/inc/blackhole/core_config.h b/tt_metal/hw/inc/blackhole/core_config.h index 8ac1c8738a5..9e4ba749e7b 100644 --- a/tt_metal/hw/inc/blackhole/core_config.h +++ b/tt_metal/hw/inc/blackhole/core_config.h @@ -13,16 +13,6 @@ enum ProgrammableCoreType { COUNT = 3, }; -enum class AddressableCoreType : uint8_t { - TENSIX = 0, - ETH = 1, - PCIE = 2, - DRAM = 3, - HARVESTED = 4, - UNKNOWN = 5, - COUNT = 6, -}; - enum class TensixProcessorTypes : uint8_t { DM0 = 0, DM1 = 1, MATH0 = 2, MATH1 = 3, MATH2 = 4, COUNT = 5 }; enum class EthProcessorTypes : uint8_t { DM0 = 0, DM1 = 1, COUNT = 2 }; diff --git a/tt_metal/hw/inc/dev_msgs.h b/tt_metal/hw/inc/dev_msgs.h index 1c176564ece..6e15db3ba99 100644 --- a/tt_metal/hw/inc/dev_msgs.h +++ b/tt_metal/hw/inc/dev_msgs.h @@ -10,7 +10,6 @@ #pragma once -#include "core_config.h" #include "hostdevcommon/profiler_common.h" #include "hostdevcommon/dprint_common.h" @@ -21,6 +20,7 @@ // We don't want to pollute host code with those // Including them here within the guard to make FW/KERNEL happy // The right thing to do, would be "include what you use" in the other header files +#include "core_config.h" #include "noc/noc_parameters.h" #include "dev_mem_map.h" @@ -97,16 +97,20 @@ struct rta_offset_t { volatile uint16_t crta_offset; }; +// Maximums across all archs +constexpr auto NUM_PROGRAMMABLE_CORE_TYPES = 3u; +constexpr auto NUM_PROCESSORS_PER_CORE_TYPE = 5u; + struct kernel_config_msg_t { volatile uint16_t watcher_kernel_ids[DISPATCH_CLASS_MAX]; volatile uint16_t ncrisc_kernel_size16; // size in 16 byte units // Ring buffer of kernel configuration data - volatile uint32_t kernel_config_base[static_cast(ProgrammableCoreType::COUNT)]; - volatile uint16_t sem_offset[static_cast(ProgrammableCoreType::COUNT)]; + volatile uint32_t kernel_config_base[NUM_PROGRAMMABLE_CORE_TYPES]; + volatile uint16_t sem_offset[NUM_PROGRAMMABLE_CORE_TYPES]; volatile uint16_t cb_offset; rta_offset_t rta_offset[DISPATCH_CLASS_MAX]; - volatile uint32_t kernel_text_offset[MaxProcessorsPerCoreType]; + volatile uint32_t kernel_text_offset[NUM_PROCESSORS_PER_CORE_TYPE]; volatile uint16_t host_assigned_id; @@ -277,6 +281,16 @@ struct profiler_msg_t { uint32_t buffer[PROFILER_RISC_COUNT][kernel_profiler::PROFILER_L1_VECTOR_SIZE]; }; +enum class AddressableCoreType : uint8_t { + TENSIX = 0, + ETH = 1, + PCIE = 2, + DRAM = 3, + HARVESTED = 4, + UNKNOWN = 5, + COUNT = 6, +}; + struct addressable_core_t { volatile uint8_t x, y; volatile AddressableCoreType type; diff --git a/tt_metal/hw/inc/grayskull/core_config.h b/tt_metal/hw/inc/grayskull/core_config.h index 46bd0ce61d6..5f73abc2364 100644 --- a/tt_metal/hw/inc/grayskull/core_config.h +++ b/tt_metal/hw/inc/grayskull/core_config.h @@ -11,16 +11,6 @@ enum ProgrammableCoreType { COUNT = 3, // for now, easier to keep structures shared across arches' the same size }; -enum class AddressableCoreType : uint8_t { - TENSIX = 0, - ETH = 1, // TODO: Make this accessible through the HAL and remove non-GS entries - PCIE = 2, - DRAM = 3, - HARVESTED = 4, - UNKNOWN = 5, - COUNT = 6, -}; - enum class TensixProcessorTypes : uint8_t { DM0 = 0, DM1 = 1, MATH0 = 2, MATH1 = 3, MATH2 = 4, COUNT = 5 }; constexpr uint8_t MaxProcessorsPerCoreType = 5; diff --git a/tt_metal/hw/inc/wormhole/core_config.h b/tt_metal/hw/inc/wormhole/core_config.h index 34e6ccbd487..491ab6bb54a 100644 --- a/tt_metal/hw/inc/wormhole/core_config.h +++ b/tt_metal/hw/inc/wormhole/core_config.h @@ -13,16 +13,6 @@ enum ProgrammableCoreType { COUNT = 3, }; -enum class AddressableCoreType : uint8_t { - TENSIX = 0, - ETH = 1, - PCIE = 2, - DRAM = 3, - HARVESTED = 4, - UNKNOWN = 5, - COUNT = 6, -}; - enum class TensixProcessorTypes : uint8_t { DM0 = 0, DM1 = 1, MATH0 = 2, MATH1 = 3, MATH2 = 4, COUNT = 5 }; enum class EthProcessorTypes : uint8_t { DM0 = 0, COUNT = 1 }; diff --git a/tt_metal/impl/program/program.cpp b/tt_metal/impl/program/program.cpp index a8bd7294a74..32d8426d88e 100644 --- a/tt_metal/impl/program/program.cpp +++ b/tt_metal/impl/program/program.cpp @@ -408,7 +408,7 @@ KernelGroup::KernelGroup( } } - for (uint32_t index = 0; index < MaxProcessorsPerCoreType; index ++) { + for (uint32_t index = 0; index < NUM_PROCESSORS_PER_CORE_TYPE; index ++) { this->kernel_bin_sizes[index] = 0; this->kernel_text_offsets[index] = 0; this->launch_msg.kernel_config.kernel_text_offset[index] = 0; diff --git a/tt_metal/impl/program/program.hpp b/tt_metal/impl/program/program.hpp index a38cca2a3dc..b3d4b1ae306 100644 --- a/tt_metal/impl/program/program.hpp +++ b/tt_metal/impl/program/program.hpp @@ -54,8 +54,8 @@ struct KernelGroup { kernel_id_array_t kernel_ids; uint32_t rta_sizes[DISPATCH_CLASS_MAX]; uint32_t total_rta_size; - uint32_t kernel_text_offsets[MaxProcessorsPerCoreType]; - uint32_t kernel_bin_sizes[MaxProcessorsPerCoreType]; + uint32_t kernel_text_offsets[NUM_PROCESSORS_PER_CORE_TYPE]; + uint32_t kernel_bin_sizes[NUM_PROCESSORS_PER_CORE_TYPE]; launch_msg_t launch_msg; go_msg_t go_msg; diff --git a/tt_metal/llrt/blackhole/bh_hal_active_eth.cpp b/tt_metal/llrt/blackhole/bh_hal_active_eth.cpp index 986273769d1..021f58f1075 100644 --- a/tt_metal/llrt/blackhole/bh_hal_active_eth.cpp +++ b/tt_metal/llrt/blackhole/bh_hal_active_eth.cpp @@ -9,6 +9,7 @@ #include #include +#include "core_config.h" #include "dev_msgs.h" #include "eth_l1_address_map.h" diff --git a/tt_metal/llrt/blackhole/bh_hal_idle_eth.cpp b/tt_metal/llrt/blackhole/bh_hal_idle_eth.cpp index 011c934d61c..f7f91ed7f44 100644 --- a/tt_metal/llrt/blackhole/bh_hal_idle_eth.cpp +++ b/tt_metal/llrt/blackhole/bh_hal_idle_eth.cpp @@ -9,6 +9,7 @@ #include #include +#include "core_config.h" #include "dev_mem_map.h" #include "dev_msgs.h" #include "noc/noc_parameters.h" diff --git a/tt_metal/llrt/blackhole/bh_hal_tensix.cpp b/tt_metal/llrt/blackhole/bh_hal_tensix.cpp index 94ef158bc15..d0414dcfbc0 100644 --- a/tt_metal/llrt/blackhole/bh_hal_tensix.cpp +++ b/tt_metal/llrt/blackhole/bh_hal_tensix.cpp @@ -7,6 +7,7 @@ #include #include +#include "core_config.h" #include "dev_mem_map.h" #include "dev_msgs.h" #include "noc/noc_parameters.h" diff --git a/tt_metal/llrt/grayskull/gs_hal.cpp b/tt_metal/llrt/grayskull/gs_hal.cpp index 0fe1d6b417e..8bde1590ab2 100644 --- a/tt_metal/llrt/grayskull/gs_hal.cpp +++ b/tt_metal/llrt/grayskull/gs_hal.cpp @@ -8,7 +8,7 @@ #include #include -#include "core_config.h" // ProgrammableCoreType +#include "core_config.h" #include "dev_mem_map.h" #include "dev_msgs.h" #include "noc/noc_parameters.h" diff --git a/tt_metal/llrt/wormhole/wh_hal_active_eth.cpp b/tt_metal/llrt/wormhole/wh_hal_active_eth.cpp index 82952672f25..0d1241020c5 100644 --- a/tt_metal/llrt/wormhole/wh_hal_active_eth.cpp +++ b/tt_metal/llrt/wormhole/wh_hal_active_eth.cpp @@ -6,6 +6,7 @@ #include +#include "core_config.h" #include "dev_msgs.h" #include "eth_l1_address_map.h" diff --git a/tt_metal/llrt/wormhole/wh_hal_idle_eth.cpp b/tt_metal/llrt/wormhole/wh_hal_idle_eth.cpp index e07b004b076..a2ce00faf43 100644 --- a/tt_metal/llrt/wormhole/wh_hal_idle_eth.cpp +++ b/tt_metal/llrt/wormhole/wh_hal_idle_eth.cpp @@ -9,6 +9,7 @@ #include #include +#include "core_config.h" #include "dev_mem_map.h" #include "dev_msgs.h" #include "noc/noc_parameters.h" diff --git a/tt_metal/llrt/wormhole/wh_hal_tensix.cpp b/tt_metal/llrt/wormhole/wh_hal_tensix.cpp index e40c90d8739..7de8185bacb 100644 --- a/tt_metal/llrt/wormhole/wh_hal_tensix.cpp +++ b/tt_metal/llrt/wormhole/wh_hal_tensix.cpp @@ -8,6 +8,7 @@ #include #include +#include "core_config.h" #include "dev_mem_map.h" #include "dev_msgs.h" #include "noc/noc_parameters.h"