Skip to content

Commit

Permalink
Merge pull request #67 from pulp-platform/lukamac/pr/hotfix-gap9-volt…
Browse files Browse the repository at this point in the history
…age-and-freq

Fix GAP9 voltage and frequency setting, and add instruction cache prefetching
  • Loading branch information
ABurrello authored Nov 9, 2023
2 parents 98a403a + 2cf758b commit 5ef634a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 53 deletions.
2 changes: 2 additions & 0 deletions dory/Hardware_targets/PULP/Common/Templates/main.c.t
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ void application(void * arg) {
int main () {
#ifndef TARGET_CHIP_FAMILY_GAP9
PMU_set_voltage(1000, 0);
#else
pi_pmu_voltage_set(PI_PMU_VOLTAGE_DOMAIN_CHIP, PI_PMU_VOLT_800);
#endif
pi_time_wait_us(10000);
pi_freq_set(PI_FREQ_DOMAIN_FC, ${fc_frequency});
Expand Down
6 changes: 3 additions & 3 deletions dory/Hardware_targets/PULP/GAP9/HW_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"8bits": 32,
"float32": null
},
"core frequency": 50000000,
"accelerator frequency": 50000000,
"peripheral frequency": 50000000,
"core frequency": 370000000,
"accelerator frequency": 370000000,
"peripheral frequency": 370000000,
"HW specific parameters":{
"accelerator core0 stack": 3500,
"accelerator core1-7 stack": 3400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ struct ${prefix}network_run_token ${prefix}network_run_async(void *l2_buffer, si
// First open the cluster
pi_cluster_conf_init(&conf);
conf.id=0;
#ifdef TARGET_CHIP_FAMILY_GAP9
conf.icache_conf = PI_CLUSTER_MASTER_CORE_ICACHE_ENABLE | PI_CLUSTER_ICACHE_PREFETCH_ENABLE | PI_CLUSTER_ICACHE_ENABLE;
#endif
<%
n_args = 4 if l3_supported else 5
%>\
Expand Down
47 changes: 0 additions & 47 deletions dory/Hardware_targets/PULP/GAP9_NE16/HW_description.json

This file was deleted.

1 change: 1 addition & 0 deletions dory/Hardware_targets/PULP/GAP9_NE16/HW_description.json
9 changes: 6 additions & 3 deletions dory/Parsers/Parser_HW_to_C.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ def copy_backend_files(self, node):

def copy_utils_files(self):
print("\nCopying Utils.")
utils_files_dir = os.path.join(os.path.dirname(__file__), '../Hardware_targets', self.HW_description["name"], 'Utils_files')
for file in os.listdir(utils_files_dir):
file_to_copy = os.path.join(utils_files_dir, file)
for file in os.listdir(self.utils_files_dir):
file_to_copy = os.path.join(self.utils_files_dir, file)
if file_to_copy[-1] == 'c':
os.system('cp -L "{}" {}'.format(file_to_copy, self.src_dir))
elif file_to_copy[-1] == 'h':
Expand Down Expand Up @@ -173,6 +172,10 @@ def get_file_path(self):
def tmpl_dir(self):
return os.path.realpath(os.path.join(self.get_file_path(), 'Templates/layer_templates'))

@property
def utils_files_dir(self):
return os.path.realpath(os.path.join(self.get_file_path(), 'Utils_files'))

def full_graph_parsing(self):
print("#####################################################")
print("## DORY GENERAL PARSING FROM DORY HW IR TO C FILES ##")
Expand Down

0 comments on commit 5ef634a

Please sign in to comment.