Skip to content

Error building ghdl plugin for yosys #168

@minghunghw

Description

@minghunghw

First I cannot build ghdl locally, so I use the latest release from fpga-tool-chain.
And I am able to run binary ghdl, but when I try to build ghdl plugin for yosys. It displays the following error.

[kevinchen@instance-5 ghdl-yosys-plugin]$ make
yosys-config --exec --cxx -c --cxxflags -o ghdl.o src/ghdl.cc -fPIC -DYOSYS_ENABLE_GHDL -I/home/kevinchen/fpga-toolchain/include -O -DGHDL_VER_HASH="\"c9b05e4\""
src/ghdl.cc:19:10: fatal error: kernel/yosys.h: No such file or directory
   19 | #include "kernel/yosys.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [ghdl.o] Error 1

Then I try to add include directory for yosys in Makefile manually.
It still companies about xxx was not declared in this scope like this

[kevinchen@instance-5 ghdl-yosys-plugin]$ make
yosys-config --exec --cxx -c --cxxflags -o ghdl.o src/ghdl.cc -fPIC -DYOSYS_ENABLE_GHDL  -I/home/kevinchen/fpga-toolchain/share/yosys/include -I/home/kevinchen/fpga-toolchain/include -O -DGHDL_VER_HASH="\"c9b05e4\""
src/ghdl.cc: In function ‘void add_attributes_from_instance(Yosys::RTLIL::AttrObject&, GhdlSynth::Instance)’:
src/ghdl.cc:385:35: error: ‘get_instance_first_attribute’ was not declared in this scope
  385 |         add_attributes_chain(obj, get_instance_first_attribute (inst));
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ghdl.cc: In function ‘bool has_attribute_gclk(GhdlSynth::Net)’:
src/ghdl.cc:633:26: error: ‘get_instance_first_attribute’ was not declared in this scope
  633 |         Attribute attr = get_instance_first_attribute (inst);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ghdl.cc: In function ‘void import_module(Yosys::RTLIL::Design*, GhdlSynth::Module)’:
src/ghdl.cc:680:53: error: ‘get_input_port_first_attribute’ was not declared in this scope
  680 |                         add_attributes_chain(*wire, get_input_port_first_attribute(m, idx));
      |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ghdl.cc:690:53: error: ‘get_output_port_first_attribute’ was not declared in this scope
  690 |                         add_attributes_chain(*wire, get_output_port_first_attribute(m, idx));
      |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ghdl.cc:713:45: error: ‘get_input_port_first_attribute’ was not declared in this scope
  713 |                 add_attributes_chain(*wire, get_input_port_first_attribute(m, idx));
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ghdl.cc:730:45: error: ‘get_output_port_first_attribute’ was not declared in this scope
  730 |                 add_attributes_chain(*wire, get_output_port_first_attribute(m, idx));
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ghdl.cc:1216:45: error: ‘get_output_port_first_attribute’ was not declared in this scope
 1216 |                 add_attributes_chain(*wire, get_output_port_first_attribute(m, idx));
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ghdl.cc: At global scope:
src/ghdl.cc:372:13: warning: ‘void add_attributes_chain(Yosys::RTLIL::AttrObject&, GhdlSynth::Attribute)’ defined but not used [-Wunused-function]
  372 | static void add_attributes_chain(RTLIL::AttrObject &obj, Attribute attr)
      |             ^~~~~~~~~~~~~~~~~~~~
make: *** [ghdl.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions