Commit f4c0344a authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

wb_lm32: remove non synthesizable code when generating lm32_allprofiles.v

parent 47b5fcb2
......@@ -57,6 +57,20 @@ def mangle_names(string, profile_name):
for pattern in LM32_mods:
string = string.replace(pattern, pattern + "_"+profile_name)
return string;
def remove_unsynthetizable(code):
syn_on = True
r=""
for l in code.split("\n"):
if l.lstrip("\t ").startswith("// synthesis translate_off"):
syn_on = False
elif l.lstrip("\t ").startswith("// synthesis translate_on"):
syn_on = True
if syn_on:
r=r+l+"\n"
return r
def gen_customized_version(profile_name, feats):
print("GenCfg ", profile_name);
......@@ -110,7 +124,8 @@ def gen_customized_version(profile_name, feats):
f = open(fname, "r");
contents = f.read();
mangled = mangle_names(contents, profile_name)
ftmp.write(mangled);
code = remove_unsynthetizable(mangled)
ftmp.write(code);
f.close();
ftmp.close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment