Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable targeting idle eth cores on BH #14817

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

abhullar-tt
Copy link
Contributor

@abhullar-tt abhullar-tt commented Nov 6, 2024

Ticket

Closes #14653
No ticket, removing workaround required that was impacting p100 CI

What's changed

CI FW has been downgraded so this going back to original behaviour

Checklist

@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch from 3b0ff59 to 259a471 Compare November 11, 2024 20:48
@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch from 259a471 to d9c8f61 Compare November 20, 2024 16:39
@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch 2 times, most recently from 8f95992 to 5ef063a Compare November 25, 2024 03:42
@abhullar-tt abhullar-tt changed the title #0: Re-enable targeting idle eth cores after downgrading BH CI FW #0: Re-enable targeting idle eth cores on BH Nov 25, 2024
@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch 2 times, most recently from 3c8dc89 to f11c6b5 Compare November 27, 2024 02:01
@abhullar-tt abhullar-tt changed the title #0: Re-enable targeting idle eth cores on BH Re-enable targeting idle eth cores on BH Nov 27, 2024
@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch 4 times, most recently from 34fc134 to 778dc55 Compare December 3, 2024 04:21
@@ -20,7 +20,7 @@ namespace tt {
#define DEBUG_VALID_WORKER_ADDR(a, l) (DEBUG_VALID_L1_ADDR(a, l) || (DEBUG_VALID_REG_ADDR(a) && (l) == 4))
#define DEBUG_VALID_DRAM_ADDR(a, l, b, e) (((a) >= b) && ((a) + (l) <= e))

#define DEBUG_VALID_ETH_ADDR(a, l) (((a) >= HAL_MEM_ETH_BASE) && ((a) + (l) <= HAL_MEM_ETH_BASE + HAL_MEM_ETH_SIZE))
#define DEBUG_VALID_ETH_ADDR(a, l) ((((a) >= HAL_MEM_ETH_BASE) && ((a) + (l) <= HAL_MEM_ETH_BASE + HAL_MEM_ETH_SIZE)) || (DEBUG_VALID_REG_ADDR(a) && (l) == 4))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up: I think clang-format will force you to turn this into a multi line macro for readability.

Maybe consider turning this into an inline function with some code comments?

@@ -69,7 +69,8 @@ void Hal::initialize_bh() {
(addr < NOC_OVERLAY_START_ADDR + NOC_STREAM_REG_SPACE_SIZE * NOC_NUM_STREAMS)) ||
((addr >= NOC0_REGS_START_ADDR) && (addr < NOC0_REGS_START_ADDR + 0x1000)) ||
((addr >= NOC1_REGS_START_ADDR) && (addr < NOC1_REGS_START_ADDR + 0x1000)) ||
(addr == RISCV_DEBUG_REG_SOFT_RESET_0));
(addr == RISCV_DEBUG_REG_SOFT_RESET_0) ||
(addr== 0xFFB14000 || addr == 0xFFB14008)); // used to program start addr for eth FW
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers? Can we come up with a descriptive name, and make it constexpr variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will make them consts

void launch_erisc_app_fw_on_core(chip_id_t chip, CoreCoord core) {
llrt::write_hex_vec_to_core(chip, core, tt::stl::Span(&ERISC_APP_FW_ON_CORE_FLAG, 1), eth_l1_mem::address_map::LAUNCH_ERISC_APP_FLAG);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you are ready to merge this, I believe you can also rm -rf:
#include "eth_l1_address_map.h" // address_map

constexpr uint32_t jal_opcode = 0x6f;
constexpr uint32_t jal_max_offset = 0x0007ffff;
uint32_t opcode = jal_opcode;
uint32_t firmware_base = is_eth_core ? MEM_IERISC_FIRMWARE_BASE : MEM_BRISC_FIRMWARE_BASE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@tenstorrent tenstorrent deleted a comment from nathan-TT Dec 4, 2024
@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch from 778dc55 to 7c23c0a Compare December 4, 2024 17:27
@@ -74,6 +74,8 @@ HalCoreInfoType create_active_eth_mem_map() {
.fw_base_addr = eth_l1_mem::address_map::FIRMWARE_BASE,
.local_init_addr = eth_l1_mem::address_map::FIRMWARE_BASE, // this will be uplifted in subsequent commits
// enabling active erisc
.fw_launch_addr = 0xFFB14008,
.fw_launch_addr_value = (uint32_t)eth_l1_mem::address_map::FIRMWARE_BASE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: wasn't clear what "fw_launch_addr_value" was in other contexts, maybe "fw_launch_jmp_insn" (yes, ties the use to the name, but I think that's ok)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm the reason I didn't add jump into the name is because we don't always write the jump instruction at this value. like this case above we just write FW base addr directly to the PC

@@ -70,19 +70,32 @@ HalCoreInfoType create_idle_eth_mem_map() {
std::vector<std::vector<HalJitBuildConfig>> processor_classes(NumEthDispatchClasses);
std::vector<HalJitBuildConfig> processor_types(1);
for (std::uint8_t processor_class_idx = 0; processor_class_idx < NumEthDispatchClasses; processor_class_idx++) {
DeviceAddr fw_base, local_init;
DeviceAddr fw_base, local_init, fw_launch;
uint32_t fw_launch_value;
switch (processor_class_idx) {
case 0: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessarily in scope of this change...but why are we using 0, 1, 2 rather than names?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason but these can be dm0, dm1

@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch from 7c23c0a to 8460546 Compare December 23, 2024 19:11
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

constexpr uint32_t jal_opcode = 0x6f;
constexpr uint32_t jal_max_offset = 0x0007ffff;
uint32_t opcode = jal_opcode;
assert(firmware_base < jal_max_offset);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
unexpected namespace name assert: expected expression

@abhullar-tt abhullar-tt force-pushed the abhullar/enable-bh-eth branch from 8460546 to 6d70846 Compare December 23, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

llrt.cpp uses ARCH_NAME specific include path for dev_msgs.h dev_mem_map.h eth_l1_address_map.h
4 participants