Esempio n. 1
0
    def write_measures(self, data_value):
        # meas statement for delay and power measurements
        self.sf.write("* Measure statements for delay and power\n")

        # add measure statments for delay
        trig_name = tech.spice["clk"] + "_buf_buf"
        targ_name = "{0}".format("DATA[{0}]".format(self.probe_data))
        trig_val = targ_val = 0.5 * tech.spice["supply_voltage"]
        trig_dir = self.read_cycle
        targ_dir = "RISE" if data_value == tech.spice[
            "supply_voltage"] else "FALL"
        td = self.cycle_times[self.clear_bus_cycle]
        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="DELAY",
                               trig_name=trig_name,
                               targ_name=targ_name,
                               trig_val=trig_val,
                               targ_val=targ_val,
                               trig_dir=trig_dir,
                               targ_dir=targ_dir,
                               td=td)

        # add measure statements for power
        t_initial = self.cycle_times[self.write_cycle]
        t_final = self.cycle_times[self.write_cycle + 1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="POWER_WRITE",
                               t_initial=t_initial,
                               t_final=t_final)

        t_initial = self.cycle_times[self.read_cycle]
        t_final = self.cycle_times[self.read_cycle + 1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="POWER_READ",
                               t_initial=t_initial,
                               t_final=t_final)
        self.sf.write("\n")
Esempio n. 2
0
    def write_measures(self, period):
        # meas statement for delay and power measurements
        self.sf.write("* Measure statements for delay and power\n")

        trig_name = "clk"
        targ_name = "{0}".format("D[{0}]".format(self.probe_data))
        trig_val = targ_val = 0.5 * self.vdd
        # add measure statments for delay0
        # delay the target to measure after the negetive edge
        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="DELAY0",
                               trig_name=trig_name,
                               targ_name=targ_name,
                               trig_val=trig_val,
                               targ_val=targ_val,
                               trig_dir="FALL",
                               targ_dir="FALL",
                               td=self.cycle_times[self.read0_cycle] +
                               0.5 * period)

        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="DELAY1",
                               trig_name=trig_name,
                               targ_name=targ_name,
                               trig_val=trig_val,
                               targ_val=targ_val,
                               trig_dir="FALL",
                               targ_dir="RISE",
                               td=self.cycle_times[self.read1_cycle] +
                               0.5 * period)

        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="SLEW0",
                               trig_name=targ_name,
                               targ_name=targ_name,
                               trig_val=0.9 * self.vdd,
                               targ_val=0.1 * self.vdd,
                               trig_dir="FALL",
                               targ_dir="FALL",
                               td=self.cycle_times[self.read0_cycle] +
                               0.5 * period)

        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="SLEW1",
                               trig_name=targ_name,
                               targ_name=targ_name,
                               trig_val=0.1 * self.vdd,
                               targ_val=0.9 * self.vdd,
                               trig_dir="RISE",
                               targ_dir="RISE",
                               td=self.cycle_times[self.read1_cycle] +
                               0.5 * period)

        # add measure statements for power
        t_initial = self.cycle_times[self.write0_cycle]
        t_final = self.cycle_times[self.write0_cycle + 1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="WRITE0_POWER",
                               t_initial=t_initial,
                               t_final=t_final)

        t_initial = self.cycle_times[self.write1_cycle]
        t_final = self.cycle_times[self.write1_cycle + 1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="WRITE1_POWER",
                               t_initial=t_initial,
                               t_final=t_final)

        t_initial = self.cycle_times[self.read0_cycle]
        t_final = self.cycle_times[self.read0_cycle + 1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="READ0_POWER",
                               t_initial=t_initial,
                               t_final=t_final)

        t_initial = self.cycle_times[self.read1_cycle]
        t_final = self.cycle_times[self.read1_cycle + 1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="READ1_POWER",
                               t_initial=t_initial,
                               t_final=t_final)
Esempio n. 3
0
    def write_measures(self,period):
        """
        Write the measure statements to quantify the delay and power results.
        """

        self.sf.write("\n* Measure statements for delay and power\n")

        # Output some comments to aid where cycles start and
        # what is happening
        for comment in self.cycle_comments:
            self.sf.write("* {}\n".format(comment))

        # Trigger on the clk of the appropriate cycle
        trig_name = "clk"
        targ_name = "{0}".format("d[{0}]".format(self.probe_data))
        trig_val = targ_val = 0.5 * self.vdd

        # Delay the target to measure after the negative edge
        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="DELAY0",
                               trig_name=trig_name,
                               targ_name=targ_name,
                               trig_val=trig_val,
                               targ_val=targ_val,
                               trig_dir="FALL",
                               targ_dir="FALL",
                               trig_td=self.cycle_times[self.read0_cycle],
                               targ_td=self.cycle_times[self.read0_cycle]+0.5*period)

        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="DELAY1",
                               trig_name=trig_name,
                               targ_name=targ_name,
                               trig_val=trig_val,
                               targ_val=targ_val,
                               trig_dir="FALL",
                               targ_dir="RISE",
                               trig_td=self.cycle_times[self.read1_cycle],
                               targ_td=self.cycle_times[self.read1_cycle]+0.5*period)

        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="SLEW0",
                               trig_name=targ_name,
                               targ_name=targ_name,
                               trig_val=0.9*self.vdd,
                               targ_val=0.1*self.vdd,
                               trig_dir="FALL",
                               targ_dir="FALL",
                               trig_td=self.cycle_times[self.read0_cycle],
                               targ_td=self.cycle_times[self.read0_cycle]+0.5*period)

        stimuli.gen_meas_delay(stim_file=self.sf,
                               meas_name="SLEW1",
                               trig_name=targ_name,
                               targ_name=targ_name,
                               trig_val=0.1*self.vdd,
                               targ_val=0.9*self.vdd,
                               trig_dir="RISE",
                               targ_dir="RISE",
                               trig_td=self.cycle_times[self.read1_cycle],
                               targ_td=self.cycle_times[self.read1_cycle]+0.5*period)
        
        # add measure statements for power
        t_initial = self.cycle_times[self.write0_cycle]
        t_final = self.cycle_times[self.write0_cycle+1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="WRITE0_POWER",
                               t_initial=t_initial,
                               t_final=t_final)

        t_initial = self.cycle_times[self.write1_cycle]
        t_final = self.cycle_times[self.write1_cycle+1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="WRITE1_POWER",
                               t_initial=t_initial,
                               t_final=t_final)
        
        t_initial = self.cycle_times[self.read0_cycle]
        t_final = self.cycle_times[self.read0_cycle+1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="READ0_POWER",
                               t_initial=t_initial,
                               t_final=t_final)

        t_initial = self.cycle_times[self.read1_cycle]
        t_final = self.cycle_times[self.read1_cycle+1]
        stimuli.gen_meas_power(stim_file=self.sf,
                               meas_name="READ1_POWER",
                               t_initial=t_initial,
                               t_final=t_final)