diff --git a/litex/soc/integration/export.py b/litex/soc/integration/export.py index e9d0e9167..a6d1ffdb7 100644 --- a/litex/soc/integration/export.py +++ b/litex/soc/integration/export.py @@ -278,7 +278,9 @@ def _generate_csr_header_includes_c(with_access_functions): """ Generate the necessary include directives for the CSR header file. """ - includes = "#include \n" + includes = "" + if with_access_functions: + includes += "#include \n" includes += "#ifndef __GENERATED_CSR_H\n" includes += "#define __GENERATED_CSR_H\n" if with_access_functions: