From baefcf7b071d600f81fa963aded92ae8986bb856 Mon Sep 17 00:00:00 2001 From: Bezulj Marko Date: Fri, 20 Sep 2024 08:19:33 +0000 Subject: [PATCH] addressing PR comments --- device/mockup/tt_mockup_device.hpp | 90 +++++++++++++++--------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/device/mockup/tt_mockup_device.hpp b/device/mockup/tt_mockup_device.hpp index 49a14880..17312174 100644 --- a/device/mockup/tt_mockup_device.hpp +++ b/device/mockup/tt_mockup_device.hpp @@ -21,82 +21,82 @@ class tt_MockupDevice : public tt_device { virtual ~tt_MockupDevice() {} // Setup/Teardown Functions - virtual std::unordered_map& get_virtual_soc_descriptors() override { + std::unordered_map& get_virtual_soc_descriptors() override { return soc_descriptor_per_chip; } - virtual void set_device_l1_address_params(const tt_device_l1_address_params& l1_address_params_) override{}; - virtual void set_device_dram_address_params(const tt_device_dram_address_params& dram_address_params_) override{}; - virtual void set_driver_host_address_params(const tt_driver_host_address_params& host_address_params_) override{}; - virtual void set_driver_eth_interface_params( - const tt_driver_eth_interface_params& eth_interface_params_) override{}; - virtual void start_device(const tt_device_params& device_params) override {} - virtual void assert_risc_reset() override{}; - virtual void deassert_risc_reset() override{}; - virtual void deassert_risc_reset_at_core(tt_cxy_pair core) override{}; - virtual void assert_risc_reset_at_core(tt_cxy_pair core) override{}; - virtual void close_device() override{}; + void set_device_l1_address_params(const tt_device_l1_address_params& l1_address_params_) override {} + void set_device_dram_address_params(const tt_device_dram_address_params& dram_address_params_) override {} + void set_driver_host_address_params(const tt_driver_host_address_params& host_address_params_) override {} + void set_driver_eth_interface_params( + const tt_driver_eth_interface_params& eth_interface_params_) override {} + void start_device(const tt_device_params& device_params) override {} + void assert_risc_reset() override {} + void deassert_risc_reset() override {} + void deassert_risc_reset_at_core(tt_cxy_pair core) override {} + void assert_risc_reset_at_core(tt_cxy_pair core) override {} + void close_device() override {} // Runtime Functions - virtual void write_to_device( + 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) override{}; - virtual void write_to_device( - std::vector& vec, tt_cxy_pair core, uint64_t addr, const std::string& tlb_to_use) override{}; - virtual void read_from_device( - void* mem_ptr, tt_cxy_pair core, uint64_t addr, uint32_t size, const std::string& fallback_tlb) override{}; - virtual void read_from_device( + const std::string& tlb_to_use) override {} + void write_to_device( + std::vector& vec, tt_cxy_pair core, uint64_t addr, const std::string& tlb_to_use) override {} + void read_from_device( + void* mem_ptr, tt_cxy_pair core, uint64_t addr, uint32_t size, const std::string& fallback_tlb) override {} + void read_from_device( std::vector& vec, tt_cxy_pair core, uint64_t addr, uint32_t size, - const std::string& tlb_to_use) override{}; - virtual void write_to_sysmem( - std::vector& vec, uint64_t addr, uint16_t channel, chip_id_t src_device_id) override{}; - virtual void write_to_sysmem( - const void* mem_ptr, std::uint32_t size, uint64_t addr, uint16_t channel, chip_id_t src_device_id) override{}; - virtual void read_from_sysmem( - std::vector& vec, uint64_t addr, uint16_t channel, uint32_t size, chip_id_t src_device_id) override{}; - virtual void read_from_sysmem( - void* mem_ptr, uint64_t addr, uint16_t channel, uint32_t size, chip_id_t src_device_id) override{}; + const std::string& tlb_to_use) override {} + void write_to_sysmem( + std::vector& vec, uint64_t addr, uint16_t channel, chip_id_t src_device_id) override {} + void write_to_sysmem( + const void* mem_ptr, std::uint32_t size, uint64_t addr, uint16_t channel, chip_id_t src_device_id) override {} + void read_from_sysmem( + std::vector& vec, uint64_t addr, uint16_t channel, uint32_t size, chip_id_t src_device_id) override {} + void read_from_sysmem( + void* mem_ptr, uint64_t addr, uint16_t channel, uint32_t size, chip_id_t src_device_id) override {} - virtual void l1_membar( + void l1_membar( const chip_id_t chip, const std::string& fallback_tlb, - const std::unordered_set& cores = {}) override{}; - virtual void dram_membar( + const std::unordered_set& cores = {}) override {} + void dram_membar( const chip_id_t chip, const std::string& fallback_tlb, - const std::unordered_set& channels = {}) override{}; - virtual void dram_membar( + const std::unordered_set& channels = {}) override {} + void dram_membar( const chip_id_t chip, const std::string& fallback_tlb, - const std::unordered_set& cores = {}) override{}; + const std::unordered_set& cores = {}) override {} - virtual void wait_for_non_mmio_flush() override{}; + void wait_for_non_mmio_flush() override {} // Misc. Functions to Query/Set Device State - virtual std::unordered_map get_harvesting_masks_for_soc_descriptors() override { + std::unordered_map get_harvesting_masks_for_soc_descriptors() override { return {{0, 0}}; } static std::vector detect_available_device_ids() { return {0}; }; - virtual std::set get_target_remote_device_ids() override { return target_remote_chips; } - virtual std::map get_clocks() override { return {{0, 0}}; } - virtual void* host_dma_address(std::uint64_t offset, chip_id_t src_device_id, uint16_t channel) const override { + std::set get_target_remote_device_ids() override { return target_remote_chips; } + std::map get_clocks() override { return {{0, 0}}; } + void* host_dma_address(std::uint64_t offset, chip_id_t src_device_id, uint16_t channel) const override { return nullptr; } - virtual std::uint64_t get_pcie_base_addr_from_device() const override { return 0; } - virtual std::uint32_t get_num_dram_channels(std::uint32_t device_id) override { + std::uint64_t get_pcie_base_addr_from_device() const override { return 0; } + std::uint32_t get_num_dram_channels(std::uint32_t device_id) override { return get_soc_descriptor(device_id)->get_num_dram_channels(); }; - virtual std::uint64_t get_dram_channel_size(std::uint32_t device_id, std::uint32_t channel) override { + std::uint64_t get_dram_channel_size(std::uint32_t device_id, std::uint32_t channel) override { return get_soc_descriptor(device_id)->dram_bank_size; } - virtual std::uint32_t get_num_host_channels(std::uint32_t device_id) override { return 1; } - virtual std::uint32_t get_host_channel_size(std::uint32_t device_id, std::uint32_t channel) override { return 0; } - virtual std::uint32_t get_numa_node_for_pcie_device(std::uint32_t device_id) override { return 0; } + std::uint32_t get_num_host_channels(std::uint32_t device_id) override { return 1; } + std::uint32_t get_host_channel_size(std::uint32_t device_id, std::uint32_t channel) override { return 0; } + std::uint32_t get_numa_node_for_pcie_device(std::uint32_t device_id) override { return 0; } private: std::vector archs_in_cluster = {};