-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adc changes, csv utility and other changes #30
base: training
Are you sure you want to change the base?
Conversation
@@ -381,21 +392,21 @@ | |||
xbar_rd_pow_dyn = xbar_rd_pow | |||
xbar_wr_pow_dyn = xbar_wr_pow | |||
dac_pow_dyn = dac_pow_dyn_dict [str(cfg.dac_res)] | |||
adc_pow_dyn = adc_pow_dyn_dict [str(cfg.adc_res)] | |||
adc_pow_dyn = 0 #adc_pow_dyn_dict [str(cfg.adc_res)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make adc_pow_dyn
0 here, when the param.adc_pow_dyn
is not used in hw_stats.py
(hw_stats.py
now is directly using entries from param.adc_pow_dyn_dict
) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will access the adc_pow_dyn_dict dictionary based on adc resolution.
param.adc_pow_dyn_dict[str(cfg.adc_res_new[str('matrix_adc_'+str(k))])]
Are you ok with that?
adc_res_new = { | ||
'matrix_adc_0' : 8, | ||
'matrix_adc_1' : 4, | ||
'matrix_adc_1' : 8, | ||
'matrix_adc_2' : 8, | ||
'matrix_adc_3' : 4 | ||
'matrix_adc_3' : 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For lines 49-53, I understand this would only work for configuration with num_matrix=2
. Can you either put this within a new flag (maybe if hetero-adc
), so that the adc_res_new
dictionary is only created when flag==true
, otherwise it just creates an empty adc_res_new
dictionary. This will ensure that if num_matrix>2
, ima.py::init
will just fall back to using old adc_res
for all ADCs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I changed the way that other dictionaries will be access because it will depend on the value of adc_res_new (we can change that for a better name) I think what we could do is is create a new flag as you suggested, hetero-adc, but uses the old adc_res as default value for adc_res_new to avoid change the other dictionaries again. Something like:
hetero-adc = false
if not(hetero-adc):
adc_res_new = {
'matrix_adc_0' : adc_res,
'matrix_adc_1' : adc_res,
'matrix_adc_2' : adc_res,
'matrix_adc_3' : adc_res
}
else:
adc_res_new = {
'matrix_adc_0' : 4,
'matrix_adc_1' : 6
'matrix_adc_2' : 4
'matrix_adc_3' : 6
}
What do you think?
for k in range (cfg.num_adc): | ||
hw_comp_energy['adc_'+str(k)] = param.adc_pow_dyn_dict[str(cfg.adc_res_new[str('matrix_adc_'+str(k))])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can str(cfg.adc_res_new[str('matrix_adc_'+str(k))])
also be put within hetero-adc
flag, so that in cases where num_matrix>2
, this can fall back to cfg.adc_res
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look my suggestion above
for k in range (cfg.num_adc): | ||
area += param.adc_area_dict[str( cfg.adc_res_new[str('matrix_adc_'+str(k))] )] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can str(cfg.adc_res_new[str('matrix_adc_'+str(k))])
also be put within hetero-adc
flag, so that in cases where num_matrix>2
, this can fall back to cfg.adc_res
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look my suggestion above
for k in range (cfg.num_adc): | ||
leak_pow += param.adc_pow_leak_dict[str( cfg.adc_res_new[str('matrix_adc_'+str(k))] )] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look my suggestion above
for k in range (cfg.num_adc): | ||
dyn_pow += param.adc_pow_dyn_dict[str( cfg.adc_res_new[str('matrix_adc_'+str(k))] )] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look my suggestion above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice set of changes and utility! There are two comments I have (which re-occur at few more places).
This branch contains: