Skip to content

Commit

Permalink
Merge pull request #35 from deepika7497/training
Browse files Browse the repository at this point in the history
Added condition for manual change in adc resolution
  • Loading branch information
Aayush-Ankit committed Jun 17, 2020
2 parents 942cc37 + 964f96f commit 2351c28
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xbar_record = 1
inference = 1
training = not(inference)
sparse_opt = 1 # Flag for Sparsity optimisaton (Make it 0 for only dense computations)
sparse_opt = 0 # Flag for Sparsity optimisaton (Make it 0 for only dense computations)

## Variable to define the type of MVMU
# One of "Analog", "Digital_V1" or "Digital_V2"
Expand Down
16 changes: 8 additions & 8 deletions src/hw_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
'xbar_wr':param.xbar_wr_pow_dyn*param.xbar_wr_lat,
'dac':param.dac_pow_dyn, 'snh':param.snh_pow_dyn, \
'mux1':param.mux_pow_dyn, 'mux2':param.mux_pow_dyn, \
'adc':{ 'n' : param.adc_pow_dyn_dict[str(cfg.adc_res)], \
'n/2': param.adc_pow_dyn_dict[str(cfg.adc_res-1)], \
'n/4': param.adc_pow_dyn_dict[str(cfg.adc_res-2)], \
'n/8': param.adc_pow_dyn_dict[str(cfg.adc_res-3)], \
'n/16': param.adc_pow_dyn_dict[str(cfg.adc_res-4)], \
'n/32': param.adc_pow_dyn_dict[str(cfg.adc_res-5)], \
'n/64': param.adc_pow_dyn_dict[str(cfg.adc_res-6)], \
'n/128': param.adc_pow_dyn_dict[str(cfg.adc_res-7)]}, \
'adc':{ 'n' : param.adc_pow_dyn_dict[str(cfg.adc_res)] if cfg.adc_res>0 else 0, \
'n/2': param.adc_pow_dyn_dict[str(cfg.adc_res-1)] if cfg.adc_res-1>0 else 0, \
'n/4': param.adc_pow_dyn_dict[str(cfg.adc_res-2)] if cfg.adc_res-2>0 else 0, \
'n/8': param.adc_pow_dyn_dict[str(cfg.adc_res-3)] if cfg.adc_res-3>0 else 0, \
'n/16': param.adc_pow_dyn_dict[str(cfg.adc_res-4)] if cfg.adc_res-4>0 else 0, \
'n/32': param.adc_pow_dyn_dict[str(cfg.adc_res-5)] if cfg.adc_res-5>0 else 0, \
'n/64': param.adc_pow_dyn_dict[str(cfg.adc_res-6)] if cfg.adc_res-6>0 else 0, \
'n/128': param.adc_pow_dyn_dict[str(cfg.adc_res-7)] if cfg.adc_res-7>0 else 0}, \
'alu_div': param.alu_pow_div_dyn, 'alu_mul':param.alu_pow_mul_dyn, \
'alu_act': param.act_pow_dyn, 'alu_other':param.alu_pow_others_dyn, \
'alu_sna': param.sna_pow_dyn, \
Expand Down
2 changes: 1 addition & 1 deletion src/ima_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def propagate_dummy (self, inp, sparsity = 0):
else:
self.num_access['n/128'] += 1
self.adc_res = cfg.adc_res-7
if(self.adc_res<0):
if(self.adc_res<=0):
self.adc_res = 1

return inp
Expand Down

0 comments on commit 2351c28

Please sign in to comment.