Skip to content

Commit

Permalink
Clean up Edalizer API
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Dec 30, 2023
1 parent 11a40e5 commit c4c3112
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions fusesoc/edalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
system_name=None,
resolve_env_vars=False,
):
logger.debug("Building EDA API")
logger.debug("Building EDAM structure")

self.toplevel = toplevel
self.flags = flags
Expand Down Expand Up @@ -102,7 +102,7 @@ def run(self):
# to the list of available cores.
self.run_generators()

# Create EDA API file contents
# Create EDAM file contents
self.create_edam()

return self.edam
Expand Down Expand Up @@ -199,7 +199,7 @@ def create_edam(self):
for core in self.cores:
snippet = {}

logger.debug("Collecting EDA API parameters from {}".format(str(core.name)))
logger.debug("Collecting EDAM parameters from {}".format(str(core.name)))
_flags = self._core_flags(core)

# Extract direct dependencies
Expand Down Expand Up @@ -474,16 +474,16 @@ def _parse_flow_options(self, backend_class, backendargs, edam):

return flow_options

def parse_args(self, backend_class, backendargs, edam):
def parse_args(self, backend_class, backendargs):
# First we need to see which flow options are set,
# in order to know which tool options that are relevant
# for this configuration of the flow
if hasattr(backend_class, "get_flow_options"):
self.activated_flow_options = self._parse_flow_options(
backend_class, backendargs, edam
backend_class, backendargs, self.edam
)

parser = self._build_parser(backend_class, edam)
parser = self._build_parser(backend_class, self.edam)
parsed_args = parser.parse_args(backendargs)

args_dict = {}
Expand Down
8 changes: 4 additions & 4 deletions fusesoc/fusesoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ def get_backend(self, core, flags, backendargs=[]):
)

try:
edam = edalizer.run()
edalizer.parse_args(backend_class, backendargs, edam)
edalizer.run()
edalizer.export()
edalizer.parse_args(backend_class, backendargs)
except SyntaxError as e:
raise RuntimeError(e.msg)
except RuntimeError as e:
Expand All @@ -164,9 +164,9 @@ def get_backend(self, core, flags, backendargs=[]):
else:
old_edam = None

if edam != old_edam:
if edalizer.edam != old_edam:
edalizer.to_yaml(edam_file)

return edam_file, backend_class(
edam=edam, work_root=work_root, verbose=self.config.verbose
edam=edalizer.edam, work_root=work_root, verbose=self.config.verbose
)

0 comments on commit c4c3112

Please sign in to comment.