-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fusesoc and ghdl fail to build when logical_name is used #707
Comments
I dove into it a bit further. It looks like edalize is the culprit here. The j2 Makefile template misses the workdir variable. $(TOPLEVEL): $(VHDL_SOURCES) work-obj{{ standard }}.cf
$(EDALIZE_LAUNCHER) ghdl -m $(STD) $(ANALYZE_OPTIONS) $(TOPLEVEL_LIBS) $(TOPLEVEL)
I guess by adding "library_options" in the ghdl.py self.render_template function call it can easily be solved. self.render_template(
"Makefile.j2",
"Makefile",
{
"std": " ".join(stdarg),
"toplevel": top_unit,
"vhdl_sources": vhdl_sources,
"standard": standard,
"analyze_options": analyze_options,
"run_options": " ".join(run_options),
"make_libraries_directories": make_libraries_directories,
"ghdlimport": ghdlimport,
"top_libraries": top_libraries,
"library_options":library_options
},
) And to the Makefile template STD = {{ std }}
TOPLEVEL = {{ toplevel }}
TOPLEVEL_LIBS = {{ top_libraries }}
ANALYZE_OPTIONS = {{ analyze_options }}
RUN_OPTIONS = {{ run_options }}
LIBRARY_OPTIONS= {{ library_options }}
VHDL_SOURCES = {{ vhdl_sources }}
all: work-obj{{ standard }}.cf
run: $(TOPLEVEL)
$(EDALIZE_LAUNCHER) ghdl -r $(STD) $(ANALYZE_OPTIONS) $(TOPLEVEL_LIBS) $(TOPLEVEL) $(RUN_OPTIONS) $(EXTRA_OPTIONS)
$(TOPLEVEL): $(VHDL_SOURCES) work-obj{{ standard }}.cf
$(EDALIZE_LAUNCHER) ghdl -m $(STD) $(ANALYZE_OPTIONS) $(TOPLEVEL_LIBS) $(LIBRARY_OPTIONS) $(TOPLEVEL)
$(TOPLEVEL).v: $(VHDL_SOURCES) work-obj{{ standard }}.cf
$(EDALIZE_LAUNCHER) ghdl --synth --out=verilog $(STD) $(ANALYZE_OPTIONS) $(TOPLEVEL_LIBS) $(TOPLEVEL)
make_libraries_directories:
@echo "Creating libraries directories"
{{ make_libraries_directories }}
work-obj{{ standard }}.cf: make_libraries_directories
{{ ghdlimport }}
|
I found a solution. After dabbling around in Edalize and trying to fix the issue I noticed that in the test case for ghdl, test04, a library was prepended to the top-level file. It seems to be an undocumented feature in Edalize or Fusesoc. However it would be great that logical names work for 2 different sets of files in a core file would work.
|
I was making a core file for FuseSoc icm with ghdl for the neorv32.
Since the neorv32 makes use of the library called "neorv32" the core file required a "logical_name: neorv32".
As experiment I placed my test-bench in work cause the neorv32 will be used in a larger design.
ghdl comes back with:
Hereby a recreated bash script from the FuseSoc build flow:
After some experiments I found that the last step was missing the "workdir" switch.
So the the last step should be:
The text was updated successfully, but these errors were encountered: