Dear ports@ readers,
Yosys [1] is the second port required by Qflow [2]:
From DESCR:
[... snip ...]
Yosys Open SYnthesis Suite
Yosys is a framework for Verilog RTL synthesis. It currently has
extensive Verilog-2005 support and provides a basic set of synthesis
algorithms for various application domains. Selected features and
typical applications:
- Process almost any synthesizable Verilog-2005 design
- Converting Verilog to BLIF / EDIF/ BTOR / SMT-LIB / simple RTL Verilog
- Built-in formal methods for checking properties and equivalence
- Mapping to ASIC standard cell libraries (in Liberty File Format)
- Mapping to Xilinx 7-Series and Lattice iCE40 FPGAs
- Foundation and/or front-end for custom flows
Yosys can be adapted to perform any synthesis job by combining the
existing passes (algorithms) using synthesis scripts and adding
additional passes as needed by extending the Yosys C++ code base.
[... snip ...]
It requires abc [3] to run (porting still under discussion).
Some highlights follow.
It doesn't compile at all using base-gcc; with base-clang, compile phase
reaches the end, but I see a couple of segmentation faults during
regression tests (should I investigate deeper?). With ports-gcc, it
compiles and runs as expected.
I think we need the line:
FAKE_FLAGS = PREFIX="${LOCALBASE}"
since PREFIX is explicitly set to /usr/local in upstream Makefile when
undefined.
Also, in order to avoid python3 setup errors, I needed to set
CONFIGURE_STYLE = none
Finally, portcheck gives the following message:
Python module without compiled version, consider using ${MODPY_BIN}
${MODPY_LIBDIR}/compileall.py: share/yosys/python3/smtio.py
cad/yosys
I don't know if it's acceptable (and, if not, how to remove it...)
Patches
=======
Makefile requires minimal adjustments:
- PRETTY = 0 for verbose logging during build;
- -ggdb removed;
- compiler name forced to eg++;
- added -lcurses and removed -lrt and -ldl from LDLIBS;
Test suite scripts' shebangs are wrong (#!/bin/bash), but actually they
are all called as arguments of test/tools/autotest.sh, so I patched only
the latter.
Different story for kernel/yosys.cc:
- we need to include sys/wait.h;
- code requires the process executable base path; Linux has
/proc/self/exe and I see that there are solutions for APPLE and WIN32
too; OpenBSD doesn't have a ready-to-use function; this is the closest
thing that comes to my mind:
std::string proc_self_dirname()
{
// No direct way to get the process executable base path
char path[PATH_MAX];
ssize_t buflen = sizeof(path);
char *res = realpath(getenv("_"), path);
if (!res) {
log_error("getenv(\"_\") failed: %s\n",strerror(errno));
}
*(strrchr(path, '/')+1) = '\0';
while (buflen > 0 && path[buflen-1] != '/')
buflen--;
return std::string(path, buflen);
}
If you think that's acceptable, I'll submit the patch upstream.
Dependencies
============
pdflatex is used to compile manual, application notes and presentations
during build; it's part of print/texlive_base, which is a large port;
should we stay with it or do you have alternatives to suggest?
abc is required for both running some yosys' commands and to complete
regression tests.
I would love to switch from bash to sh in all scripts, but this requires
time and I think it would be better to involve the author, so for the
moment I would accept the dependency.
Tarball attached.
[1] http://www.clifford.at/yosys/
[2] https://marc.info/?l=openbsd-ports&m=153270090320035&w=2
[3] https://marc.info/?l=openbsd-ports&m=153270072519966&w=2
--
Alessandro DE LAURENZIS
[mailto:just22@atlantide.t28.net]
Web: http://www.atlantide.t28.net
LinkedIn: http://it.linkedin.com/in/delaurenzis
No comments:
Post a Comment