rlc: multi-user RLC kernel, bootrom toolchain fix, tile write-enable timing - #30
Draft
Aquaticfuller wants to merge 4 commits into
Draft
rlc: multi-user RLC kernel, bootrom toolchain fix, tile write-enable timing#30Aquaticfuller wants to merge 4 commits into
Aquaticfuller wants to merge 4 commits into
Conversation
The riscv command is not available when building the toolchain using make toolchain.
…ew-part cascade (shorten data-bank we path tail)
Brings the packet-assembly restructuring and the multi-user extension onto the multi-group kernel, keeping this branch's explicit producer/consumer core lists as the dispatch mechanism. Restructuring (originally from PR #12, Huawei): rlc_send_pkt / ue_status_rpt / pkt_production_and_recycle split out of the consumer loop, per-packet TestDataStru, DFX counters, rate pacing. Multi-user: One rlc_context_t per UE (rlc_ctx[NUM_USERS], sized from the data header's ACTIVE_USER_NUMBER), per-user list locks and per-user SN/ACK state. Producers route each PDCP package to rlc_ctx[user_id]; consumers own a static subset of the entities. NUM_USERS == 1 reduces to the single-entity kernel. Fitted to the core lists rather than replacing them: - a consumer's share of the entities follows its index in consumer_core_ids[], not core_id - PRODUCER_CORE_NUM, so the roles need not be contiguous; - the UE status task runs on producer_core_ids[0] instead of core 0, which need not be a producer; - producers_finished is dropped: producer_done is already the count of producers that have finished. Also: DATAHEADER now actually reaches rlc.c (a hard-coded include shadowed it, so every K-variant compiled the same dataset); the generator emits ACTIVE_USER_NUMBER and a 4-byte-aligned PDU_STRIDE (needed for 810 B PDUs, whose slots would otherwise be misaligned for the vector copies); pacing overflow fixed behind RLC_ENABLE_PACING (default off); optional payload self-check behind RLC_SELF_CHECK. Co-authored-by: zouguoqi <zouguoqi@huawei.com>
The fallback declared producer_core_ids[NUM_PRODUCER_CORES] = {0, 1}: with a
larger PRODUCER_CORE_NUM the array reads past its initializers, so every core
above the second dispatches as neither producer nor consumer and the run goes
silently idle. Headers generated before the core lists existed hit this as soon
as the P/C counts are swept.
Derive contiguous ranges in that mode instead of declaring an array, and route
both modes through rlc_is_producer / rlc_is_consumer / rlc_consumer_index /
rlc_status_core so the entity partition and the status task follow whichever
mode is active.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.
rlc: multi-user RLC kernel with use-case switchingBrings two things onto the multi-group kernel: the packet-assembly restructuring from PR #12
(@zouguoqi), and a multi-user extension on top of it.
Restructuring (PR #12):
rlc_send_pkt/ue_status_rpt/pkt_production_and_recyclesplitout of the consumer loop, per-packet
TestDataStru, DFX counters, rate pacing.Multi-user: one
rlc_context_tper UE —rlc_ctx[NUM_USERS], sized from the data header'sACTIVE_USER_NUMBER— with per-user list locks and per-user SN/ACK state. Producers route eachPDCP package to
rlc_ctx[user_id](theuser_idwas already in every descriptor and simplyignored); consumers own a static subset of the entities.
NUM_USERS == 1reduces exactly to thesingle-entity kernel, so TC1 behaviour is unchanged.
This covers TC2 (multi-user peak, 48 UEs, 800 B) from
DP Introduction.docx; TC1 staysselectable. The use case is chosen at build time by which data header is compiled
(
M<users>_N<len>_K<pkgs>⟷data_<M>_<N>_<K>.h), so there is one kernel source, not a fork.Fitted to this branch's core lists, not replacing them
mainadded explicitproducer_core_ids[]/consumer_core_ids[]dispatch (#27), which isstrictly more general than the contiguous
PRODUCER_CORE_NUMranges the multi-user work wasoriginally written against. The lists are kept as the source of truth:
consumer_core_ids[], notcore_id - PRODUCER_CORE_NUM, so producer/consumer cores need not be contiguous;producer_core_ids[0]instead of core 0 — with explicit listscore 0 need not be a producer, and gating on it would have dropped the ACK task entirely;
producers_finishedis removed as redundant:producer_doneis already the count of producersthat have finished (it additionally carries the
this_core_doneguard, so a slow producercannot be abandoned mid-flight);
PRODUCER_CORE_NUM/CONSUMER_CORE_NUMstay as fallbacks for headers generated before thelists existed, and as the pacing divisor.
Fixes carried along
DATAHEADERnow actually reachesrlc.c. It hard-coded#include "../data/data_1_1350_100.h",and since every generated header shares the
PDCP_PKG_Hguard, the per-variant define was asilent no-op —
K10,K100andK300all compiled the same 100-packet dataset (byte-identicalELFs). The dead
add_library(rlc ...)target is dropped with it: rlc.c needs the per-variantdefine, which a shared library target cannot provide (nothing linked it).
PDU_STRIDE. The generator now pads the slot stride to 4 bytes. An 810 B PDU (800 + 10)leaves odd slots 2-byte aligned, which traps the word/vector payload copies; stride and copy
length are now separate (descriptor
pkg_lengthstill carries 810).PRODUCER_CORE_NUM * PDU_SIZE * CPU_FREQENCYoverflows int32(2·1360·1e9 wraps to 1285701632), so pacing was silently inert. Fixed with 64-bit math but left
off by default (
RLC_ENABLE_PACING=0keeps the legacy expression verbatim) so existingnumbers stay comparable — enabling it changes benchmark behaviour and should be a separate call.
RLC_SELF_CHECK.2.
Don't hardcode ETH toolchain for bootrom compilation(@jpf-h)Johannes' fix from #25, carried here so it lands on
main: the bootrom rule invokedriscv -riscv64-gcc-9.5.0 …, which only exists on the ETH cluster, somake toolchainbuildscould not build the bootrom. Now uses
$(GCC_INSTALL_DIR)/bin/riscv32-unknown-elf-*.Merged with this branch's dependency-list change to the same rule.
3.
cachepool_tile: bank_we/bank_req as direct OR-reduceBehaviour-preserving timing restructuring.
bank_we/bank_reqwere produced by a prioritycascade plus a 4:1
sel_part_idxmux; they are value-identical to direct OR-reduces of the partbits (the arbiter always selects a write-part when any write exists, else a read-part), so
computing them directly takes the write-enable off the critical-path tail
(data-bank we → meta-write clock-gate).
addr/wdata/bestill use the mux. Mirrors whatgen_unfolded_data_banksalready did.