Update documentation and few more defines
This commit is contained in:
@@ -87,7 +87,7 @@ not regularly tested:
|
||||
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
|
||||
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
|
||||
|
||||
@@ -286,7 +286,7 @@ have incorrect results in unusual situations.
|
||||
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
|
||||
for implicit type casts, always use ``GetSize(foobar)`` instead of
|
||||
|
||||
@@ -25,7 +25,7 @@ wide range of real-world designs, including the `OpenRISC 1200 CPU`_, the
|
||||
|
||||
.. _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++
|
||||
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
|
||||
|
||||
@@ -120,10 +120,10 @@
|
||||
# define YS_MAYBE_UNUSED
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#if __cplusplus >= 202002L
|
||||
# define YS_FALLTHROUGH [[fallthrough]];
|
||||
#else
|
||||
# error "C++17 or later compatible compiler is required"
|
||||
# error "C++20 or later compatible compiler is required"
|
||||
#endif
|
||||
|
||||
#if defined(__has_cpp_attribute) && __has_cpp_attribute(gnu::cold)
|
||||
|
||||
@@ -376,7 +376,7 @@ class PyosysWrapperGenerator(object):
|
||||
def make_preprocessor_options(self):
|
||||
py_include = get_paths()["include"]
|
||||
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(
|
||||
preprocessor=make_gcc_preprocessor(
|
||||
defines=["_YOSYS_", "YOSYS_ENABLE_PYTHON"],
|
||||
|
||||
@@ -21,7 +21,7 @@ def yosys(script):
|
||||
run([base_path / 'yosys', '-Q', '-p', script])
|
||||
|
||||
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):
|
||||
yosys(f"read_verilog {quote(verilog_file)} ; prep ; setundef -undriven -undef ; write_rtlil {quote(rtlil_file)}")
|
||||
|
||||
Reference in New Issue
Block a user