def set_params(self, layer_id=0, config_obj=cfg(), topology_obj=topo(), verbose=True): self.layer_id = layer_id self.config = config_obj self.topo = topology_obj self.op_mat_obj.set_params(layer_id=self.layer_id, config_obj=self.config, topoutil_obj=self.topo, ) self.dataflow = self.config.get_dataflow() if self.dataflow == 'os': self.compute_system = systolic_compute_os() elif self.dataflow == 'ws': self.compute_system = systolic_compute_ws() elif self.dataflow == 'is': self.compute_system = systolic_compute_is() arr_dims =self.config.get_array_dims() self.num_mac_unit = arr_dims[0] * arr_dims[1] self.verbose=verbose self.params_set_flag = True
def __init__(self): self.layer_id = 0 self.topo = topo() self.config = cfg() self.op_mat_obj = opmat() self.compute_system = systolic_compute_os() #self.memory_system = mem_dbsp() self.memory_system = tut2mem() self.verbose = True # Report items : Compute report self.total_cycles = 0 self.stall_cycles = 0 self.num_compute = 0 self.num_mac_unit = 0 self.overall_util = 0 self.mapping_eff = 0 self.compute_util = 0 # Report items : BW report self.avg_ifmap_sram_bw = 0 self.avg_filter_sram_bw = 0 self.avg_ofmap_sram_bw = 0 self.avg_ifmap_dram_bw = 0 self.avg_filter_dram_bw = 0 self.avg_ofmap_dram_bw = 0 # Report items : Detailed Access report self.ifmap_sram_start_cycle = 0 self.ifmap_sram_stop_cycle = 0 self.ifmap_sram_reads = 0 self.filter_sram_start_cycle = 0 self.filter_sram_stop_cycle = 0 self.filter_sram_reads = 0 self.ofmap_sram_start_cycle = 0 self.ofmap_sram_stop_cycle = 0 self.ofmap_sram_writes = 0 self.ifmap_dram_start_cycle = 0 self.ifmap_dram_stop_cycle = 0 self.ifmap_dram_reads = 0 self.filter_dram_start_cycle = 0 self.filter_dram_stop_cycle = 0 self.filter_dram_reads = 0 self.ofmap_dram_start_cycle = 0 self.ofmap_dram_stop_cycle = 0 self.ofmap_dram_writes = 0 self.params_set_flag = False self.memory_system_ready_flag = False self.runs_ready = False self.report_items_ready = False
def __init__(self): self.conf = cfg() self.topo = topo() self.top_path = "./" self.verbose = True self.save_trace = True self.num_layers = 0 self.single_layer_sim_object_list = [] self.params_set_flag = False self.all_layer_run_done = False
def set_params(self, config_obj=cfg(), topo_obj=topo(), top_path="./", verbosity=True, save_trace=True): self.conf = config_obj self.topo = topo_obj self.top_path = top_path self.verbose = verbosity self.save_trace = save_trace # Calculate inferrable parameters here self.num_layers = self.topo.get_num_layers() self.params_set_flag = True