The project, that produce error, contains two source files: tb_1.vhd and tb_2.vhd. Any of them could be set as a top file by pressing 'Select source as toplevel' on 'Sources' panel. That choosing changes the list of 'Dependency tree' and the list of 'Runs' panel. Also, that choosing reflects the '-top' argument value that passing to GHDL inside Yosys:
if Top.Nbr_Top_Entities = 1 then
return Top.First_Top_Entity;
else
return Null_Iir;
end if;
Resolution
By trying to remove one of the tb files from the project 'sources' list, to left only one top file, the error disappears. 🎉
With the ability to choose any top file in the 'sources' list, not obvious that 'Schematic viewer' will not work if top file more then one.
I'm not sure my workflow is correct when I switch project's top file and run different 'Runs', but I tried and failed with 'Schematic Viewer'.
Possible resolve
An empty '-e' argument on the generated command "ghdl --std=08 -fsynopsys a.vhd b.vhd tb_1.vhd tb_2.vhd -e; hierarchy -top tb_1;" could be filled with the same value as for the flag '-top' on "hierarchy -top tb_1;". With that argument passing, that whole generated command works fine even with the multiple top files.
That '-e' probably comes from this line, but I don't know how it should work.
Describing the bug
By pressing the 'Schematic Viewer' button on the 'Dependency Tree' panel, the Schematic Viewer window shows a blank page.
In the same time, the Output page for 'TerosHDL: Global' shows the log like that:
The project, that produce error, contains two source files:
tb_1.vhd
andtb_2.vhd
. Any of them could be set as a top file by pressing 'Select source as toplevel' on 'Sources' panel. That choosing changes the list of 'Dependency tree' and the list of 'Runs' panel. Also, that choosing reflects the '-top' argument value that passing to GHDL inside Yosys:However, the command still produces error.
Investigating
To find where the error comes from, that generated command could be passed to Yosys CLI directly.
Run Yosys:
yosys -m ghdl
Then execute first part of generated command:
yosys> ghdl --std=08 -fsynopsys a.vhd b.vhd tb_1.vhd tb_2.vhd -e;
The error exactly here:
GHDL internals
This error message
no top unit found
probably comes from here.That
Find_Top_Entity
function, probably, here.One of the conditions that the function could return nothing is top level files more than one:
Resolution
By trying to remove one of the
tb
files from the project 'sources' list, to left only one top file, the error disappears. 🎉 With the ability to choose any top file in the 'sources' list, not obvious that 'Schematic viewer' will not work if top file more then one.I'm not sure my workflow is correct when I switch project's top file and run different 'Runs', but I tried and failed with 'Schematic Viewer'.
Possible resolve
An empty '-e' argument on the generated command "ghdl --std=08 -fsynopsys a.vhd b.vhd tb_1.vhd tb_2.vhd -e; hierarchy -top tb_1;" could be filled with the same value as for the flag '-top' on "hierarchy -top tb_1;". With that argument passing, that whole generated command works fine even with the multiple top files.
That '-e' probably comes from this line, but I don't know how it should work.
Environment information: