Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSM Extraction does not work #3831

Closed
myzinsky opened this issue Jul 5, 2023 · 3 comments
Closed

FSM Extraction does not work #3831

myzinsky opened this issue Jul 5, 2023 · 3 comments

Comments

@myzinsky
Copy link

myzinsky commented Jul 5, 2023

Version

Yosys 0.30+48 (git sha1 14d50a1, x86_64-apple-darwin20.2-clang 10.0.0-4ubuntu1 -fPIC -Os)

On which OS did this happen?

macOS

Reproduction Steps

Followed the steps in this stack overflow answer:

https://stackoverflow.com/questions/32645965/fsm-export-using-yosys

Using oss-cad-suite

Expected Behavior

KISS-File of FSM-Structure shall be generated

Actual Behavior

The extraction step passes, however, there is no kiss-file generated.

@myzinsky myzinsky added the pending-verification This issue is pending verification and/or reproduction label Jul 5, 2023
@nakengelhardt
Copy link
Member

Can you post the full design and script to reproduce this?

@myzinsky
Copy link
Author

myzinsky commented Jul 5, 2023

It is in the link above:

test.v

module test(input clk, rst, ctrl, output [3:0] O);
    reg [1:0] state;
    always @(posedge clk) begin
        O <= 0;
        if (rst) begin
            state <= 0;
        end else case (state)
            0: begin
                state <= ctrl ? 1 : 2;
                O <= 1;
            end
            1: begin
                O <= 2;
                if (ctrl) begin
                    state <= 2;
                    O <= 3;
                end
            end
            2: begin
                O <= 4;
                if (ctrl) begin
                    state <= 3;
                    O <= 5;
                end
            end
            3: begin
                if (!ctrl)
                    state <= 2'b00;
            end
        endcase
    end
endmodule

Yosys commands:

read_verilog test.v
proc; opt; fsm -nomap
fsm_export -o test.kiss2

@nakengelhardt
Copy link
Member

The script is wrong; fsm requires the previous opt to be called with -nosdff -nodffe. It works with this script:

read_verilog test.v
proc
opt -nodffe -nosdff
fsm -nomap
fsm_export -o test.kiss2

@nakengelhardt nakengelhardt closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
@nakengelhardt nakengelhardt removed the pending-verification This issue is pending verification and/or reproduction label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants