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

FF with clock enable and syncronous set/reset does not work #91

Open
litghost opened this issue Nov 30, 2020 · 3 comments
Open

FF with clock enable and syncronous set/reset does not work #91

litghost opened this issue Nov 30, 2020 · 3 comments
Assignees

Comments

@litghost
Copy link
Contributor

(* whitebox *)                                                                                                                                                                                                                                                                            
module FF(C, D, Q, CE, SR);                                                    
    parameter RESET_VALUE = 1'b0;                                                
                                                                               
    (* CLOCK *)                                                                
    input C;                                                                   
                                                                               
    (* SETUP = "C 10e-12" *)                                                   
    input D;                                                                   
                                                                               
    (* SETUP = "C 10e-12" *)                                                   
    input CE;                                                                  
                                                                               
    (* SETUP = "C 10e-12" *)                                                   
    input SR;                                                                  
                                                                               
    (* CLK_TO_Q = "C 10e-12" *)                                                
    output reg Q;                                                              
                                                                               
    always @(posedge C) begin                                                  
        if(SR) begin                                                           
            Q <= RESET_VALUE;                                                  
        end else if(CE) begin                                                  
            Q <= D;                                                            
        end                                                                    
    end                                                                        
                                                                               
endmodule    

This generates no clock annotations in the .model.xml for D/CE/SR. None of the current examples in the v2x documentation show how to make this work properly.

@mithro
Copy link
Collaborator

mithro commented Nov 30, 2020

FYI - @mkurc-ant

@mithro
Copy link
Collaborator

mithro commented Nov 30, 2020

BTW - Your example looks valid and should probably also be a test case.

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

3 participants