diff --git a/device/api/umd/device/cluster.h b/device/api/umd/device/cluster.h index a363d018..7ce57882 100644 --- a/device/api/umd/device/cluster.h +++ b/device/api/umd/device/cluster.h @@ -160,11 +160,15 @@ class tt_device { * * @param core Chip and core being targeted. */ - virtual void assert_risc_reset_at_core(tt_cxy_pair core) { + virtual void assert_risc_reset_at_core( + tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET) { throw std::runtime_error("---- tt_device::assert_risc_reset_at_core is not implemented\n"); } - virtual void assert_risc_reset_at_core(const chip_id_t chip, const tt::umd::CoreCoord core) { + virtual void assert_risc_reset_at_core( + const chip_id_t chip, + const tt::umd::CoreCoord core, + const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET) { throw std::runtime_error("---- tt_device::assert_risc_reset_at_core is not implemented\n"); } @@ -636,7 +640,8 @@ class Cluster : public tt_device { chip_id_t mmio_chip, const std::unordered_set& active_eth_cores_per_chip); virtual void deassert_risc_reset_at_core( tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_DEASSERT_SOFT_RESET); - virtual void assert_risc_reset_at_core(tt_cxy_pair core); + virtual void assert_risc_reset_at_core( + tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET); virtual void write_to_device( const void* mem_ptr, uint32_t size_in_bytes, tt_cxy_pair core, uint64_t addr, const std::string& tlb_to_use); // TODO: Add CoreCoord API for this function. @@ -695,7 +700,10 @@ class Cluster : public tt_device { const chip_id_t chip, const tt::umd::CoreCoord core, const TensixSoftResetOptions& soft_resets = TENSIX_DEASSERT_SOFT_RESET); - virtual void assert_risc_reset_at_core(const chip_id_t chip, const tt::umd::CoreCoord core); + virtual void assert_risc_reset_at_core( + const chip_id_t chip, + const tt::umd::CoreCoord core, + const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET); virtual void write_to_device( const void* mem_ptr, uint32_t size_in_bytes, diff --git a/device/api/umd/device/tt_simulation_device.h b/device/api/umd/device/tt_simulation_device.h index 3e858ed8..03cb4898 100644 --- a/device/api/umd/device/tt_simulation_device.h +++ b/device/api/umd/device/tt_simulation_device.h @@ -26,7 +26,8 @@ class tt_SimulationDevice : public tt_device { virtual void deassert_risc_reset(); virtual void deassert_risc_reset_at_core( tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_DEASSERT_SOFT_RESET); - virtual void assert_risc_reset_at_core(tt_cxy_pair core); + virtual void assert_risc_reset_at_core( + tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET); virtual void close_device(); // Runtime Functions diff --git a/device/cluster.cpp b/device/cluster.cpp index c7c7f629..35487ae4 100644 --- a/device/cluster.cpp +++ b/device/cluster.cpp @@ -966,7 +966,7 @@ void Cluster::deassert_risc_reset_at_core( deassert_risc_reset_at_core({(size_t)chip, virtual_coord}, soft_resets); } -void Cluster::assert_risc_reset_at_core(tt_cxy_pair core) { +void Cluster::assert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftResetOptions& soft_resets) { // Get Target Device to query soc descriptor and determine location in cluster std::uint32_t target_device = core.chip; log_assert( @@ -980,15 +980,16 @@ void Cluster::assert_risc_reset_at_core(tt_cxy_pair core) { "Cannot assert reset on a non-tensix or harvested core"); bool target_is_mmio_capable = cluster_desc->is_chip_mmio_capable(target_device); if (target_is_mmio_capable) { - send_tensix_risc_reset_to_core(core, TENSIX_ASSERT_SOFT_RESET); + send_tensix_risc_reset_to_core(core, soft_resets); } else { - send_remote_tensix_risc_reset_to_core(core, TENSIX_ASSERT_SOFT_RESET); + send_remote_tensix_risc_reset_to_core(core, soft_resets); } } -void Cluster::assert_risc_reset_at_core(const chip_id_t chip, const CoreCoord core) { +void Cluster::assert_risc_reset_at_core( + const chip_id_t chip, const CoreCoord core, const TensixSoftResetOptions& soft_resets) { const CoreCoord virtual_coord = translate_chip_coord(chip, core, CoordSystem::VIRTUAL); - assert_risc_reset_at_core({(size_t)chip, virtual_coord}); + assert_risc_reset_at_core({(size_t)chip, virtual_coord}, soft_resets); } // Free memory during teardown, and remove (clean/unlock) from any leftover mutexes. diff --git a/device/mockup/tt_mockup_device.hpp b/device/mockup/tt_mockup_device.hpp index cc62f767..7be4d441 100644 --- a/device/mockup/tt_mockup_device.hpp +++ b/device/mockup/tt_mockup_device.hpp @@ -32,7 +32,8 @@ class tt_MockupDevice : public tt_device { void deassert_risc_reset_at_core( tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_DEASSERT_SOFT_RESET) override {} - void assert_risc_reset_at_core(tt_cxy_pair core) override {} + void assert_risc_reset_at_core( + tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET) override {} void close_device() override {} diff --git a/device/simulation/deprecated/tt_emulation_device.cpp b/device/simulation/deprecated/tt_emulation_device.cpp index 31a4bab3..ae9f62db 100644 --- a/device/simulation/deprecated/tt_emulation_device.cpp +++ b/device/simulation/deprecated/tt_emulation_device.cpp @@ -60,7 +60,7 @@ void tt_emulation_device::deassert_risc_reset_at_core(tt_cxy_pair core, const Te tt_zebu_wrapper_inst->tensix_reset_deassert(core.x, core.y); } -void tt_emulation_device::assert_risc_reset_at_core(tt_cxy_pair core) { +void tt_emulation_device::assert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftResetOptions& soft_resets) { tt_zebu_wrapper_inst->tensix_reset_assert(core.x, core.y); } diff --git a/device/simulation/deprecated/tt_emulation_device.h b/device/simulation/deprecated/tt_emulation_device.h index 1e8ba61a..da31548f 100644 --- a/device/simulation/deprecated/tt_emulation_device.h +++ b/device/simulation/deprecated/tt_emulation_device.h @@ -33,7 +33,8 @@ class tt_emulation_device : public tt_device { virtual void deassert_risc_reset_at_core( tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_DEASSERT_SOFT_RESET); virtual void assert_risc_reset(); - virtual void assert_risc_reset_at_core(tt_cxy_pair core); + virtual void assert_risc_reset_at_core( + tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET); virtual void write_to_device( std::vector& vec, tt_cxy_pair core, diff --git a/device/simulation/deprecated/tt_emulation_stub.cpp b/device/simulation/deprecated/tt_emulation_stub.cpp index 40fe35ee..8e9ccd9b 100644 --- a/device/simulation/deprecated/tt_emulation_stub.cpp +++ b/device/simulation/deprecated/tt_emulation_stub.cpp @@ -27,7 +27,7 @@ void tt_emulation_device::assert_risc_reset() {} void tt_emulation_device::deassert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftResetOptions& soft_resets) {} -void tt_emulation_device::assert_risc_reset_at_core(tt_cxy_pair core) {} +void tt_emulation_device::assert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftResetOptions& soft_resets) {} void tt_emulation_device::close_device() {} diff --git a/device/simulation/deprecated/tt_versim_device.cpp b/device/simulation/deprecated/tt_versim_device.cpp index d2978be2..903f9fa2 100644 --- a/device/simulation/deprecated/tt_versim_device.cpp +++ b/device/simulation/deprecated/tt_versim_device.cpp @@ -173,7 +173,7 @@ void tt_VersimDevice::assert_risc_reset() { versim::assert_riscv_reset(*versim); } -void tt_VersimDevice::assert_risc_reset_at_core(tt_cxy_pair core) { +void tt_VersimDevice::assert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftResetOptions& soft_resets) { // This function asserts reset on the full versim device (don't need core level granularity for versim) assert_risc_reset(); } diff --git a/device/simulation/deprecated/tt_versim_device.h b/device/simulation/deprecated/tt_versim_device.h index d32d082a..c881b3c4 100644 --- a/device/simulation/deprecated/tt_versim_device.h +++ b/device/simulation/deprecated/tt_versim_device.h @@ -45,7 +45,8 @@ class tt_VersimDevice : public tt_device { virtual void deassert_risc_reset_at_core( tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_DEASSERT_SOFT_RESET); virtual void assert_risc_reset(); - virtual void assert_risc_reset_at_core(tt_cxy_pair core); + virtual void assert_risc_reset_at_core( + tt_cxy_pair core, const TensixSoftResetOptions& soft_resets = TENSIX_ASSERT_SOFT_RESET); virtual void write_to_device( std::vector& vec, tt_cxy_pair core, diff --git a/device/simulation/deprecated/tt_versim_stub.cpp b/device/simulation/deprecated/tt_versim_stub.cpp index 41db9cc7..f682732c 100644 --- a/device/simulation/deprecated/tt_versim_stub.cpp +++ b/device/simulation/deprecated/tt_versim_stub.cpp @@ -96,7 +96,7 @@ void tt_VersimDevice::deassert_risc_reset_at_core(tt_cxy_pair core, const Tensix void tt_VersimDevice::assert_risc_reset() {} -void tt_VersimDevice::assert_risc_reset_at_core(tt_cxy_pair core) {} +void tt_VersimDevice::assert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftResetOptions& soft_resets) {} void tt_VersimDevice::translate_to_noc_table_coords(chip_id_t device_id, std::size_t& r, std::size_t& c){}; diff --git a/device/simulation/tt_simulation_device.cpp b/device/simulation/tt_simulation_device.cpp index c21abf6c..485b302a 100644 --- a/device/simulation/tt_simulation_device.cpp +++ b/device/simulation/tt_simulation_device.cpp @@ -122,7 +122,7 @@ void tt_SimulationDevice::deassert_risc_reset_at_core(tt_cxy_pair core, const Te deassert_risc_reset(); } -void tt_SimulationDevice::assert_risc_reset_at_core(tt_cxy_pair core) { +void tt_SimulationDevice::assert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftResetOptions& soft_resets) { log_info( tt::LogEmulationDriver, "Sending 'assert_risc_reset_at_core'.. (Not implemented, defaulting to 'assert_risc_reset' instead)");