//------------------------------------------------------------- // Copyright Kacper Technologies Pvt.Ltd //------------------------------------------------------------- // // File Name : $RCSfile: assertions.sv $ // Module Name : power_assertions // Project : ASSERTIONS_LP // Revision : $Revision: 1.0 $ // Module description : Assertions for Low Power // ------------------------------------------------------------ `define ACTIVE_ISO_EDGE negedge `define INACTIVE_ISO_EDGE posedge `define INACTIVE_PWR_EDGE posedge module power_assertions (clk, reset, high_fanout_net_1, high_fanout_net_2, high_fanout_net_3, high_fanout_net_4,high_fanout_net_5, high_fanout_net_6,high_fanout_net_7, high_fanout_net_8, high_fanout_net_9, high_fanout_net_10,high_fanout_net_11, high_fanout_net_12,power_ctrl,isolation_ctrl,save,restore,power_control_for_all_domains,rd_enable, wr_enable,addr); parameter NO_OF_DOMAINS = 1; parameter POWER_OFF = 1; parameter POWER_ON = 0; parameter RESET_OFF = 1; parameter RESET_ON = 0; parameter ISO_SENSE = 0; parameter WIDTH_1 = 0; parameter WIDTH_2 = 31; parameter WIDTH_3 = 1; parameter WIDTH_4 = 7; parameter WIDTH_5 = 0; parameter WIDTH_6 = 0; parameter WIDTH_7 = 0; parameter WIDTH_8 = 0; parameter WIDTH_9 = 0; parameter WIDTH_10 = 0; parameter WIDTH_11 = 0; parameter WIDTH_12 = 0; parameter WIDTH_ADDR = 31; parameter POWER_OFF_VAL_NET1='dx; parameter POWER_OFF_VAL_NET2='d0; parameter POWER_OFF_VAL_NET3='dx; parameter POWER_OFF_VAL_NET4='dx; parameter POWER_OFF_VAL_NET5='dx; parameter POWER_OFF_VAL_NET6='dx; parameter POWER_OFF_VAL_NET7='dx; parameter POWER_OFF_VAL_NET8='dx; parameter POWER_OFF_VAL_NET9='dx; parameter POWER_OFF_VAL_NET10='dx; parameter POWER_OFF_VAL_NET11='dx; parameter POWER_OFF_VAL_NET12='dx; input clk ; input reset ; input power_ctrl ; input [WIDTH_1:0] high_fanout_net_1 ; input [WIDTH_2:0] high_fanout_net_2 ; input [WIDTH_3:0] high_fanout_net_3 ; input [WIDTH_4:0] high_fanout_net_4 ; input [WIDTH_5:0] high_fanout_net_5 ; input [WIDTH_6:0] high_fanout_net_6 ; input [WIDTH_7:0] high_fanout_net_7 ; input [WIDTH_8:0] high_fanout_net_8 ; input [WIDTH_9:0] high_fanout_net_9 ; input [WIDTH_10:0] high_fanout_net_10; input [WIDTH_11:0] high_fanout_net_11; input [WIDTH_12:0] high_fanout_net_12; input [WIDTH_ADDR:0] addr ; input rd_enable ; input wr_enable ; input isolation_ctrl ; input save ; input restore ; input [NO_OF_DOMAINS-1:0] power_control_for_all_domains; logic [NO_OF_DOMAINS-1:0] PWR_SIG_STATUS; logic activity_of_ctrl_signals = 0 ; bit isolation_to_power_off_flag ; //////////////////////////////ASSERTIONS/////////////////////////////////////////////////////////////////////////////// //*********RULE 3.6a Clocks, resets and other high fanout nets of off islands must be gated inactive when the island is powered off property check_clk_inactive_power_off; @(clk) (power_ctrl==POWER_ON) ; endproperty clk_inactive_power_off:assert property (check_clk_inactive_power_off) else $error($time,"ASSERTION FAILURE:CLOCK TOGGLING DURING POWER OFF\n"); property check_reset_inactive_during_power_off; @(reset) (power_ctrl==POWER_ON) ; endproperty reset_inactive_during_power_off:assert property (check_reset_inactive_during_power_off) else $error($time,"ASSERTION FAILURE:RESET ACTIVE DURING POWER OFF\n"); property check_high_fanouts_inactive_on_power_off_1; @(high_fanout_net_1,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_1 == POWER_OFF_VAL_NET1) ; endproperty high_fanouts_inactive_on_power_off_1:assert property (check_high_fanouts_inactive_on_power_off_1) else $error($time,"********ASSERTION FAILURE:HIGH FANOUT NET-1 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_2; @(high_fanout_net_2,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_2 == POWER_OFF_VAL_NET2) ; endproperty high_fanouts_inactive_on_power_off_2:assert property (check_high_fanouts_inactive_on_power_off_2) else $error($time,"********ASSERTION FAILURE:HIGH FANOUT NET-2 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_3; @(high_fanout_net_3,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_3 == POWER_OFF_VAL_NET3) ; endproperty high_fanouts_inactive_on_power_off_3:assert property (check_high_fanouts_inactive_on_power_off_3) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-3 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_4; @(high_fanout_net_4,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_4 == POWER_OFF_VAL_NET4) ; endproperty high_fanouts_inactive_on_power_off_4:assert property (check_high_fanouts_inactive_on_power_off_4) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-4 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_5; @(high_fanout_net_5,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_5 == POWER_OFF_VAL_NET5) ; endproperty high_fanouts_inactive_on_power_off_5:assert property (check_high_fanouts_inactive_on_power_off_5) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-5 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_6; @(high_fanout_net_6,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_6 == POWER_OFF_VAL_NET6) ; endproperty high_fanouts_inactive_on_power_off_6:assert property (check_high_fanouts_inactive_on_power_off_6) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-6 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_7; @(high_fanout_net_7,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_7 == POWER_OFF_VAL_NET7) ; endproperty high_fanouts_inactive_on_power_off_7:assert property (check_high_fanouts_inactive_on_power_off_7) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-7 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_8; @(high_fanout_net_8,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_8 == POWER_OFF_VAL_NET8) ; endproperty high_fanouts_inactive_on_power_off_8:assert property (check_high_fanouts_inactive_on_power_off_8) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-8 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_9; @(high_fanout_net_9,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_9 == POWER_OFF_VAL_NET9) ; endproperty high_fanouts_inactive_on_power_off_9:assert property (check_high_fanouts_inactive_on_power_off_9) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-9 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_10; @(high_fanout_net_10,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_10 == POWER_OFF_VAL_NET10) ; endproperty high_fanouts_inactive_on_power_off_10:assert property (check_high_fanouts_inactive_on_power_off_10) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-10 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_11; @(high_fanout_net_11,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_11 == POWER_OFF_VAL_NET11) ; endproperty high_fanouts_inactive_on_power_off_11:assert property (check_high_fanouts_inactive_on_power_off_11) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-11 SHOULD BE INACTIVE DURING POWER OFF********\n"); property check_high_fanouts_inactive_on_power_off_12; @(high_fanout_net_12 ,power_ctrl) (power_ctrl==POWER_OFF) |-> (high_fanout_net_12 == POWER_OFF_VAL_NET12) ; endproperty high_fanouts_inactive_on_power_off_12:assert property (check_high_fanouts_inactive_on_power_off_12) else $error("********ASSERTION FAILURE:HIGH FANOUT NET-12 SHOULD BE INACTIVE DURING POWER OFF********\n"); //*********RULE 6.3A Software addressable registers known to be in on/off islands must have assertions to verify that acc///*//*********ess happens only when they are in ON state property check_software_register_access_during_power_off_1; @(rd_enable,addr) (power_ctrl==POWER_ON) ; endproperty software_register_acess_during_pwr_off_1:assert property (check_software_register_access_during_power_off_1) else $error("********ASSERTION FAILURE:REGISTERS ACCESSED DURING POWER OFF********\n"); property check_software_register_access_during_power_off_2; @(wr_enable,addr) (power_ctrl==POWER_ON) ; endproperty software_register_acess_during_pwr_off_2:assert property (check_software_register_access_during_power_off_2) else $error("********ASSERTION FAILURE:REGISTERS ACCESSED DURING POWER OFF********\n"); //-------------------------EVENT GENERATED ON CHNAGE IN CONTROL SIGNALS always @(power_ctrl, isolation_ctrl, save, restore) begin activity_of_ctrl_signals = ~activity_of_ctrl_signals; end //********General Rules to check that the control signals are not X or Z property check_for_control_signal_val_as_X_Z; @(activity_of_ctrl_signals) not ($isunknown(save) || $isunknown(restore) || $isunknown(isolation_ctrl) || $isunknown(power_ctrl)); endproperty control_signals_values_as_xz :assert property (check_for_control_signal_val_as_X_Z); //------------------------- CHECK FOR POWER OFF DURING ISOLATION//------------------ always @(`ACTIVE_ISO_EDGE isolation_ctrl) begin if(isolation_ctrl==ISO_SENSE) isolation_to_power_off_flag=0; end always @(power_ctrl) begin if(power_ctrl==POWER_OFF) isolation_to_power_off_flag=1; end //*********RULE 3.4a Redundant Isolaion: The island must be powered off at least once during isolation, //*********otherwise the isolation would be redundant and the output of the domain would be unnecessarily freezed //********* to "clamp value". always @(`INACTIVE_ISO_EDGE isolation_ctrl) begin NO_REDUNDANT_ISOLATION: assert ( isolation_to_power_off_flag ) $display("\n******* ASSERTION SUCCESS:APPLIED ISOLATION IS NOT REDUNDANT *******\n"); else $error("\n******* ASSERTION FAILURE:REDUNDANT ISOLATION FOUND *******\n"); end //********RULE 6.9 Guard Against Multiple Rail Changes: If there is power switching activity in more than one domain, //********at the same time, there could be caused rush currents in the design which may lead to a lot of noise on the //********power rails. This assertion checks if such a switching activity is occuring. genvar i; generate for(i=0; i < NO_OF_DOMAINS-1; i++) begin always @(power_control_for_all_domains[i]) begin PWR_SIG_STATUS[i]=1; //i-th power signal altered. end end endgenerate always @(PWR_SIG_STATUS) begin NO_MULTIPLE_RAIL_CHANGES_SIMULTANEOUSLY: assert($onehot(PWR_SIG_STATUS)) $display("\n******* ASSERTION SUCCESS: NO MULTIPLE RAIL CHANGES ON POWER SWITCHING ACTIVITY! *******\t@time:%g\n", $time); else $error("\n******* ASSERTION FAILURE: MULTIPLE RAIL CHANGES! *******\t@time:%g\n", $time); PWR_SIG_STATUS=0; end endmodule