Closed abhullar-tt closed 4 months ago
FYI @pgkeller, It doesn't look like any drastic changes introduced for BH noc_nonblocking_api. A lot of the changes to BH version needed because BBE and Metal versions of WH noc_nonblocking_api.h have diverged with BH version being copied directly from BBE.
I am assuming that the other tensix files have also diverged. I can go through those as well and make sure our BH versions are incremental steps from WH versions rather than copied of BBE variants. Should we consider going through a commonization exercise (between Metal and BBE) and add these files to UMD?
API additions/removals in BH noc_nonblocking_api to match diverged Metal WH noc_nonblocking_api
__attribute__((always_inline))
needs to be addedNOC_CMD_BUF_WRITE_REG_L1, NOC_CMD_BUF_READ_REG_L1, NOC_STATUS_READ_REG_L1
need to be removed from BH (Metal WH version uses the non L1 specific APIs)noc_cmd_buf_ready
needs to be added to BH ncrisc_noc_fast_read_scatter
not in Metal WH version (remove from BH?)ncrisc_noc_fast_read_l1
ncrisc_noc_reads_flushed_l1
ncrisc_noc_all_reads_flushed
and ncrisc_noc_all_reads_flushed_l1
and add BH variant of ncrisc_noc_reads_flushed
ncrisc_noc_fast_read_ok
and ncrisc_noc_fast_read_ok_l1
ncrisc_rd_data_word_recv
ncrisc_noc_clear_outstanding_reqs
ncrisc_noc_fast_write_l1
ncrisc_noc_fast_write_ok, ncrisc_noc_fast_write_bufs_ok, ncrisc_noc_fast_write_ok_l1
ncrisc_noc_blitz_write
ncrisc_noc_nonposted_writes_sent_l1
ncrisc_noc_nonposted_all_writes_sent
and ncrisc_noc_nonposted_all_writes_sent_l1
ncrisc_noc_nonposted_writes_flushed_l1
ncrisc_noc_nonposted_all_writes_flushed
and ncrisc_noc_nonposted_all_writes_flushed_l1
noc_local_state_init
ncrisc_noc_counters_init
ncrisc_noc_all_flushed
RISC_B0_HW
versions of ncrisc_noc_fast_read_any_len
ncrisc_noc_fast_read_any_len_scatter
ncrisc_noc_fast_write_any_len_l1
ncrisc_noc_fast_write_any_len_loopback_src
noc_atomic_read_and_increment_l1
API changes
ncrisc_noc_fast_read
NOC_TARG_ADDR_LO/MID/HI
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_LO, (uint32_t)src_addr);
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_MID, (uint32_t)(src_addr >> 32) & 0xF);
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_HI, (uint32_t)(src_addr >> 36) & 0xFFFFFF);
ncrisc_noc_fast_write
transaction_id
and add multicast_path_reserve
+posted
NOC_RET_ADDR_LO/MID/HI
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_RET_ADDR_LO, (uint32_t)dest_addr);
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_RET_ADDR_MID, (uint32_t)(dest_addr >> 32) & 0xF);
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_RET_ADDR_HI, (uint32_t)(dest_addr >> 36) & 0xFFFFFF);
Add ncrisc_noc_fast_write_loopback_src
where dest_addr split between NOC_RET_ADDR_LO/MID/HI
ncrisc_noc_blitz_write_setup
NOC_RET_ADDR_MID/HI
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_RET_ADDR_MID, (uint32_t)(dest_addr >> 32) & 0xF);
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_RET_ADDR_HI, (uint32_t)(dest_addr >> 36) & 0xFFFFFF);
Remove transaction_id
from:
ncrisc_noc_reads_flushed
ncrisc_noc_nonposted_writes_sent
ncrisc_noc_nonposted_writes_flushed
noc_init
(rename from ncrisc_noc_init
and port Metal WH version)
NOC_TARG_ADDR_HI
NOC_RET_ADDR_LO/MID/HI
????NOC_RET_ADDR_HI
???Port WH version of ncrisc_noc_full_sync
noc_fast_posted_write_dw_inline
posted
parameterNOC_TARG_ADDR_LO/MID/HI
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_LO, (uint32_t)(dest_addr & ~(NOC_WORD_BYTES-1)));
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_MID, (dest_addr >> 32) & 0xF);
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_HI, (dest_addr >> 36) & 0xFFFFFF);
noc_fast_atomic_increment
read_addr
and transaction_id
, add posted
addr
written to NOC_TARG_ADDR_LO/MID/HI
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_LO, (uint32_t)(addr & 0xFFFFFFFF));
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_MID, (uint32_t)(addr >> 32) & 0xF));
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_HI, (uint32_t)(addr >> 36) & 0xFFFFFF);
@davorchap do you anticipate needing to address over 4 GB? If not then we don't need the higher bits of src_addr
/dest_addr
and can ignore writing to *_MID/*_HI
registers.
@pgkeller on WH we do write to *_LO and *_MID
on WH, eg:
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_LO, (uint32_t)src_addr);
NOC_CMD_BUF_WRITE_REG(noc, cmd_buf, NOC_TARG_ADDR_MID, src_addr >> 32);
Related to noc_nonblocking_api:
seeing a hang in ncrisc_noc_reads_flushed
Related to noc_nonblocking_api: seeing a hang in
ncrisc_noc_reads_flushed
this was due to bug in setting a HI
register (value needed to be right shifted by an additional 4 bits)
TODO: