mirror of https://github.com/lnis-uofu/SOFA.git
[Script] initial version of setup script
This commit is contained in:
parent
8b5a17457c
commit
3fb8e425a7
|
@ -1,37 +0,0 @@
|
|||
#####################################################################
|
||||
# Python script to adapt an OpenFPGA architecture file
|
||||
# This script will
|
||||
# - Convert the ${SKYWATER_OPENFPGA_HOME} to the absolute path of current directory
|
||||
#
|
||||
#####################################################################
|
||||
|
||||
from os.path import dirname, abspath
|
||||
from shuutil import copyfile
|
||||
|
||||
#####################################################################
|
||||
# Get the absolute path to the SKYWATER_OPENFPGA_HOME
|
||||
#####################################################################
|
||||
skywater_openfpga_homepath = dirname(dirname(abspath(__file__)));
|
||||
|
||||
#####################################################################
|
||||
# Adapt the architecture template:
|
||||
# - Copy the template to the destination folder
|
||||
# - Replace all the ${SKYWATER_OPENFPGA_HOME} with the absolute path
|
||||
#####################################################################
|
||||
skywater_openfpga_arch_dirpath = skywater_openfpga_homepath + "/ARCH";
|
||||
openfpga_arch_template_dirpath = skywater_openfpga_arch_dirpath + "/openfpga_arch_template/";
|
||||
openfpga_arch_adapted_dirpath = skywater_openfpga_arch_dirpath + "/openfpga_arch/";
|
||||
|
||||
for root, dirs, files in os.walk(openfpga_arch_template_dir_path):
|
||||
for src_file in files:
|
||||
# Copy the file
|
||||
des_file = openfpga_arch_adapted_dirpath + os.path.basename(src_file);
|
||||
copyfile(src_file, des_file);
|
||||
cmd = "sed -i 's/${SKYWATER_OPENFPGA_HOME}/" + skywater_openfpga_homepath + "/g' " + des_file;
|
||||
os.system(cmd);
|
||||
|
||||
#####################################################################
|
||||
# Adapt the openfpga task configuration template:
|
||||
# - Copy the template to the destination folder
|
||||
# - Replace all the ${SKYWATER_OPENFPGA_HOME} with the absolute path
|
||||
#####################################################################
|
|
@ -1,37 +0,0 @@
|
|||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||
# Configuration file for running experiments
|
||||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||
# timeout_each_job : FPGA Task script splits fpga flow into multiple jobs
|
||||
# Each job execute fpga_flow script on combination of architecture & benchmark
|
||||
# timeout_each_job is timeout for each job
|
||||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||
|
||||
[GENERAL]
|
||||
run_engine=openfpga_shell
|
||||
power_tech_file = ${PATH:OPENFPGA_PATH}/openfpga_flow/tech/PTM_45nm/45nm.xml
|
||||
power_analysis = true
|
||||
spice_output=false
|
||||
verilog_output=true
|
||||
timeout_each_job = 1*60
|
||||
fpga_flow=yosys_vpr
|
||||
|
||||
[OpenFPGA_SHELL]
|
||||
openfpga_shell_template=${SKYWATER_OPENFPGA_HOME}/SCRIPT/openfpga_shell_script/skywater_generate_fabric_example_script.openfpga
|
||||
openfpga_arch_file=${SKYWATER_OPENFPGA_HOME}/ARCH/openfpga_arch/k4_frac_N8_adder_register_scan_chain_skywater130nm_fdms_cc_openfpga.xml
|
||||
openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/auto_sim_openfpga.xml
|
||||
openfpga_vpr_device_layout=2x2
|
||||
openfpga_vpr_route_chan_width=40
|
||||
openfpga_verilog_output_dir=${SKYWATER_OPENFPGA_HOME}/HDL/k4_FPGA_2x2_fdms_cc
|
||||
openfpga_sdc_output_dir=${SKYWATER_OPENFPGA_HOME}/SDC/k4_FPGA_2x2_fdms_cc
|
||||
|
||||
[ARCHITECTURES]
|
||||
arch0=${SKYWATER_OPENFPGA_HOME}/ARCH/openfpga_flow/vpr_arch/k4_frac_N8_tileable_adder_register_scan_chain_nonLR_skywater130nm.xml
|
||||
|
||||
[BENCHMARKS]
|
||||
bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/and2/and2.v
|
||||
|
||||
[SYNTHESIS_PARAM]
|
||||
bench0_top = and2
|
||||
|
||||
[SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH]
|
||||
#end_flow_with_test=
|
|
@ -1,37 +0,0 @@
|
|||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||
# Configuration file for running experiments
|
||||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||
# timeout_each_job : FPGA Task script splits fpga flow into multiple jobs
|
||||
# Each job execute fpga_flow script on combination of architecture & benchmark
|
||||
# timeout_each_job is timeout for each job
|
||||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||
|
||||
[GENERAL]
|
||||
run_engine=openfpga_shell
|
||||
power_tech_file = ${PATH:OPENFPGA_PATH}/openfpga_flow/tech/PTM_45nm/45nm.xml
|
||||
power_analysis = true
|
||||
spice_output=false
|
||||
verilog_output=true
|
||||
timeout_each_job = 1*60
|
||||
fpga_flow=yosys_vpr
|
||||
|
||||
[OpenFPGA_SHELL]
|
||||
openfpga_shell_template=${SKYWATER_OPENFPGA_HOME}/SCRIPT/openfpga_shell_script/skywater_generate_fabric_example_script.openfpga
|
||||
openfpga_arch_file=${SKYWATER_OPENFPGA_HOME}/ARCH/openfpga_arch/k4_frac_N8_adder_register_scan_chain_skywater130nm_fdms_cc_openfpga.xml
|
||||
openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/auto_sim_openfpga.xml
|
||||
openfpga_vpr_device_layout=2x2
|
||||
openfpga_vpr_route_chan_width=40
|
||||
openfpga_verilog_output_dir=${SKYWATER_OPENFPGA_HOME}/HDL/k4_FPGA_2x2_fdms_cc
|
||||
openfpga_sdc_output_dir=${SKYWATER_OPENFPGA_HOME}/SDC/k4_FPGA_2x2_fdms_cc
|
||||
|
||||
[ARCHITECTURES]
|
||||
arch0=${SKYWATER_OPENFPGA_HOME}/ARCH/openfpga_flow/vpr_arch/k4_frac_N8_tileable_adder_register_scan_chain_nonLR_skywater130nm.xml
|
||||
|
||||
[BENCHMARKS]
|
||||
bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/and2/and2.v
|
||||
|
||||
[SYNTHESIS_PARAM]
|
||||
bench0_top = and2
|
||||
|
||||
[SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH]
|
||||
#end_flow_with_test=
|
|
@ -0,0 +1,79 @@
|
|||
#####################################################################
|
||||
# Python script to adapt an OpenFPGA architecture file
|
||||
# This script will
|
||||
# - Convert the ${SKYWATER_OPENFPGA_HOME} to the absolute path of current directory
|
||||
#
|
||||
#####################################################################
|
||||
|
||||
import os
|
||||
from os.path import dirname, abspath
|
||||
import shutil
|
||||
import re
|
||||
|
||||
#####################################################################
|
||||
# Get the absolute path to the SKYWATER_OPENFPGA_HOME
|
||||
#####################################################################
|
||||
skywater_openfpga_homepath = dirname(dirname(abspath(__file__)));
|
||||
print("\nSet ${SKYWATER_OPENFPGA_HOME} to ", skywater_openfpga_homepath);
|
||||
|
||||
#####################################################################
|
||||
# Adapt the architecture template:
|
||||
# - Copy the template to the destination folder
|
||||
# - Replace all the ${SKYWATER_OPENFPGA_HOME} with the absolute path
|
||||
#####################################################################
|
||||
skywater_openfpga_arch_dirpath = skywater_openfpga_homepath + "/ARCH";
|
||||
openfpga_arch_template_dirpath = skywater_openfpga_arch_dirpath + "/openfpga_arch_template/";
|
||||
openfpga_arch_adapted_dirpath = skywater_openfpga_arch_dirpath + "/openfpga_arch/";
|
||||
|
||||
print("\nAdapting architecture templates...");
|
||||
num_arch_file_processed = 0;
|
||||
for root, dirs, files in os.walk(openfpga_arch_template_dirpath):
|
||||
for src_file in files:
|
||||
# Copy the file
|
||||
des_file = openfpga_arch_adapted_dirpath + os.path.basename(src_file);
|
||||
shutil.copy(openfpga_arch_template_dirpath + src_file, des_file);
|
||||
homepath_to_replace = re.sub("/", "\/", skywater_openfpga_homepath);
|
||||
cmd = "sed -i 's/${SKYWATER_OPENFPGA_HOME}/" + homepath_to_replace + "/g' " + des_file;
|
||||
os.system(cmd);
|
||||
num_arch_file_processed += 1;
|
||||
|
||||
print("Processed for ", num_arch_file_processed, "openfpga architecture templates");
|
||||
|
||||
#####################################################################
|
||||
# A funtion to find all the task_template.conf files
|
||||
# in a recursively, within a given directory
|
||||
#####################################################################
|
||||
def get_list_of_task_config_files(task_dir, task_conf_file_name):
|
||||
subfiles = os.listdir(task_dir);
|
||||
config_files = list()
|
||||
# Iterate over the subdirectory
|
||||
for subfile in subfiles:
|
||||
full_path = os.path.join(task_dir, subfile);
|
||||
if (os.path.isdir(full_path)):
|
||||
config_files = config_files + get_list_of_task_config_files(full_path, task_conf_file_name);
|
||||
elif (subfile == task_conf_file_name):
|
||||
config_files.append(full_path);
|
||||
|
||||
return config_files;
|
||||
|
||||
#####################################################################
|
||||
# Adapt the openfpga task configuration template:
|
||||
# - Copy the template to the destination folder
|
||||
# - Replace all the ${SKYWATER_OPENFPGA_HOME} with the absolute path
|
||||
#####################################################################
|
||||
skywater_openfpga_task_dirpath = skywater_openfpga_homepath + "/SCRIPT/openfpga_task/";
|
||||
|
||||
print("\nAdapting openfpga task configuration...");
|
||||
num_task_config_file_processed = 0;
|
||||
|
||||
for task_template_file in get_list_of_task_config_files(skywater_openfpga_task_dirpath, "task_template.conf"):
|
||||
# Copy the file
|
||||
task_conf_file = os.path.dirname(task_template_file) + "/task.conf";
|
||||
shutil.copy(task_template_file, task_conf_file);
|
||||
homepath_to_replace = re.sub("/", "\/", skywater_openfpga_homepath);
|
||||
cmd = "sed -i 's/${SKYWATER_OPENFPGA_HOME}/" + homepath_to_replace + "/g' " + task_conf_file;
|
||||
os.system(cmd);
|
||||
num_task_config_file_processed += 1;
|
||||
|
||||
print("Processed for ", num_task_config_file_processed, "openfpga task templates");
|
||||
|
Loading…
Reference in New Issue