def _load(self): ## Get time and date self.date = jwdb.ams_sim_get_creation_date(self.fileid) self.time = jwdb.ams_sim_get_creation_time(self.fileid) ## Load simulation results simnum = 1 simulations = [] loadflag = jwdb.ams_sim_load_simu_with_complex(self.fileid) while loadflag > 0: simulations.append(_Simulation(self.fileid, simnum)) ## Load next simulation results loadflag = jwdb.ams_sim_load_simu_with_complex(self.fileid) simnum += 1 ## Group simulations in analyses simulations.sort(lambda x,y: cmp(x.analysis, y.analysis)) for analysis, members in groupby(simulations, lambda sim: sim.analysis): self.__analyses.append(_Analysis(list(members)))
#import result #class JWDBResultSet(result.ResultSet): # """The JWDBResultSet class handles a JWDB waveform file used by Mentor Graphics software # # """ jwdb.ams_sim_init_file() filename = "./test/data/g3rxifvga1s_tb.wdb" fileid = jwdb.ams_sim_open_read_file(filename) if fileid < 0: raise IOError("Cannot open WDB file %s" % filename) ## Get time and date date = jwdb.ams_sim_get_creation_date(fileid) time = jwdb.ams_sim_get_creation_time(fileid) ## Load first simulation results loadflag = jwdb.ams_sim_load_simu_with_complex(fileid) while loadflag > 0: n = jwdb.ams_sim_get_simulation_parameter_number(fileid) ## Read the simulation parameters (temperature, ...) params = {} for i in range(1, n + 1): tmp, name, val = jwdb.ams_sim_get_simulation_parameter_info(fileid, i) params[name] = val ## Get unit of X axis xunit = jwdb.ams_sim_get_x_unit_name(fileid) print "xunit", xunit
#class JWDBResultSet(result.ResultSet): # """The JWDBResultSet class handles a JWDB waveform file used by Mentor Graphics software # # """ jwdb.ams_sim_init_file() filename = "./test/data/g3rxifvga1s_tb.wdb" fileid = jwdb.ams_sim_open_read_file(filename) if fileid < 0: raise IOError("Cannot open WDB file %s"%filename) ## Get time and date date = jwdb.ams_sim_get_creation_date(fileid) time = jwdb.ams_sim_get_creation_time(fileid) ## Load first simulation results loadflag = jwdb.ams_sim_load_simu_with_complex(fileid) while loadflag > 0: n = jwdb.ams_sim_get_simulation_parameter_number(fileid) ## Read the simulation parameters (temperature, ...) params = {} for i in range(1,n+1): tmp, name, val = jwdb.ams_sim_get_simulation_parameter_info(fileid, i) params[name] = val ## Get unit of X axis xunit = jwdb.ams_sim_get_x_unit_name(fileid) print "xunit", xunit