forked from M-Labs/artiq-zynq
refactor write_rustc_cfg_file()
This commit is contained in:
parent
1ccae0d442
commit
b3856e879b
@ -12,11 +12,5 @@ def write_mem_file(soc, filename):
|
|||||||
|
|
||||||
def write_rustc_cfg_file(soc, filename):
|
def write_rustc_cfg_file(soc, filename):
|
||||||
with open(filename, "w") as f:
|
with open(filename, "w") as f:
|
||||||
for name, origin, busword, obj in soc.get_csr_regions():
|
f.write(cpu_interface.get_rust_cfg(
|
||||||
f.write("has_{}\n".format(name.lower()))
|
soc.get_csr_regions(), soc.get_constants()))
|
||||||
for name, value in soc.get_constants():
|
|
||||||
if name.upper().startswith("CONFIG_"):
|
|
||||||
if value is None:
|
|
||||||
f.write("{}\n".format(name.lower()[7:]))
|
|
||||||
else:
|
|
||||||
f.write("{}=\"{}\"\n".format(name.lower()[7:], str(value)))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user