google / google/xls

optimization process makes the top proc empty

Open
#2,501 0 comments 0 reactions 1 assignee Claimed by @proppy View on GitHub
bug
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

Hi, I'm trying to run the workflow on matmul_4x4 from `examples` folder, and I got this top proc in the optimized IR file
```
top proc __matmul_4x4__matmul_4x4_0_next() {
}
```
After going through files that `--ir_dump_path` generated, I found out that all the implementations in top proc have been removed since 'matmul_4x4.00754.after_dce.post-inlining optimization passes(opt_level>=1).changed.ir'. Is there any more specific suggestion on optimization level?
Also, code generation based on this optimized IR file will give error message like this:
```
E0626 21:34:41.678815 277 block_stitching_pass.cc:487] INTERNAL: XLS_RET_CHECK failure (xls/codegen/block_stitching_pass.cc:487) channel->channel_config().fifo_config().has_value() Channel matmul_4x4__east_west__0_0 has no fifo config.
0x564b1b769fdd: xabsl::StatusBuilder::CreateStatusAndConditionallyLog()
0x564b19bdaee9: xabsl::StatusBuilder::operator absl::lts_20250127::Status()
0x564b19c6793f: xls::verilog::(anonymous namespace)::StitchStreamingChannel()
0x564b19c5bddd: xls::verilog::(anonymous namespace)::StitchBlocks()
0x564b19c594d2: xls::verilog::BlockStitchingPass::RunInternal()
0x564b19c40bbf: xls::PassBase<>::Run()
0x564b19c41b36: xls::CompoundPassBase<>::RunNested()
0x564b19c435ac: xls::CompoundPassBase<>::RunInternal()
0x564b19c40bbf: xls::PassBase<>::Run()
0x564b19c3703a: xls::verilog::ToPipelineModuleText()
0x564b19c292d6: xls::(anonymous namespace)::CodegenFromMetadata()
0x564b19c2a119: xls::ScheduleAndCodegen()
0x564b19bd87a0: xls::(anonymous namespace)::RealMain()
0x564b19bd82c7: main
0x7feca95881ca: [unknown]
0x7feca958828b: __libc_start_main
0x564b19bd81a5: _start

Error: INTERNAL: XLS_RET_CHECK failure (xls/codegen/block_stitching_pass.cc:487) channel->channel_config().fifo_config().has_value() Channel matmul_4x4__east_west__0_0 has no fifo config.; Running pass #0: Create container block that instantiates and stitches blocks together. [short: block_stitching]; Running pass #0: Top level codegen pass pipeline [short: codegen]
```
Is this caused by the empty top proc? By the way, I use pre-built binaries.

_Originally posted by @zihling in https://github.com/google/xls/discussions/2500_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.