3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-23 02:19:47 +00:00

Update documentation and few more defines

This commit is contained in:
Miodrag Milanovic 2026-05-13 11:24:45 +02:00
parent 25459bd8b9
commit 1ef6311e5b
6 changed files with 7 additions and 7 deletions

View file

@ -87,7 +87,7 @@ not regularly tested:
Build prerequisites Build prerequisites
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
A C++ compiler with C++17 support is required as well as some standard tools A C++ compiler with C++20 support is required as well as some standard tools
such as GNU Flex, GNU Bison (>=3.8), Make, and Python (>=3.11). Some additional such as GNU Flex, GNU Bison (>=3.8), Make, and Python (>=3.11). Some additional
tools: readline, libffi, Tcl and zlib; are optional but enabled by default (see tools: readline, libffi, Tcl and zlib; are optional but enabled by default (see
:makevar:`ENABLE_*` settings in Makefile). Graphviz and Xdot are used by the :makevar:`ENABLE_*` settings in Makefile). Graphviz and Xdot are used by the

View file

@ -286,7 +286,7 @@ have incorrect results in unusual situations.
Coding style Coding style
~~~~~~~~~~~~ ~~~~~~~~~~~~
Yosys is written in C++17. Yosys is written in C++20.
In general Yosys uses ``int`` instead of ``size_t``. To avoid compiler warnings In general Yosys uses ``int`` instead of ``size_t``. To avoid compiler warnings
for implicit type casts, always use ``GetSize(foobar)`` instead of for implicit type casts, always use ``GetSize(foobar)`` instead of

View file

@ -25,7 +25,7 @@ wide range of real-world designs, including the `OpenRISC 1200 CPU`_, the
.. _k68 CPU: http://opencores.org/projects/k68 .. _k68 CPU: http://opencores.org/projects/k68
Yosys is written in C++, targeting C++17 at minimum. This chapter describes some Yosys is written in C++, targeting C++20 at minimum. This chapter describes some
of the fundamental Yosys data structures. For the sake of simplicity the C++ of the fundamental Yosys data structures. For the sake of simplicity the C++
type names used in the Yosys implementation are used in this chapter, even type names used in the Yosys implementation are used in this chapter, even
though the chapter only explains the conceptual idea behind it and can be used though the chapter only explains the conceptual idea behind it and can be used

View file

@ -120,10 +120,10 @@
# define YS_MAYBE_UNUSED # define YS_MAYBE_UNUSED
#endif #endif
#if __cplusplus >= 201703L #if __cplusplus >= 202002L
# define YS_FALLTHROUGH [[fallthrough]]; # define YS_FALLTHROUGH [[fallthrough]];
#else #else
# error "C++17 or later compatible compiler is required" # error "C++20 or later compatible compiler is required"
#endif #endif
#if defined(__has_cpp_attribute) && __has_cpp_attribute(gnu::cold) #if defined(__has_cpp_attribute) && __has_cpp_attribute(gnu::cold)

View file

@ -376,7 +376,7 @@ class PyosysWrapperGenerator(object):
def make_preprocessor_options(self): def make_preprocessor_options(self):
py_include = get_paths()["include"] py_include = get_paths()["include"]
preprocessor_bin = shutil.which("clang++") or "g++" preprocessor_bin = shutil.which("clang++") or "g++"
cxx_std = os.getenv("CXX_STD", "c++17") cxx_std = os.getenv("CXX_STD", "c++20")
return ParserOptions( return ParserOptions(
preprocessor=make_gcc_preprocessor( preprocessor=make_gcc_preprocessor(
defines=["_YOSYS_", "YOSYS_ENABLE_PYTHON"], defines=["_YOSYS_", "YOSYS_ENABLE_PYTHON"],

View file

@ -21,7 +21,7 @@ def yosys(script):
run([base_path / 'yosys', '-Q', '-p', script]) run([base_path / 'yosys', '-Q', '-p', script])
def compile_cpp(in_path, out_path, args): def compile_cpp(in_path, out_path, args):
run(['g++', '-g', '-std=c++17'] + args + [str(in_path), '-o', str(out_path)]) run(['g++', '-g', '-std=c++20'] + args + [str(in_path), '-o', str(out_path)])
def yosys_synth(verilog_file, rtlil_file): def yosys_synth(verilog_file, rtlil_file):
yosys(f"read_verilog {quote(verilog_file)} ; prep ; setundef -undriven -undef ; write_rtlil {quote(rtlil_file)}") yosys(f"read_verilog {quote(verilog_file)} ; prep ; setundef -undriven -undef ; write_rtlil {quote(rtlil_file)}")