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

nlatch Verliog code synthesis question #3864

Open
lixuzhe opened this issue Jul 26, 2023 · 0 comments
Open

nlatch Verliog code synthesis question #3864

lixuzhe opened this issue Jul 26, 2023 · 0 comments
Labels
pending-verification This issue is pending verification and/or reproduction

Comments

@lixuzhe
Copy link

lixuzhe commented Jul 26, 2023

Version

Yosys 0.31+6 (git sha1 0b8f728, gcc 9.4.0-1ubuntu1~20.04.1 -0g -fPIC))

On which OS did this happen?

Linux

Reproduction Steps

The nlatch in the Verilog code cannot be synthesized into the nlatch std_cell when the nlatch cell exists in my lib.

nlatch.ys :

read_verilog nlatch.v
hierarchy -top nlatch
proc
opt
techmap
opt
dfflibmap mycell.lib
abc -liberty mycell.lib
clean
write_verilog nlatch.syn.v

coding e.g.

module nlatch1(a,b,c);

input a;
input b;
output c;

reg  c;

always @(a,b) begin
    if (~a) begin
        c <= b;
    end  
end

endmodule

Expected Behavior

module nlatch1(a,b,c);
input a,b;
output c;

nlatch c_reg ( .CLK(a), .D(b), .Q(c) );

endmodule

Actual Behavior

module nlatch1(a,b,c);
input a;
wire a;
input b;
wire b;
output c;
reg c;

always @ *
if (!a) c=b;
endmodule

@lixuzhe lixuzhe added the pending-verification This issue is pending verification and/or reproduction label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-verification This issue is pending verification and/or reproduction
Projects
None yet
Development

No branches or pull requests

1 participant