Open ila-embsys opened 3 months ago
Why do we need the last --work=work
? What happen if the top is in other library, not in work?
Why do we need the last --work=work?
I guess yosys will search the -e top
in the last library passed by --work
.
yosys> ghdl --std=08 -fsynopsys --work=work /workspaces/example/top.vhd --work=mylib /workspaces/example/mylib/mypkg.vhd -e top
1. Executing GHDL.
error: cannot find entity or configuration top
What happen if the top is in other library, not in work?
Didn't though about that case, but I checked that the last --work
could be set to a value of library where needed to search the desired top.
For example, in the case where the top in the library with name top
. Like that:
> mylib
> mypkg.vhd
> top
> top.vhd
The command line for yosys could be like that:
yosys> ghdl --std=08 -fsynopsys --work=top /workspaces/example/top.vhd --work=mylib /workspaces/example/mylib/mypkg.vhd --work=top -e top;
Another variant to set the module for top is to name the top with a library prefix, eg top.top
. Like that:
yosys> ghdl --std=08 -fsynopsys --work=top /workspaces/example/top.vhd --work=mylib /workspaces/example/mylib/mypkg.vhd -e top.top;
But this approach for some reason doesn't work if the top module was without a library.
Thank you very much! This PR fixes partially: https://github.com/TerosTechnology/vscode-terosHDL/pull/633
I have pending to pass the toplevel library. So I will maintain this issue open.
Bug description An order of files in a project affects a command line to invoke yosys. The different order is the different result.
To Reproduce Let's assume a project that have a
mylib
library.The project structure will be like that:
If
top.vhd
was added aftermypkg.vhd
, the schematic generation would be fine.If
top.vhd
was added beforemypkg.vhd
, the schematic generation would be producing error:Clue of issue The difference is the first part of the command line that passed to yosys:
ghdl --std=08 -fsynopsys --work=mylib /workspaces/example/mylib/mypkg.vhd /workspaces/example/top.vhd -e top;
vsghdl --std=08 -fsynopsys /workspaces/example/top.vhd --work=mylib /workspaces/example/mylib/mypkg.vhd -e top;
Code that was used to fill the project files
top.vhd
:mypkg.vhd
Environment information
Additional context The issue could be hotfixed by adding explicitly before each project file a related library names like
--work=work
and--work=mylib
and switch back to--work=work
at the end. Like that: