write_to_file(
os.path.join(generated_dir, "variables.mak"),
"".join(variables_contents))
-
write_to_file(
os.path.join(generated_dir, "output_format.ld"),
cpu_interface.get_linker_output_format(self.soc.cpu))
write_to_file(
os.path.join(generated_dir, "regions.ld"),
cpu_interface.get_linker_regions(memory_regions))
-
write_to_file(
os.path.join(generated_dir, "mem.h"),
cpu_interface.get_mem_header(memory_regions, flash_boot_address, shadow_base))
write_to_file(
os.path.join(generated_dir, "csr.h"),
cpu_interface.get_csr_header(csr_regions, constants))
+ write_to_file(
+ os.path.join(generated_dir, "git.h"),
+ cpu_interface.get_git_header()
+ )
if isinstance(self.soc, soc_sdram.SoCSDRAM):
if hasattr(self.soc, "sdram"):
r += "memory_region,{},0x{:08x},{:d},\n".format(name.lower(), origin, length)
return r
+
+def get_git_header():
+ from litex.build.tools import get_migen_git_revision, get_litex_git_revision
+ r = generated_banner("//")
+ r += "#ifndef __GENERATED_GIT_H\n#define __GENERATED_GIT_H\n\n"
+ r += "#define MIGEN_GIT_SHA1 \"{}\"\n".format(get_migen_git_revision())
+ r += "#define LITEX_GIT_SHA1 \"{}\"\n".format(get_litex_git_revision())
+ r += "#endif\n"
+ return r
#include <generated/csr.h>
#include <generated/mem.h>
+#include <generated/git.h>
#ifdef CSR_ETHMAC_BASE
#include <net/microudp.h>
printf(" BIOS built on "__DATE__" "__TIME__"\n");
crcbios();
printf("\n");
-
+ printf(" Migen git sha1: "MIGEN_GIT_SHA1"\n");
+ printf(" LiteX git sha1: "LITEX_GIT_SHA1"\n");
+ printf("\n");
printf("--============ \e[1mSoC info\e[0m ================--\n");
printf("\e[1mCPU\e[0m: ");
#ifdef __lm32__