ghdl / docker

Scripts to build and use docker images including GHDL
40 stars 10 forks source link

ECP5 components #28

Closed mikey closed 3 years ago

mikey commented 4 years ago

@eine I'm trying to add an ECP5 PLL to microwatt and looking at https://github.com/ghdl/ghdl-yosys-plugin/blob/master/examples/ecp5_versa/Makefile it seems I need components.vhdl from there to be able to pull in EHXPLLL().

I don't see components.vhdl in any of the docker images. Can we add that or am I going about this with wrong way?

eine commented 4 years ago

Hi @mikey! I'm pinging @tgingold and @hackfin, who are the ones that have used components.vhdl.

AFAIU, those are used to instantiate vendor primitives for ECP5 devices, is it correct? Is so, since it is a single file and for an specific device only, I'm not sure about adding it to the synth/yosys image yet. Well, my main concern is that I don't know where to add it. Currently, ghdl and yosys are installed in /usr/local/bin, and the plugin is installed in the default location for plugins in yosys' tree. If we are going to add components.vhdl to GHDL's installation, we might consider moving it to https://github.com/ghdl/ghdl/tree/master/libraries and distributing it along with other libraries. BTW, is components.vhdl required for ghdl --synth? Otherwise, which location do you suggest?

hackfin commented 4 years ago

The file location is library/ecp5u/components.vhdl and is just a re-emitted (from the lattice proprietary) components stub declaration for all the architecture specific blackboxes. Since vendor specific, it should rather be in a vendor library add-on that is tested against nextpnr (to which it is linked more closely, due to the nature of the late blackbox binding). So in my opinion it shouldn't go into the GHDL distribution. Note also that only a few of those components are continously tested. Since there's a lot of deficiencies on either the Verilog or VHDL side of things (missing simulation models, see also https://github.com/YosysHQ/yosys/issues/1358), I've taken it up to the higher level Python/MyHDL-jupyosys domain to be able to emit a 'whiteboxed' functional model at least for the V* HDLs. Again, this co-simulating/verifying/auto-testing (also for hardware-implementation) is more yosys/nextpnr specific.

eine commented 4 years ago

@hackfin, thanks for clarifying! Maybe it's time to create the repo for "examples" proposed in ghdl/ghdl-yosys-plugin#98 and discussed in ghdl/ghdl#1291. See also May 2, 2020 11:35 AM.

eine commented 4 years ago

Refs:

eine commented 3 years ago

Discussion moved to hdl/containers#18.