in

ghdl / ghdl-yosys-plugin, Hacker News

ghdl / ghdl-yosys-plugin, Hacker News
           

        

This is experimental and work in progress!

TODO: explain purpose of program.

  • What is the relationship with GHDL? Is it going to be integrated in GHDL once it is fully featured?
  • What kind of VHDL do we want to support? GHDL fully supports the 2002, 2002, 2008 versions of the IEEE 1987 VHDL standard, and partially the latest Payeer revision, according to the website)
  • Explain expected input and outputs.
  • Create table with features of VHDL that are supported, WIP and pending.

Build as a module (shared library)

$ ./configure –enable-libghdl –enable-synth $ make $ make install

NOTE: GHDL must be built with the latest version of GNAT ( gnat-8 ).

HINT: The default build prefix is ​​ / usr / local . Sudo permission might be required to install tools there.

  • Get and build ghdlsynth-beta:

HINT: If ghdl is not available in the PATH, set GHDL explicitly, eg: make GHDL=/ my / path / to / ghdl .

The output is a shared library (

) ghdl.so on GNU / Linux), which can be used directly:

To install the module, the library must be copied to YOSYS_PREFIX / share / yosys / plugins / ghdl.so , where YOSYS_PREFIX is the installation path of yosys. This can be achieved through a make target:

Alternatively, the shared library can be copied / installed along with ghdl:

Build as part of yosys (not recommended)

yosys. diff .

  • Copy src / to yosys / frontends / ghdl
    . 
  • Configure yosys by adding (to) Makefile.conf :
  • ENABLE_GHDL :=1 GHDL_DIR :=

    • Build and install yosys.

    Example for icestick, using ghdl, yosys, nextpnr and icestorm:

    NOTE: if ghdl is built as a module, set MODULE to ‘-m ghdl’ or ‘ -m path / to / ghdl.so ‘ yosys $ MODULE -p ‘ ghdl leds; synth_ice – json leds.json

  • # P&R nextpnr-ice –package hx1k –pcf leds.pcf –asc leds.asc –json leds.json #

  • Generate bitstream icepack leds.asc leds.bin # Program FPGA iceprog leds.bin

    Alternatively, it is possible to analyze, elaborate and synthesize VHDL sources at once, instead of calling ghdl and yosys in two steps. In this example: yosys $ MODULE -p ‘ghdl leds.vhdl spin1.vhdl -e leds; synth_ice – json leds.json .

    )

    includes yosys, and the ghdl module (shared library). These can be used to synthesize designs straightaway. For example:

    docker run –rm -t   -v

    $ ( pwd ) : / src   -w / src   ghdl / synth: beta   yosys -m ghdl -p

    ‘ ghdl icestick / leds.vhdl icestick / blink.vhdl -e leds ; synth_ice -blif leds.blif ‘