integer i;

initial begin
   #100_000;
   sel_in_reg =1'b1;
   vddi2c_detect = 1'b1;   
   #100_000;
      
   $display("\n\n#################################################################");
   $display("                        MEMMAP - TEST NOK");
   $display("#################################################################");
   
   $display("\n VIN plug @ 7V");
   $display("// ----------------------------------------------------------------");
   vcore_vin_uvlo.vin_lvl(7000);   

   @(posedge cp_pass_thru);
   $display("\n enter PT");    
   
   $display("\nDe-activate ADC auto conv");
   $display("---------------------------------------------------\n");
   i2c_adc_manual_fld = 1'b1;
   i2c_write_fields(`CMD3);
   #1_000;   
     
   $display("\nTEST_REGISTER0 (TEST_STATUS)");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER0,8'hff );
      i2c_read_fields(`TEST_REGISTER0,8'hf8);
      #100;
      check_digital_net_id("fast_clk",fast_clk,0);
      check_digital_net_id("force_uvlob",force_uvlob,0);
      #100;
   
   $display("\nTEST_REGISTER1");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER1,8'hff);
      i2c_read_fields(`TEST_REGISTER1,8'hff);
      #100;
      check_digital_net_id("tb_no_ldo_ishort",tb_no_ldo_ishort,1'b0);
      #100;
   
   $display("\nTEST_REGISTER2");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER2,8'hff);
      i2c_read_fields(`TEST_REGISTER2,8'hff);
      #100;
      check_digital_net_id("tb_refs",tb_refs,0);
      check_digital_net_id("force_vref_startup",force_vref_startup,0);
      #100;
      
   $display("\nTEST_REGISTER3");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER3,8'hff);
      i2c_read_fields(`TEST_REGISTER3,8'hff);
      #100;
      check_digital_net_id("adc_signed_conv",adc_signed_conv,1);
      check_digital_net_id("adc_channel_mux_ctrl",adc_channel_mux_ctrl,0);
      check_digital_net_id("adc_az_dis",adc_az_dis,0);
      check_digital_net_id("adc_ext_vref",adc_ext_vref,0);
      #100;
      
   $display("\nTEST_REGISTER4");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER4,8'hff);
      i2c_read_fields(`TEST_REGISTER4,8'hff);
      #100;
      
   $display("\nTEST_REGISTER5");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER5,8'hff);
      i2c_read_fields(`TEST_REGISTER5,8'hff);
      #100;
      check_digital_net_id("adc_hold_delay",adc_hold_delay,4);
      check_digital_net_id("en_fuse_bypass",en_fuse_bypass,0);
      check_digital_net_id("tb_en_fuse_curr_sink",tb_en_fuse_curr_sink,0);
      #100;
     
   $display("\nTEST_REGISTER6 (ANALOG_MUX)");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER6,8'hff);
      i2c_read_fields(`TEST_REGISTER6,8'hff);
      #100;
      check_digital_net_id("en_test_mux1",en_test_mux1,0);
      check_digital_net_id("test_mux1_ctrl[2:0]",test_mux1_ctrl,0);
      check_digital_net_id("en_test_mux2",en_test_mux2,0);
      check_digital_net_id("test_mux2_ctrl[2:0]",test_mux2_ctrl,0);
      #100;
   
   $display("\nTEST_REGISTER7");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER7,8'hff);
      i2c_read_fields(`TEST_REGISTER7,8'hff);
      #100;
   
   $display("\nTEST_REGISTER8");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER8,8'hff);
      i2c_read_fields(`TEST_REGISTER8,8'hff);
      #100;

   $display("\nTEST_REGISTER9");
   $display("---------------------------------------------------\n");
      i2c_master.i2cWr(`TEST_REGISTER9,8'hff);
      i2c_read_fields(`TEST_REGISTER9,8'hff);
      #100;           

   END_SIM;
   
end
