Beispiel #1
0
            # Delay Timing and output power(approx)
            cir_file, cir_folder = Simulation_env(arg_var.sp,
                                                  edge_type,
                                                  spice_pins_str,
                                                  spice_card,
                                                  act_pin,
                                                  out_pin,
                                                  clk_pin,
                                                  sim_type='dt_opwr')

            ngspice_lunch(cir_file, cir_folder, arg_var.fs_sim)

            clk_type = 'rising_edge' if edge_type == 1 else 'falling_edge'
            timing_info, power_swt_info = timing.timing_generator(
                cir_folder,
                unate='non_unate',
                related_pin='CLK',
                timing_type=clk_type)

            timing_list.append(timing_info)
            power_swt_list.append(power_swt_info)
            # Input Capacitance
            cir_file, cir_folder = Simulation_env(arg_var.sp,
                                                  edge_type,
                                                  spice_pins_str,
                                                  spice_card,
                                                  act_pin,
                                                  out_pin,
                                                  clk_pin,
                                                  sim_type='input_caps')
            ngspice_lunch(cir_file, cir_folder, arg_var.fs_sim)
Beispiel #2
0
    pin_list = list(cell_dict['pin'].keys())
    input_pins = [
        pin for pin in pin_list
        if cell_dict['pin'][pin]['direction'] == 'INPUT'
    ]
    output_pins = [
        pin for pin in pin_list
        if cell_dict['pin'][pin]['direction'] == 'OUTPUT'
    ]

    for active_pin in input_pins:

        # Launching Timing simulation
        timing_cir_file, timing_folder, pos_unate = Simulation_env(
            pins, card, active_pin, sim_type='timing')
        ngspice_launch(timing_cir_file, timing_folder)
        # Launching Input Capacitance simulation
        caps_cir_file, caps_folder, pos_unate = Simulation_env(
            pins, card, active_pin, sim_type='input_caps')
        ngspice_launch(caps_cir_file, caps_folder)

        undte_value = 'positive_unate' if pos_unate == True else 'negative_unate'
        pin_info = timing.input_pins(caps_folder, active_pin, '1.5')
        pins_list.append(pin_info)
        timing_info, power_swt_info = timing.timing_generator(
            timing_folder, unate=undte_value, related_pin=active_pin)
        timing_list.append(timing_info)
        power_swt_list.append(power_swt_info)

    timing_lib(card, timing_list, power_swt_list, pins_list, cell_dict)
Beispiel #3
0
        direction: "output";
        function: "{logic_func}";
        power_down_function : "(!VPWR + VGND)";
        related_ground_pin : "VGND";
        related_power_pin : "VPWR";
        {timing_txt}  
        }}
    }}    
    """
    with open(lib_file, "w") as file_doc:
        file_doc.write(cell_card)

    print(f'Check:  {lib_file}')


if __name__ == '__main__':
    pins, card = read_spice()
    timing_list = []
    for active_pin in input_pins.split():

        cir_file, working_folder, pos_unate = Simulation_env(
            pins, card, active_pin)
        ngspice_lunch(cir_file, working_folder)
        undte_value = 'positive_unate' if pos_unate == True else 'negative_unate'
        timing_info = timing.timing_generator(working_folder,
                                              unate=undte_value,
                                              related_pin=active_pin)
        timing_list.append(timing_info)

    timing_lib(card, timing_list)