Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct

Status
Not open for further replies.

chyavanphadke

Newbie
Newbie level 3
Joined
Oct 17, 2020
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
30
I wrote a Verilog code for DE-10 Lite in Quartus Prime, I am getting the error it says "cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct". Can you please help?

Code:
module DemoBlink (

    input clk, rst,

    output [9:0] LED

);


reg [24:0] counter;

reg [9:0] temp;


initial begin

    temp <= 1'b0;

    counter <= 0;

end


always @ (posedge clk or posedge rst) begin

  

    if (!rst) begin                                                          // Error is in this line

        temp <= 1'b0;

        counter <= 0;

    end else begin

        counter <= counter + 1;

        if (counter == 8'd25000000) begin

            temp = ~temp;

        end

    end

end



assign LED[0] = temp;


endmodule
 
Last edited by a moderator:

verilog synthesis uses the sensitivity list and code to determine clock vs reset. This avoids the need for an "if rising_edge(clk) then" line.

so in this case, you have "posedge rst" which doesn't match the "if (!rst) begin".
 
verilog synthesis uses the sensitivity list and code to determine clock vs reset. This avoids the need for an "if rising_edge(clk) then" line.

so in this case, you have "posedge rst" which doesn't match the "if (!rst) begin".
@@vGoodtimes, thanks for the explanation. I understood and did accordingly it worked.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top