llvm / llvm/circt

[ExportVerilog] Vivado error in SV code generated from FSMs when disallowMuxInlining=true

Open
#4,939 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

When emitting Verilog with `disallowMuxInlining = true`, Vivado complains about the SV code lowered from FSMs:
```
ERROR: [VPL 10-1102] net data types must be 4 state [src/CalyxExtMemToAxi.sv:46]
```
`CalyxExtMemToAxi.sv` has the following contents:
```sv
`include "fsm_enum_typedefs.sv"
module CalyxExtMemToAxi(
...
input calyx_read_en,
...
);

CalyxExtMemToAxi_state_t to_IDLE;
assign to_IDLE = CalyxExtMemToAxi_state_t_IDLE;
CalyxExtMemToAxi_state_t to_AR_HANDSHAKE;
assign to_AR_HANDSHAKE = CalyxExtMemToAxi_state_t_AR_HANDSHAKE;

wire CalyxExtMemToAxi_state_t _GEN = calyx_read_en ? to_AR_HANDSHAKE : to_IDLE; // <------ ERROR HERE
...
endmodule
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the ExportVerilog path that lowers FSM transitions when disallowMuxInlining is enabled, using the generated CalyxExtMemToAxi.sv example as the reproduction case. Inspect how the _GEN conditional net is emitted and reproduce the Vivado diagnostic; done means generated SystemVerilog is accepted without the net data type error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.