-
Notifications
You must be signed in to change notification settings - Fork 88
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
base: main
Are you sure you want to change the base?
Conversation
3b0ff59
to
259a471
Compare
259a471
to
d9c8f61
Compare
8f95992
to
5ef063a
Compare
3c8dc89
to
f11c6b5
Compare
34fc134
to
778dc55
Compare
@@ -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)) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful!
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
778dc55
to
7c23c0a
Compare
@@ -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, |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
7c23c0a
to
8460546
Compare
There was a problem hiding this 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)
tt_metal/llrt/hal.cpp
Outdated
constexpr uint32_t jal_opcode = 0x6f; | ||
constexpr uint32_t jal_max_offset = 0x0007ffff; | ||
uint32_t opcode = jal_opcode; | ||
assert(firmware_base < jal_max_offset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected namespace name assert
: expected expression
8460546
to
6d70846
Compare
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