diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c5eb4413b0..9f42a8512ae1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,6 @@ option(WITH_PYTHON_BINDINGS "Enables build of python bindings" ON) message(STATUS "Build Python bindings: ${WITH_PYTHON_BINDINGS}") option(ENABLE_CODE_TIMERS "Enable code timers" OFF) -option(TT_METAL_VERSIM_DISABLED "Disable TT_METAL_VERSIM" ON) option(ENABLE_TRACY "Enable Tracy Profiling" OFF) @@ -154,10 +153,6 @@ add_library(compiler_flags INTERFACE) target_link_libraries(compiler_flags INTERFACE compiler_warnings stdlib) target_compile_options(compiler_flags INTERFACE -mavx2 -fPIC -DFMT_HEADER_ONLY -fvisibility-inlines-hidden -fno-lto) -if(TT_METAL_VERSIM_DISABLED) - target_compile_options(compiler_flags INTERFACE -DTT_METAL_VERSIM_DISABLED) -endif() - if(ENABLE_CODE_TIMERS) target_compile_options(compiler_flags INTERFACE -DTT_ENABLE_CODE_TIMERS) endif() diff --git a/tests/tt_metal/tt_metal/perf_microbenchmark/common/util.hpp b/tests/tt_metal/tt_metal/perf_microbenchmark/common/util.hpp index c625ad841c36..8bf5452d5ce2 100644 --- a/tests/tt_metal/tt_metal/perf_microbenchmark/common/util.hpp +++ b/tests/tt_metal/tt_metal/perf_microbenchmark/common/util.hpp @@ -66,11 +66,7 @@ inline uint64_t get_t0_to_any_riscfw_end_cycle(tt::tt_metal::Device *device, con } inline int get_tt_npu_clock(tt::tt_metal::Device *device) { - int ai_clk = 0; -#ifdef TT_METAL_VERSIM_DISABLED - ai_clk = tt::Cluster::instance().get_device_aiclk(device->id()); -#endif - return ai_clk; + return tt::Cluster::instance().get_device_aiclk(device->id()); } template diff --git a/tt_metal/common/base.hpp b/tt_metal/common/base.hpp index 27415e01fdf2..4bfff3bae9ec 100644 --- a/tt_metal/common/base.hpp +++ b/tt_metal/common/base.hpp @@ -43,10 +43,9 @@ namespace tt enum class TargetDevice : uint8_t { Model = 0, - Versim = 1, - Silicon = 2, - Golden = 3, - VCS = 4, + Silicon = 1, + Golden = 2, + VCS = 3, Invalid = 0xFF, }; diff --git a/tt_metal/common/core_descriptor.hpp b/tt_metal/common/core_descriptor.hpp index 2150aa4db35b..4af647c135be 100644 --- a/tt_metal/common/core_descriptor.hpp +++ b/tt_metal/common/core_descriptor.hpp @@ -35,22 +35,9 @@ inline std::string get_core_descriptor_file(const tt::ARCH &arch) { wh_arch = "tt_metal/core_descriptors/"; wh_arch += getenv("WH_ARCH_YAML"); } - bool targeting_versim = false; + bool targeting_vcs = std::getenv("TT_METAL_SIMULATOR_EN") != nullptr; -#ifndef TT_METAL_VERSIM_DISABLED - targeting_versim = true; -#endif - if (targeting_versim) { - switch (arch) { - case tt::ARCH::Invalid: throw std::runtime_error("Invalid arch not supported"); // will be overwritten in tt_global_state constructor - case tt::ARCH::JAWBRIDGE: throw std::runtime_error("JAWBRIDGE arch not supported"); - case tt::ARCH::GRAYSKULL: return tt_metal_home + "tt_metal/core_descriptors/grayskull_versim_1x1_arch.yaml"; - case tt::ARCH::WORMHOLE: throw std::runtime_error("WORMHOLE arch not supported"); - case tt::ARCH::WORMHOLE_B0: return tt_metal_home + "tt_metal/core_descriptors/wormhole_b0_versim_1x1_arch.yaml"; - case tt::ARCH::BLACKHOLE: return tt_metal_home + "tt_metal/core_descriptors/blackhole_versim_1x1_arch.yaml"; - default: throw std::runtime_error("Unsupported device arch"); - }; - } else if (targeting_vcs) { + if (targeting_vcs) { switch (arch) { case tt::ARCH::Invalid: throw std::runtime_error("Invalid arch not supported"); // will be overwritten in tt_global_state constructor case tt::ARCH::JAWBRIDGE: throw std::runtime_error("JAWBRIDGE arch not supported"); diff --git a/tt_metal/common/test_common.hpp b/tt_metal/common/test_common.hpp index 51568bde51b2..ec798314153c 100644 --- a/tt_metal/common/test_common.hpp +++ b/tt_metal/common/test_common.hpp @@ -23,7 +23,6 @@ inline std::string get_soc_description_file(const tt::ARCH &arch, tt::TargetDevice target_device, string output_dir = "") { // Ability to skip this runtime opt, since trimmed SOC desc limits which DRAM channels are available. - bool use_full_soc_desc = getenv("TT_METAL_VERSIM_FORCE_FULL_SOC_DESC"); string tt_metal_home; if (getenv("TT_METAL_HOME")) { tt_metal_home = getenv("TT_METAL_HOME"); @@ -33,17 +32,7 @@ inline std::string get_soc_description_file(const tt::ARCH &arch, tt::TargetDevi if (tt_metal_home.back() != '/') { tt_metal_home += "/"; } - if (target_device == tt::TargetDevice::Versim && !use_full_soc_desc) { - switch (arch) { - case tt::ARCH::Invalid: throw std::runtime_error("Invalid arch not supported"); // will be overwritten in tt_global_state constructor - case tt::ARCH::JAWBRIDGE: throw std::runtime_error("JAWBRIDGE arch not supported"); - case tt::ARCH::GRAYSKULL: return tt_metal_home + "tt_metal/soc_descriptors/grayskull_versim_1x1_arch.yaml"; - case tt::ARCH::WORMHOLE: throw std::runtime_error("WORMHOLE arch not supported"); - case tt::ARCH::WORMHOLE_B0: return tt_metal_home + "tt_metal/soc_descriptors/wormhole_b0_versim_1x1_arch.yaml"; - case tt::ARCH::BLACKHOLE: return tt_metal_home + "tt_metal/soc_descriptors/blackhole_versim_1x1_arch.yaml"; - default: throw std::runtime_error("Unsupported device arch"); - }; - } else if (target_device == tt::TargetDevice::VCS){ + if (target_device == tt::TargetDevice::VCS){ switch (arch) { case tt::ARCH::Invalid: throw std::runtime_error("Invalid arch not supported"); case tt::ARCH::JAWBRIDGE: throw std::runtime_error("JAWBRIDGE arch not supported"); diff --git a/tt_metal/hw/inc/blackhole/dev_mem_map_versim.h b/tt_metal/hw/inc/blackhole/dev_mem_map_versim.h deleted file mode 100644 index a3243bad9225..000000000000 --- a/tt_metal/hw/inc/blackhole/dev_mem_map_versim.h +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-FileCopyrightText: © 2023 Tenstorrent Inc. -// -// SPDX-License-Identifier: Apache-2.0 - -#pragma once - -#include "dev_mem_map.h" -// This is to support some deprecated mappings for versim to get build up -#ifndef TT_METAL_VERSIM_DISABLED -#define TEST_MAILBOX_ADDRESS MEM_MAILBOX_BASE -#endif diff --git a/tt_metal/hw/inc/grayskull/dev_mem_map_versim.h b/tt_metal/hw/inc/grayskull/dev_mem_map_versim.h deleted file mode 100644 index a3243bad9225..000000000000 --- a/tt_metal/hw/inc/grayskull/dev_mem_map_versim.h +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-FileCopyrightText: © 2023 Tenstorrent Inc. -// -// SPDX-License-Identifier: Apache-2.0 - -#pragma once - -#include "dev_mem_map.h" -// This is to support some deprecated mappings for versim to get build up -#ifndef TT_METAL_VERSIM_DISABLED -#define TEST_MAILBOX_ADDRESS MEM_MAILBOX_BASE -#endif diff --git a/tt_metal/hw/inc/grayskull/tensix.h b/tt_metal/hw/inc/grayskull/tensix.h index c7ea1c3f6889..4774048fe8f7 100644 --- a/tt_metal/hw/inc/grayskull/tensix.h +++ b/tt_metal/hw/inc/grayskull/tensix.h @@ -11,7 +11,6 @@ #include #include "cfg_defines.h" #include "dev_mem_map.h" -#include "dev_mem_map_versim.h" // Convenience and type defines typedef std::uint32_t uint; diff --git a/tt_metal/hw/inc/wormhole/dev_mem_map_versim.h b/tt_metal/hw/inc/wormhole/dev_mem_map_versim.h deleted file mode 100644 index a3243bad9225..000000000000 --- a/tt_metal/hw/inc/wormhole/dev_mem_map_versim.h +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-FileCopyrightText: © 2023 Tenstorrent Inc. -// -// SPDX-License-Identifier: Apache-2.0 - -#pragma once - -#include "dev_mem_map.h" -// This is to support some deprecated mappings for versim to get build up -#ifndef TT_METAL_VERSIM_DISABLED -#define TEST_MAILBOX_ADDRESS MEM_MAILBOX_BASE -#endif diff --git a/tt_metal/hw/inc/wormhole/tensix.h b/tt_metal/hw/inc/wormhole/tensix.h index 92da2b85b9b1..83d781e263ca 100644 --- a/tt_metal/hw/inc/wormhole/tensix.h +++ b/tt_metal/hw/inc/wormhole/tensix.h @@ -11,7 +11,6 @@ #include #include "cfg_defines.h" #include "dev_mem_map.h" -#include "dev_mem_map_versim.h" // Convenience and type defines typedef std::uint32_t uint; diff --git a/tt_metal/impl/device/device.cpp b/tt_metal/impl/device/device.cpp index 5785ec4cfdb8..e0635d2b60b9 100644 --- a/tt_metal/impl/device/device.cpp +++ b/tt_metal/impl/device/device.cpp @@ -147,10 +147,8 @@ void Device::initialize_cluster() { if (llrt::OptionsG.get_clear_l1()) { this->clear_l1_state(); } -#ifdef TT_METAL_VERSIM_DISABLED int ai_clk = tt::Cluster::instance().get_device_aiclk(this->id_); log_info(tt::LogMetal, "AI CLK for device {} is: {} MHz", this->id_, ai_clk); -#endif } void Device::initialize_allocator(size_t l1_small_size, size_t trace_region_size, const std::vector &l1_bank_remap) { diff --git a/tt_metal/llrt/tt_cluster.cpp b/tt_metal/llrt/tt_cluster.cpp index 79b937360f25..cdb7475a95d5 100644 --- a/tt_metal/llrt/tt_cluster.cpp +++ b/tt_metal/llrt/tt_cluster.cpp @@ -49,7 +49,6 @@ Cluster::Cluster() { } void Cluster::detect_arch_and_target() { -#ifdef TT_METAL_VERSIM_DISABLED if(std::getenv("TT_METAL_SIMULATOR_EN")) { this->target_type_ = TargetDevice::VCS; auto arch_env = getenv("ARCH_NAME"); @@ -70,13 +69,6 @@ void Cluster::detect_arch_and_target() { get_arch_str(detected_arch)); } } -#else - this->target_type_ = TargetDevice::Versim; - auto arch_env = getenv("ARCH_NAME"); - TT_FATAL(arch_env, "arch_env needs to be set for versim (ARCH_NAME=)"); - this->arch_ = tt::get_arch_from_string(arch_env); -#endif - #ifdef ARCH_GRAYSKULL TT_FATAL( this->arch_ == tt::ARCH::GRAYSKULL, @@ -96,7 +88,7 @@ void Cluster::detect_arch_and_target() { get_string(this->arch_)); #endif - TT_FATAL(this->target_type_ == TargetDevice::Versim or this->target_type_ == TargetDevice::Silicon or this->target_type_ == TargetDevice::VCS); + TT_FATAL(this->target_type_ == TargetDevice::Silicon or this->target_type_ == TargetDevice::VCS); } std::filesystem::path get_cluster_desc_yaml() { @@ -171,9 +163,9 @@ void Cluster::generate_cluster_descriptor() { } // Use cluster descriptor to map MMIO device id to all devices on the same card (including the MMIO device) - if (this->target_type_ == TargetDevice::Versim || this->target_type_ == TargetDevice::VCS) { - std::set dummy_versim_card = {0}; - this->devices_grouped_by_assoc_mmio_device_[0] = dummy_versim_card; + if (this->target_type_ == TargetDevice::VCS) { + std::set dummy_card = {0}; + this->devices_grouped_by_assoc_mmio_device_[0] = dummy_card; this->device_to_mmio_device_[0] = 0; } else { for (chip_id_t device_id : this->cluster_desc_->get_all_chips()) { @@ -212,10 +204,6 @@ void Cluster::initialize_device_drivers() { this->open_driver(mmio_device_id, controlled_devices); tt_device_params default_params; - if (getenv("TT_METAL_VERSIM_DUMP_CORES")) { - std::string dump_cores_string = getenv("TT_METAL_VERSIM_DUMP_CORES"); - default_params.vcd_dump_cores = tt::utils::strsplit(dump_cores_string, ','); - } this->start_driver(mmio_device_id, default_params); } } @@ -288,10 +276,7 @@ void Cluster::open_driver( // Adding this check is a workaround for current UMD bug that only uses this getter to populate private metadata // that is later expected to be populated by unrelated APIs TT_FATAL(device_driver->get_target_mmio_device_ids().size() == 1); - } else if (this->target_type_ == TargetDevice::Versim) { - device_driver = std::make_unique(sdesc_path, this->cluster_desc_path_); - } - else if (this->target_type_ == TargetDevice::VCS) { + } else if (this->target_type_ == TargetDevice::VCS) { device_driver = std::make_unique(sdesc_path); } device_driver->set_device_dram_address_params(dram_address_params); @@ -347,7 +332,7 @@ const metal_SocDescriptor &Cluster::get_soc_desc(chip_id_t chip) const { } uint32_t Cluster::get_harvested_rows(chip_id_t chip) const { - if (this->target_type_ == TargetDevice::Versim || this->target_type_ == TargetDevice::VCS) { + if (this->target_type_ == TargetDevice::VCS) { return 0; } else { return this->get_driver(chip).harvested_rows_per_target.at(chip); diff --git a/tt_metal/tt_metal.cpp b/tt_metal/tt_metal.cpp index b4bbec6146b3..632af0aee2b3 100644 --- a/tt_metal/tt_metal.cpp +++ b/tt_metal/tt_metal.cpp @@ -700,19 +700,11 @@ void EnableAllocs(Device *device) { tt::tt_metal::allocator::enable_allocs(*(dev } // namespace detail size_t GetNumAvailableDevices() { -#ifdef TT_METAL_VERSIM_DISABLED return tt::Cluster::instance().number_of_user_devices(); -#else - return 1; -#endif } size_t GetNumPCIeDevices() { -#ifdef TT_METAL_VERSIM_DISABLED return tt::Cluster::instance().number_of_pci_devices(); -#else - return 1; -#endif } chip_id_t GetPCIeDeviceID(chip_id_t device_id){