Repository navigation
xls/dev_tools/benchmark_main: Evaluate top block instead of blocks()[0] - #5373
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
After `Codegen` runs in `benchmark_main`, `package->GetTop().value()` is the top-level block, whereas `package->blocks()[0]` is whatever block happens to be first in the package. For multi-proc designs where a child proc is converted to a block before the stitched top-level container block is created, `package->blocks()[0]` evaluated only a single leaf block and skipped elaborating/benchmarking the stitched top container block. * Update `benchmark_main.cc` to evaluate `package->GetTop().value()` when the package top is a `Block*`, falling back to `package->blocks()[0].get()` after checking `!package->blocks().empty()`, and log the evaluated block name at `VLOG(1)`. * Default `proc_network_ir` in `xls/examples/BUILD` to `depth: 0` FIFOs and override only `a_to_b1` in `xls/examples/proc_network.x` with `#[channel(depth=2, bypass=true, register_push_outputs=true, register_pop_outputs=false)]` so ready backpressure across the `A -> B1 -> B2 -> B3 -> C -> A` and `Initiator -> A -> B1 -> B2 -> B3 -> C -> Initiator` loops does not form a combinational cycle when the stitched top block `ProcName` is elaborated. * Update `benchmark_main_test.sh` to verify via `proc_network_opt_ir_benchmark` that `benchmark_main` evaluates `ProcName` rather than `blocks()[0]`. PiperOrigin-RevId: 1018685728
copybara-service
Bot
force-pushed
the
test_1018685728
branch
from
November 20, 2026 19:41
5aa55cb to
95c0b2b
Compare
This branch has not been deployed
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.
xls/dev_tools/benchmark_main: Evaluate top block instead of blocks()[0]
After
Codegenruns inbenchmark_main,package->GetTop().value()is the top-level block, whereaspackage->blocks()[0]is whatever block happens to be first in the package. For multi-proc designs where a child proc is converted to a block before the stitched top-level container block is created,package->blocks()[0]evaluated only a single leaf block and skipped elaborating/benchmarking the stitched top container block.benchmark_main.ccto evaluatepackage->GetTop().value()when the package top is aBlock*, falling back topackage->blocks()[0].get()after checking!package->blocks().empty(), and log the evaluated block name atVLOG(1).proc_network_irinxls/examples/BUILDtodepth: 0FIFOs and override onlya_to_b1inxls/examples/proc_network.xwith#[channel(depth=2, bypass=true, register_push_outputs=true, register_pop_outputs=false)]so ready backpressure across theA -> B1 -> B2 -> B3 -> C -> AandInitiator -> A -> B1 -> B2 -> B3 -> C -> Initiatorloops does not form a combinational cycle when the stitched top blockProcNameis elaborated.benchmark_main_test.shto verify viaproc_network_opt_ir_benchmarkthatbenchmark_mainevaluatesProcNamerather thanblocks()[0].