initial begin
   #10_000;

   $display("\n Slave");
   $display("---------------------------------------------------\n");

           
$display("\n\n\n// ----------------------------------------------------------------");
$display("// LATCH_OTP, CLO_DET");
$display("// ----------------------------------------------------------------  ");
   $display("\n VIN plug @ 4V");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.VIN_SLEW=15;   
   vcore_vin_uvlo.vin_lvl(4000);   
 
   @(posedge slave.en_vreg);
   #10;
   $display("\n tsd event in latch: no effect");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 155;
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        0);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,0);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);
   
   check_digital_net_id("en_cp",          slave.en_cp,         0);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);


   $display("\n clo_det");
   $display("---------------------------------------------------\n");
   @(posedge slave.en_clo_det);
   #10;
   
   $display("\n tsd event clo_det: no effect");
   $display("---------------------------------------------------\n");
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        0);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);
   
   check_digital_net_id("en_cp",          slave.en_cp,         0);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
   $display("\n tsd removed");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 100;      
     
$display("\n\n\n// ----------------------------------------------------------------");
$display("// TSD in PRECHARGE");
$display("// ----------------------------------------------------------------  ");
   @(posedge slave.cp_en_pmos);
   #10;
   $display("\n precharge");
   $display("---------------------------------------------------\n");
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);
   
   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    1);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
   $display("\n VIN dip");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(3590);  
   #10_000;  
   vcore_vin_uvlo.vin_lvl(4000);  
   
   $display("\n tsd event ");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 155;
   #35_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n full flow to UVLO ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.VIN_SLEW=400;   
   
   @(posedge cp_pass_thru);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n tsd removed ");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 100;
   
   $display("\n Vin set to 12V ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(12000);  
   
   @(posedge cp_wait);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   @(posedge cp_div2);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       1);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n Vin set to 3V ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(3000);  
   
   @(posedge cp_pass_thru);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   @(negedge cp_en_pmos);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       0);
   check_digital_net_id("en_refs",        slave.en_refs,       0);
   check_digital_net_id("en_tsd",         slave.en_tsd,        0);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,0);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  0);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         0);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
    







$display("\n\n\n// ----------------------------------------------------------------");
$display("// TSD in PT");
$display("// ----------------------------------------------------------------  ");
   $display("\n VIN plug @ 4V");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(4000);   
 
   $display("\n pass thru");
   $display("---------------------------------------------------\n");
   @(posedge cp_pass_thru);
   #10_000;  
   
   $display("\n tsd event");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 155;
   #35_000;  

   
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n tsd removed");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 100;
   #35_000;
     
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   

   $display("\n full flow to UVLO ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.VIN_SLEW=400;   
   
   $display("\n Vin set to 12V ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(12000);  
   
   @(posedge cp_wait);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   @(posedge cp_div2);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       1);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n Vin set to 3V ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(3000);  
   
   @(posedge cp_pass_thru);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   @(negedge cp_en_pmos);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       0);
   check_digital_net_id("en_refs",        slave.en_refs,       0);
   check_digital_net_id("en_tsd",         slave.en_tsd,        0);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,0);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  0);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         0);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
   
   
   
   
   
   
$display("\n\n\n// ----------------------------------------------------------------");
$display("// TSD in WAIT");
$display("// ---------------------------------------------------------------- "); 
   $display("\n VIN plug @ 12V");
   $display("---------------------------------------------------\n");   
   vcore_vin_uvlo.vin_lvl(12000);  
   
   $display("\n wait");
   $display("---------------------------------------------------\n");
   @(posedge cp_wait);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       1);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
   $display("\n tsd event");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 155;
   #35_000;  

   
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   

   $display("\n full flow to UVLO ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.VIN_SLEW=400;   
   
   @(posedge cp_div2);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       1);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n tsd removed");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 100;
   #35_000;
     
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       1);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n Vin set to 3V ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(3000);  
   
   @(posedge cp_pass_thru);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   @(negedge cp_en_pmos);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       0);
   check_digital_net_id("en_refs",        slave.en_refs,       0);
   check_digital_net_id("en_tsd",         slave.en_tsd,        0);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,0);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  0);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         0);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
    

    
$display("\n\n\n// ----------------------------------------------------------------");
$display("// TSD in DIV2");
$display("// ---------------------------------------------------------------- "); 
   $display("\n VIN plug @ 12V");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(12000);  
   
   $display("\n div2");
   $display("---------------------------------------------------\n");
   @(posedge cp_div2);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       1);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
   $display("\n tsd event");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 155;
   #35_000;
     
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       1);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n tsd removed");
   $display("---------------------------------------------------\n");
   therm_comp_slave.temperature = 100;
   #35_000;
     
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       1);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   $display("\n Vin set to 3V ");
   $display("---------------------------------------------------\n");
   vcore_vin_uvlo.vin_lvl(3000);  
   
   @(posedge cp_pass_thru);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       1);
   check_digital_net_id("en_refs",        slave.en_refs,       1);
   check_digital_net_id("en_tsd",         slave.en_tsd,        1);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,1);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  1);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         1);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        1);
   
   @(negedge cp_en_pmos);
   #10_000;  
   check_digital_net_id("en_vreg",        slave.en_vreg,       0);
   check_digital_net_id("en_refs",        slave.en_refs,       0);
   check_digital_net_id("en_tsd",         slave.en_tsd,        0);
   check_digital_net_id("en_vin_monitor", slave.en_vin_monitor,0);
   check_digital_net_id("en_clk_12Mhz",   slave.en_clk_12Mhz,  0);
   check_digital_net_id("en_vldo",        slave.en_vldo,       0);

   check_digital_net_id("en_cp",          slave.en_cp,         0);
   check_digital_net_id("cp_en_pmos",     slave.cp_en_pmos,    0);
   check_digital_net_id("cp_pass_thru",   slave.cp_pass_thru,  0);
   check_digital_net_id("cp_wait",        slave.cp_wait,       0);
   check_digital_net_id("cp_div2",        slave.cp_div2,       0);
   check_digital_net_id("cp_tsd",         slave.cp_tsd,        0);
   
    

    
   // End
   // ----------------------------------------------------------------
   repeat (1) #100_000;
   END_SIM;
   
end
