diff --git a/rtl/configs/.gitignore b/rtl/configs/.gitignore index 47341ffa..d628dca5 100644 --- a/rtl/configs/.gitignore +++ b/rtl/configs/.gitignore @@ -1 +1,2 @@ -*.v \ No newline at end of file +*.v +*.sh diff --git a/rtl/gen_synth_configs.py b/rtl/gen_synth_configs.py index a0653150..56d8b528 100755 --- a/rtl/gen_synth_configs.py +++ b/rtl/gen_synth_configs.py @@ -4,25 +4,22 @@ import glob config_location = 'configs' -name_template = '{clusters}cl-{cores}c-{warps}w-{threads}t-{l2}Kl2-{dcache}Kd-{icache}Ki{name_suffix}.v' +name_template = '{clusters}cl-{cores}c-{warps}w-{threads}t-{l2}Kl2-{dcache}Kd-{icache}Ki{name_suffix}.sh' template = """ -`ifndef VX_DEFINE_SYNTH -`define VX_DEFINE_SYNTH -`define NT {threads} -`define NW {warps} -`define NUMBER_CORES_PER_CLUSTER {cores} -`define NUMBER_CLUSTERS {clusters} -`define DCACHE_SIZE_BYTES {dcachek} -`define ICACHE_SIZE_BYTES {icachek} +export V_NT={threads} +export V_NW={warps} +export V_NUMBER_CORES_PER_CLUSTER={cores} +export V_NUMBER_CLUSTERS={clusters} +export V_DCACHE_SIZE_BYTES={dcachek} +export V_ICACHE_SIZE_BYTES={icachek} -// L2 Cache size -`define LLCACHE_SIZE_BYTES {l2k} +# L2 Cache size +export V_LLCACHE_SIZE_BYTES={l2k} {codegen} -`endif """ # cluster, cores, warps, threads, l2, dcache, icache @@ -39,23 +36,13 @@ configs = [ (2, 4, 8, 8, 16, 8, 1), ] -files = glob.glob(config_location + '/*') +files = glob.glob(config_location + '/*.sh') for f in files: os.remove(f) for clusters, cores, warps, threads, l2, dcache, icache in configs: l2k, dcachek, icachek = 1024 * l2, 1024 * dcache, 1024 * icache - for force_mlab in [False]: - name_suffix = '' - if force_mlab: - name_suffix += '-mlab' - with open(config_location + '/' + name_template.format(**locals()), 'w') as f: - codegen = '' - if force_mlab: - codegen += '\n`define QUEUE_FORCE_MLAB 1' - else: - codegen += '\n// `define QUEUE_FORCE_MLAB 1' - - codegen += '\n\n// Use l3 cache (required for cluster behavior)' - - f.write(template.format(**locals())) + name_suffix = '' + with open(config_location + '/' + name_template.format(**locals()), 'w') as f: + codegen = '' + f.write(template.format(**locals()))