Skip to content

Commit

Permalink
Enhance software build performance by utilizing all available CPU cor…
Browse files Browse the repository at this point in the history
…es in the builder
  • Loading branch information
Long Pham committed Nov 6, 2024
1 parent 1204cfd commit d8e168a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions litex/soc/integration/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,16 @@ def _prepare_rom_software(self):

def _generate_rom_software(self, compile_bios=True):
# Compile all software packages.
for name, src_dir in self.software_packages:

cpu_count = os.cpu_count()
for name, src_dir in self.software_packages:
# Skip BIOS compilation when disabled.
if name == "bios" and not compile_bios:
continue
# Compile software package.
dst_dir = os.path.join(self.software_dir, name)
makefile = os.path.join(src_dir, "Makefile")
if self.compile_software:
subprocess.check_call(["make", "-C", dst_dir, "-f", makefile])
subprocess.check_call(["make", f"-j{cpu_count}", "-C", dst_dir, "-f", makefile])

def _initialize_rom_software(self):
# Get BIOS data from compiled BIOS binary.
Expand Down

0 comments on commit d8e168a

Please sign in to comment.