wy21century
Newbie level 6
I wrote a verilog module in RTL and use it to abstract high level clock gating function. I want to replace it to a ICG cell in synthesis in order to ease DFT and PR flow. But when I tried with Magma, the tool complain 'no delay node found, won't do any clockgating'. Anything do I miss or any mistake exists in below code?
module ClkGate (
CLK,
RESETn,
ClkEnable,
scanmode,
GatedClk
);
input CLK;
input RESETn;
//synopsys async_set_reset RESETn
input ClkEnable;
input scanmode;
output GatedClk;
wire ClkEn;
reg ClkEnT2;
assign ClkEn = ClkEnable | scanmode;
always @(CLK or RESETn or ClkEn) begin
if (RESETn == 1'b0) begin
ClkEnT2 = 1'b1;
end
else if (CLK == 1'b0) begin
ClkEnT2 = ClkEn;
end
end
assign GatedClk = CLK & ClkEnT2;
endmodule
module ClkGate (
CLK,
RESETn,
ClkEnable,
scanmode,
GatedClk
);
input CLK;
input RESETn;
//synopsys async_set_reset RESETn
input ClkEnable;
input scanmode;
output GatedClk;
wire ClkEn;
reg ClkEnT2;
assign ClkEn = ClkEnable | scanmode;
always @(CLK or RESETn or ClkEn) begin
if (RESETn == 1'b0) begin
ClkEnT2 = 1'b1;
end
else if (CLK == 1'b0) begin
ClkEnT2 = ClkEn;
end
end
assign GatedClk = CLK & ClkEnT2;
endmodule