codegen should not emit dangling signals for nested procs w/ combo next body
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从将嵌套 proc 解析为组合模块的 codegen 路径开始,使用 PlusOne proc 及其生成的 Verilog 作为复现。跟踪 clk 和 rst 信号的添加与连接方式,然后验证组合型嵌套 proc 不再发出未使用的信号或将其标记为未读取,同时有状态 proc 保留所需的信号。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When a proc resolves to a combinational module (either intentionally: pure forwarding procs, if I/O operation get optimized away, or if it has no state), codegen will still emit a clk and rst signals for the corresponding verilog module.
While top-level proc signals can easily be marked as unread, this is more of a problem for nested sub procs as their internal clock or reset signal would still be driven from the overall proc network connections but end up never being read, hence producing potential warning/error in downstream tools.
To Reproduce
Codegen the following proc:
proc PlusOne {
ns: chan<u8> in;
plusones: chan<u8> out;
config(ns: chan<u8> in, plusones: chan<u8> out) {
(ns, plusones)
}
init {}
next(state: ()) {
let (_, n) = recv(token(), ns);
send(token(), plusones, n + 1);
}
}
Result in the following verilog module:
module user_module(
input wire clk,
input wire [7:0] _ns_data,
input wire _ns_valid,
input wire _plusones_ready,
output wire _ns_ready,
output wire [7:0] _plusones_data,
output wire _plusones_valid
);
wire stage_outputs_valid_0;
wire [7:0] add_59;
assign stage_outputs_valid_0 = _ns_valid & _plusones_ready;
assign add_59 = _ns_data + 8'h01;
assign _ns_ready = stage_outputs_valid_0;
assign _plusones_data = add_59;
assign _plusones_valid = _ns_valid;
endmodule
Expected behavior
unused internal clk or rst signal would be not emited or marked as unread using a developer provided macro.
- 主要语言
- C++
- 星标
- 1.9k
- 派生
- 287
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 100
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/xls 的其他 Issue
-
`xls_cc_embed_data`: shared-library link fails on macOS — ELF-only `-soname` passed to the Mach-O linker可能已有人在做 @marketchedai 于 21 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
Round video messages start gray and blocky with libx264: encoder is configured for 1,000,000 fps未关闭
难度 2/5 1-3 小时 新手友好度 78/100
telegramdesktop/tdesktop#31422 ·
维护者通常 9 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
zen-browser/desktop#15809 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ggml-org/whisper.cpp#4103 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
bitcoin-core/gui-qml#987 ·
维护者通常 3 天内回复