Skip to content
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

Open
wants to merge 23 commits into
base: training
Choose a base branch
from
Open

Conversation

rodrigojra
Copy link
Contributor

This branch contains:

  • Updated constants values for adc - adc dictionaries;
  • Created a csv utility file to generate part of execution output in a csv file.
  • Updated metrics to use the new approach of adc (adc_res_new) and consequently the correct values from adc's dictionaries based on adc value.

@rodrigojra rodrigojra requested a review from pliniosilveira June 3, 2020 19:01
src/dpe.py Outdated Show resolved Hide resolved
src/hw_stats.py Outdated Show resolved Hide resolved
src/ima.py Outdated Show resolved Hide resolved
src/ima.py Outdated Show resolved Hide resolved
src/ima.py Outdated Show resolved Hide resolved
src/ima.py Outdated Show resolved Hide resolved
src/ima.py Outdated Show resolved Hide resolved
include/config.py Outdated Show resolved Hide resolved
include/config.py Outdated Show resolved Hide resolved
include/config.py Show resolved Hide resolved
@rodrigojra rodrigojra requested a review from pliniosilveira June 4, 2020 13:55
include/config.py Outdated Show resolved Hide resolved
@rodrigojra rodrigojra requested a review from pliniosilveira June 8, 2020 14:04
@rodrigojra rodrigojra marked this pull request as ready for review June 8, 2020 14:17
@rodrigojra rodrigojra self-assigned this Jun 8, 2020
@rodrigojra rodrigojra requested a review from Aayush-Ankit June 8, 2020 14:18
@@ -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)]
Copy link
Owner

@Aayush-Ankit Aayush-Ankit Jun 9, 2020

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) ?

Copy link
Contributor Author

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?

Comment on lines 49 to +53
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
Copy link
Owner

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.

Copy link
Contributor Author

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?

Comment on lines +36 to +37
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))])]
Copy link
Owner

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 ?

Copy link
Contributor Author

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

Comment on lines +19 to +20
for k in range (cfg.num_adc):
area += param.adc_area_dict[str( cfg.adc_res_new[str('matrix_adc_'+str(k))] )]
Copy link
Owner

@Aayush-Ankit Aayush-Ankit Jun 9, 2020

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 ?

Copy link
Contributor Author

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

Comment on lines +47 to +48
for k in range (cfg.num_adc):
leak_pow += param.adc_pow_leak_dict[str( cfg.adc_res_new[str('matrix_adc_'+str(k))] )]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before

Copy link
Contributor Author

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

Comment on lines +70 to +71
for k in range (cfg.num_adc):
dyn_pow += param.adc_pow_dyn_dict[str( cfg.adc_res_new[str('matrix_adc_'+str(k))] )]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before.

Copy link
Contributor Author

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

Copy link
Owner

@Aayush-Ankit Aayush-Ankit left a 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants