### Setup py with Pybind11Extension Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/compiling.rst Example of a setup.py file using pybind11's Pybind11Extension to build C++ extensions. It sorts source files for reproducibility. This requires pybind11 to be installed. ```python from glob import glob from setuptools import setup from pybind11.setup_helpers import Pybind11Extension ext_modules = [ Pybind11Extension( "python_example", sorted(glob("src/*.cpp")), # Sort source files for reproducibility ), ] setup(..., ext_modules=ext_modules) ``` -------------------------------- ### C++ Header and Namespace Setup for pybind11 Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/basics.rst This C++ code snippet includes the necessary pybind11 header and sets up a namespace alias for brevity. These lines are assumed to be present in all pybind11 code examples for standard setup. ```cpp #include namespace py = pybind11; ``` -------------------------------- ### Install nextpnr-machxo2 and Dependencies from Source Source: https://github.com/yosyshq/nextpnr/blob/master/machxo2/README.md Guides the installation of the nextpnr-machxo2 project and its core dependencies (prjtrellis, Yosys, TinyFPGA-A-Programmer) from their respective Git repositories. It involves checking out specific branches, compiling libraries, and configuring the build process. ```bash git clone git@github.com:cr1901/prjtrellis.git cd prjtrellis git checkout facade git submodule update --init --recursive cd libtrelliscmake -DCMAKE_INSTALL_PREFIX=/usr make -j 8 sudo make install cd ../../ git clone git@github.com:cr1901/yosys.git cd yosys/ git checkout machxo2 make config-gcc make sudo make install cd ../ git clone git@github.com:tinyfpga/TinyFPGA-A-Programmer.git cd TinyFPGA-A-Programmer/ sudo python setup.py install cd ../ git clone git@github.com:cr1901/nextpnr.git cd nextpnr git checkout machxo2 git submodule update --init --recursive cmake . -DARCH=machxo2 -DBUILD_GUI=OFF -DTRELLIS_INSTALL_PREFIX=/usr -DBUILD_PYTHON=OFF make ``` -------------------------------- ### Install pybind11 using vcpkg Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/installing.rst Installs pybind11 using the vcpkg dependency manager. This process involves cloning vcpkg, bootstrapping it, integrating it with your system, and then installing pybind11. This method is particularly useful in Windows environments. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install vcpkg install pybind11 ``` -------------------------------- ### Build Allegro 5 Example on Windows with 32-bit ImGui Indices (Visual Studio CLI) Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_allegro5/README.md This command builds the Allegro 5 example on Windows using the Visual Studio command-line interface. It sets the `ALLEGRODIR` environment variable, defines `IMGUI_USER_CONFIG` for 32-bit indices, specifies include and library paths, lists source files, and links against the Allegro monolith library. Debug symbols are included with `/Zi`. ```batch set ALLEGRODIR=path_to_your_allegro5_folder cl /Zi /MD /I %ALLEGRODIR%\include /DIMGUI_USER_CONFIG="examples/example_allegro5/imconfig_allegro5.h" /I .. /I ..\.. main.cpp ..\imgui_impl_allegro5.cpp ..\..\imgui*.cpp /link /LIBPATH:%ALLEGRODIR%\lib allegro-5.0.10-monolith-md.lib user32.lib ``` -------------------------------- ### Build Allegro 5 Example on Ubuntu with 32-bit ImGui Indices Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_allegro5/README.md This command compiles the Allegro 5 example for nextpnr on Ubuntu. It defines `IMGUI_USER_CONFIG` to use the `imconfig_allegro5.h` header for 32-bit indices, specifies include paths, lists source files, and links against the Allegro library. The output executable is named `allegro5_example`. ```bash g++ -DIMGUI_USER_CONFIG="examples/example_allegro5/imconfig_allegro5.h" -I .. -I ../.. main.cpp ..\imgui_impl_allegro5.cpp ../../imgui*.cpp -lallegro -lallegro_primitives -o allegro5_example ``` -------------------------------- ### Install Prerequisites for nextpnr-machxo2 (Debian/Ubuntu) Source: https://github.com/yosyshq/nextpnr/blob/master/machxo2/README.md Installs essential development tools and libraries required for compiling nextpnr-machxo2 and its dependencies on Debian-based systems. This includes build tools, Qt, Eigen, and Python development packages. ```bash sudo apt install cmake clang-format libboost-all-dev build-essential qt6-base-dev libeigen3-dev build-essential clang bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev python3-setuptools python3-serial ``` -------------------------------- ### CMake: Define Himbaechel Microarchitecture and Example Devices Source: https://github.com/yosyshq/nextpnr/blob/master/himbaechel/uarch/example/CMakeLists.txt This snippet defines the source files for the Himbaechel microarchitecture and sets up support for example devices. It uses CMake variables to manage sources and caches user input for enabled example devices, printing a status message upon configuration. ```cmake set( SOURCES constids.inc example.cc gfxids.inc ) add_nextpnr_himbaechel_microarchitecture(${uarch} CORE_SOURCES ${SOURCES} ) set(ALL_HIMBAECHEL_EXAMPLE_DEVICES example) set(HIMBAECHEL_EXAMPLE_DEVICES ${ALL_HIMBAECHEL_EXAMPLE_DEVICES} CACHE STRING "Include support for these Example devices (available: ${ALL_HIMBAECHEL_EXAMPLE_DEVICES})") message(STATUS "Enabled Himbaechel-Example devices: ${HIMBAECHEL_EXAMPLE_DEVICES}") ``` -------------------------------- ### Install pybind11 using Pip from PyPI Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/installing.rst Installs pybind11 as a Python package using pip. This is a straightforward method for incorporating pybind11 into your Python environment or project. The '[global]' option installs pybind11 system-wide, which is generally recommended only for virtual environments. ```bash pip install pybind11 ``` ```bash pip install "pybind11[global]" ``` -------------------------------- ### CMake Mock Install Target Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/tests/test_cmake_build/CMakeLists.txt Creates a mock installation target for pybind11. This target is used when testing the installation process of Python modules. It invokes the CMake install command with a specific installation prefix, simulating an actual install to a temporary directory. ```cmake add_custom_target( mock_install ${CMAKE_COMMAND} "-DCMAKE_INSTALL_PREFIX=${pybind11_BINARY_DIR}/mock_install" -P "${pybind11_BINARY_DIR}/cmake_install.cmake") ``` -------------------------------- ### Build nextpnr on Windows with Visual Studio CLI Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_sdl_opengl3/README.md Compiles the nextpnr project on Windows using the Visual Studio command-line compiler (cl.exe). Requires SDL2 to be installed and its path configured. Links against SDL2, OpenGL, and other necessary libraries. ```batch set SDL2DIR=path_to_your_sdl2_folder cl /Zi /MD /I .. /I ..\.. /I ..\libs\gl3w /I %SDL2DIR%\include main.cpp ..\imgui_impl_sdl.cpp ..\imgui_impl_opengl3.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /link /libpath:%SDL2DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console ``` -------------------------------- ### pybind11: Python Setuptools pyproject.toml Example Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/changelog.rst Removes the upper bound in the example `pyproject.toml` for setuptools. This allows for greater flexibility in choosing setuptools versions when building Python packages with pybind11. ```toml [tool.setuptools] # Upper bound removed from version specification ``` -------------------------------- ### Build nextpnr-ice40 on Linux Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Builds the nextpnr-ice40 tool for iCE40 FPGAs. Requires Project IceStorm to be installed. Uses CMake for configuration and Make for building. ```shell mkdir -p build && cd build cmake .. -DARCH=ice40 make -j$(nproc) sudo make install ``` -------------------------------- ### CMake: Generate and Compile Chip Databases for Himbaechel Example Devices Source: https://github.com/yosyshq/nextpnr/blob/master/himbaechel/uarch/example/CMakeLists.txt This snippet iterates through enabled Himbaechel example devices, generating chip databases using a Python script and then compiling them into binary format. It includes error checking for unsupported devices and defines BBA production and compilation commands within CMake. ```cmake foreach (device ${HIMBAECHEL_EXAMPLE_DEVICES}) if (NOT device IN_LIST ALL_HIMBAECHEL_EXAMPLE_DEVICES) message(FATAL_ERROR "Device ${device} is not a supported Example device") endif() add_bba_produce_command( TARGET nextpnr-himbaechel-example-bba COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_arch_gen.py ${CMAKE_CURRENT_BINARY_DIR}/chipdb-${device}.bba.new OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chipdb-${device}.bba INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/example_arch_gen.py ${CMAKE_CURRENT_SOURCE_DIR}/constids.inc ${CMAKE_CURRENT_SOURCE_DIR}/gfxids.inc ) add_bba_compile_command( TARGET nextpnr-himbaechel-example-chipdb OUTPUT himbaechel/example/chipdb-${device}.bin INPUT ${CMAKE_CURRENT_BINARY_DIR}/chipdb-${device}.bba MODE binary ) endforeach() ``` -------------------------------- ### Refactor Example Backends: Platform and Renderer Separation Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/docs/CHANGELOG.txt Refactoring of example backends to separate platform-specific code (input, cursor, timing) from renderer-specific code (texture creation, draw data rendering). This improves code reusability and simplifies integration with custom engines. Individual platform bindings can now be combined with different renderer bindings. ```cpp // Before: // imgui_impl_dx11.cpp // imgui_impl_dx12.cpp // imgui_impl_glfw_gl3.cpp // imgui_impl_glfw_vulkan.cpp // imgui_impl_sdl_gl3.cpp // After: // imgui_impl_win32.cpp + imgui_impl_dx11.cpp // imgui_impl_win32.cpp + imgui_impl_dx12.cpp // imgui_impl_glfw.cpp + imgui_impl_opengl2.cpp // imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp // imgui_impl_sdl2.cpp + imgui_impl_opengl2.cpp // imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp ``` -------------------------------- ### Build nextpnr on Windows with Visual Studio CLI Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_sdl_opengl2/README.md Compiles the nextpnr project on Windows using the Visual Studio command-line compiler (cl). Requires SDL2 to be installed and its directory specified via SDL2DIR. It links against SDL2, SDL2main, and opengl32 libraries. ```batch set SDL2DIR=path_to_your_sdl2_folder cl /Zi /MD /I %SDL2DIR%\include /I .. /I ..\.. main.cpp ..\imgui_impl_sdl.cpp ..\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /link /LIBPATH:%SDL2DIR%\lib SDL2.lib SDL2main.lib opengl32.lib /subsystem:console ``` -------------------------------- ### Install pybind11 with CMake (Classic and Modern) Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/compiling.rst These code blocks show two methods for building and installing pybind11 using CMake. The 'Classic CMake' method uses a standard build process, while the 'CMake 3.15+' method utilizes a more modern approach with separate source and build directories and explicit build/install commands. ```bash # Classic CMake cd pybind11 mkdir build cd build cmake .. make install ``` ```bash # CMake 3.15+ cd pybind11 cmake -S . -B build cmake --build build -j 2 # Build on 2 cores cmake --install build ``` -------------------------------- ### Install pybind11 using Homebrew Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/installing.rst Installs pybind11 using the Homebrew package manager. This command works for both macOS and Linux (Linuxbrew) systems, providing a simple way to install pybind11 globally. ```bash brew install pybind11 ``` -------------------------------- ### Build nextpnr-himbaechel for Gowin Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Builds the nextpnr-himbaechel tool with Gowin UARCH support for Gowin FPGAs. Requires Project Apicula to be installed. ```shell mkdir -p build && cd build cmake .. -DARCH="himbaechel" -DHIMBAECHEL_UARCH="gowin" make -j$(nproc) sudo make install ``` -------------------------------- ### Console Example: Use InsertChars() for Input Text Callback Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/docs/CHANGELOG.txt The Console example now uses InsertChars() within the input text callback instead of directly manipulating the buffer. This ensures proper handling of the resizing callback, although it may not visibly alter the example's current behavior. ```cpp // Old method (direct buffer manipulation): // buffer[cursor_pos] = input_char; // New method (using InsertChars()): // InputTextCallbackData->InsertChars(InputTextCallbackData->CursorPos, &input_char, 1); ``` -------------------------------- ### Specify Engineering Sample Device (Command Line) Source: https://github.com/yosyshq/nextpnr/blob/master/docs/nexus.md This example shows the command-line argument for specifying a device, including the 'ES' postfix for engineering sample devices. This ensures the correct ES IDCODE is used. ```shell --device LIFCL-40-9BG400CES ``` -------------------------------- ### Pybind11 Installation Configuration (CMake) Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/CMakeLists.txt This CMake script configures and installs pybind11, including its header files, CMake configuration files, and package metadata. It manages installation paths, compatibility settings for different CMake versions, and handles export targets for downstream projects. Dependencies include pybind11 build flags and CMake features. ```cmake if(PYBIND11_INSTALL) install(DIRECTORY ${pybind11_INCLUDE_DIR}/pybind11 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) set(PYBIND11_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}" CACHE STRING "install path for pybind11Config.cmake") if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") set(pybind11_INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}") else() set(pybind11_INCLUDEDIR "\${PACKAGE_PREFIX_DIR}/${CMAKE_INSTALL_INCLUDEDIR}") endif() configure_package_config_file( tools/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR}) if(CMAKE_VERSION VERSION_LESS 3.14) # Remove CMAKE_SIZEOF_VOID_P from ConfigVersion.cmake since the library does # not depend on architecture specific settings or libraries. set(_PYBIND11_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) unset(CMAKE_SIZEOF_VOID_P) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion) set(CMAKE_SIZEOF_VOID_P ${_PYBIND11_CMAKE_SIZEOF_VOID_P}) else() # CMake 3.14+ natively supports header-only libraries write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT) endif() install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake tools/FindPythonLibsNew.cmake tools/pybind11Common.cmake tools/pybind11Tools.cmake tools/pybind11NewTools.cmake DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR}) if(NOT PYBIND11_EXPORT_NAME) set(PYBIND11_EXPORT_NAME "${PROJECT_NAME}Targets") endif() install(TARGETS pybind11_headers EXPORT "${PYBIND11_EXPORT_NAME}") install( EXPORT "${PYBIND11_EXPORT_NAME}" NAMESPACE "pybind11::" DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR}) # pkg-config support if(NOT prefix_for_pc_file) if(IS_ABSOLUTE "${CMAKE_INSTALL_DATAROOTDIR}") set(prefix_for_pc_file "${CMAKE_INSTALL_PREFIX}") else() set(pc_datarootdir "${CMAKE_INSTALL_DATAROOTDIR}") if(CMAKE_VERSION VERSION_LESS 3.20) set(prefix_for_pc_file "\${pcfiledir}/..") while(pc_datarootdir) get_filename_component(pc_datarootdir "${pc_datarootdir}" DIRECTORY) string(APPEND prefix_for_pc_file "/..") endwhile() else() cmake_path(RELATIVE_PATH CMAKE_INSTALL_PREFIX BASE_DIRECTORY CMAKE_INSTALL_DATAROOTDIR OUTPUT_VARIABLE prefix_for_pc_file) endif() endif() endif() join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/pybind11.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/pybind11.pc" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pybind11.pc" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig/") # Uninstall target if(PYBIND11_MASTER_PROJECT) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) endif() endif() ``` -------------------------------- ### CMake: Basic Project Setup and Qt Dependency Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/python-console/CMakeLists.txt Sets up the minimum CMake version, project name, C++ standard, and finds either Qt6 or Qt5 components. It includes conditional logic to use the appropriate Qt version found. ```cmake cmake_minimum_required( VERSION 2.8 ) project( PythonInterpreter ) set(CMAKE_CXX_STANDARD 11) find_package(Qt6 COMPONENTS Core Widgets REQUIRED) if (Qt6_FOUND) message(STATUS "Using Qt6") else() message(STATUS "Using Qt5") find_package(Qt5 COMPONENTS Core Widgets REQUIRED) endif() ``` -------------------------------- ### Run nextpnr-machxo2 Demo Script Source: https://github.com/yosyshq/nextpnr/blob/master/machxo2/README.md Executes a shell script to build a blinky bitstream and load it onto a TinyFPGA Ax2 board using the nextpnr-machxo2 toolchain. This script requires the TinyFPGA Programmer to be installed. ```bash cd machxo2/examples/ sh demo.sh tinyfpga ``` -------------------------------- ### Build nextpnr-ecp5 Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Builds the nextpnr-ecp5 tool for ECP5 FPGAs. Requires Project Trellis to be installed and its prefix path passed to CMake. ```shell mkdir -p build && cd build cmake .. -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=/usr/local make -j$(nproc) sudo make install ``` -------------------------------- ### Build nextpnr-nexus Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Builds the nextpnr-nexus tool for Nexus FPGAs. Requires Project Oxide to be installed and its prefix path passed to CMake. Note: Nexus support is experimental. ```shell mkdir -p build && cd build cmake .. -DARCH=nexus -DOXIDE_INSTALL_PREFIX=$HOME/.cargo make -j$(nproc) sudo make install ``` -------------------------------- ### Build nextpnr on Mac OS X with Homebrew and c++ Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_sdl_opengl2/README.md Instructions for building nextpnr on Mac OS X. It first requires installing SDL2 via Homebrew. The compilation uses the c++ compiler with flags obtained from `sdl2-config` and links against the OpenGL framework. ```bash brew install sdl2 c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../imgui_impl_sdl.cpp ../imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl ``` -------------------------------- ### Setup py with Pybind11Extension and build_ext override Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/compiling.rst Demonstrates how to override the build_ext command to automatically search for the highest supported C++ standard when building extensions with pybind11. This customizes the build process for Pybind11Extensions. ```python from glob import glob from setuptools import setup from pybind11.setup_helpers import Pybind11Extension, build_ext ext_modules = [ Pybind11Extension( "python_example", sorted(glob("src/*.cpp")), ), ] setup(..., cmdclass={"build_ext": build_ext}, ext_modules=ext_modules) ``` -------------------------------- ### Build nextpnr on macOS with g++ Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_sdl_opengl3/README.md Compiles the nextpnr project on macOS using g++. It first installs SDL2 via Homebrew and then uses sdl2-config for compiler and linker flags, linking against the OpenGL and CoreFoundation frameworks. ```c++ brew install sdl2 c++ `sdl2-config --cflags` -I .. -I ../.. -I ../libs/gl3w main.cpp ../imgui_impl_sdl.cpp ../imgui_impl_opengl3.cpp ../../imgui*.cpp ../libs/gl3w/GL/gl3w.c `sdl2-config --libs` -framework OpenGl -framework CoreFoundation ``` -------------------------------- ### ImGui Window and Menu Example Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/docs/README.md Illustrates how to create a window with a menu bar, menus, and menu items using Dear ImGui. It also shows how to use ColorEdit4 for color picking and PlotLines for displaying data plots. Includes basic window management and child region creation. ```cpp // Create a window called "My First Tool", with a menu bar. ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar); if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("File")) { if (ImGui::MenuItem("Open..", "Ctrl+O")) { /* Do stuff */ } if (ImGui::MenuItem("Save", "Ctrl+S")) { /* Do stuff */ } if (ImGui::MenuItem("Close", "Ctrl+W")) { my_tool_active = false; } ImGui::EndMenu(); } ImGui::EndMenuBar(); } // Edit a color (stored as ~4 floats) ImGui::ColorEdit4("Color", my_color); // Plot some values const float my_values[] = { 0.2f, 0.1f, 1.0f, 0.5f, 0.9f, 2.2f }; ImGui::PlotLines("Frame Times", my_values, IM_ARRAYSIZE(my_values)); // Display contents in a scrolling region ImGui::TextColored(ImVec4(1,1,0,1), "Important Stuff"); ImGui::BeginChild("Scrolling"); for (int n = 0; n < 50; n++) ImGui::Text("%04d: Some text", n); ImGui::EndChild(); ImGui::End(); ``` -------------------------------- ### Version Check Macro IMGUI_CHECKVERSION Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/docs/CHANGELOG.txt Example of using the IMGUI_CHECKVERSION() macro to verify ImGui version compatibility. This macro helps catch issues caused by mismatched compilation unit settings. ```cpp IMGUI_CHECKVERSION(); // ... rest of the code ... ``` -------------------------------- ### Custom Constructors with py::init() Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/upgrade.rst Illustrates the modern approach to defining custom constructors for classes in pybind11 using py::init(). This method enhances type safety and prevents common pitfalls associated with older placement-new techniques. ```cpp // old -- deprecated (runtime warning shown only in debug mode) py::class(m, "Foo") .def("__init__", [](Foo &self, ...) ``` -------------------------------- ### Get pybind11 Include Path Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/changelog.rst Provides a pybind11.get_include() function that returns the directory path containing the installed pybind11 header files. This is useful for build systems and for including pybind11 headers in C++ projects. ```python import pybind11 include_path = pybind11.get_include() ``` -------------------------------- ### Loading and executing a pybind11 module in Python Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/basics.rst Demonstrates how to import a compiled pybind11 module into Python and call its functions. This requires the module to be compiled and accessible in the Python path. The example shows a simple function call. ```pycon >>> import example >>> example.add(1, 2) 3 ``` -------------------------------- ### pybind11 Deprecation Warning Example Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/upgrade.rst A sample warning message generated by pybind11 when an outdated constructor style (old-style placement-new __init__) is detected. This warning appears at module initialization time in debug builds. ```text pybind11-bound class 'mymodule.Foo' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. ``` -------------------------------- ### Get pybind11 Header File Path Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/changelog.rst Adds a `get_include()` function to the Python module, which returns the absolute path to the directory containing the installed pybind11 header files. This is valuable for build systems that need to locate these headers. ```python import pybind11 header_dir = pybind11.get_include() ``` -------------------------------- ### Migrating PYBIND11_PLUGIN to PYBIND11_MODULE Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/upgrade.rst Demonstrates the transition from the deprecated PYBIND11_PLUGIN macro to the preferred PYBIND11_MODULE macro for defining module entry points in pybind11. This change improves clarity and consistency in module definition. ```cpp // old PYBIND11_PLUGIN(example) { py::module m("example", "documentation string"); m.def("add", [](int a, int b) { return a + b; }); return m.ptr(); } // new PYBIND11_MODULE(example, m) { m.doc() = "documentation string"; // optional m.def("add", [](int a, int b) { return a + b; }); } ``` -------------------------------- ### pybind11: Metaclass Attribute for Static Properties Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/upgrade.rst This example illustrates that pybind11 no longer requires the 'py::metaclass' attribute to bind classes with static properties. The zero-parameter version of py::metaclass() is deprecated in favor of the one-parameter version for specifying Python types. ```cpp // Binding static properties is now possible by default. // The zero-parameter py::metaclass() is deprecated. // New usage for specifying Python type: // py::metaclass(python_type) ``` -------------------------------- ### Run nextpnr-ice40 in GUI mode Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Launches nextpnr-ice40 in interactive GUI mode, allowing for manual control of packing, placing, routing, and output file generation. ```shell nextpnr-ice40 --json blinky.json --pcf blinky.pcf --asc blinky.asc --gui ``` -------------------------------- ### Splitting pybind11 Binding Code Across Multiple Files Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/faq.rst Illustrates a strategy for organizing pybind11 binding code into multiple C++ files to improve build times. Shows a main entry point file (`example.cpp`) that calls initialization functions from separate files (`ex1.cpp`, `ex2.cpp`), demonstrating how to define and use separate modules (`add`, `sub`) in Python. ```cpp // example.cpp void init_ex1(py::module_ &); void init_ex2(py::module_ &); /* ... */ PYBIND11_MODULE(example, m) { init_ex1(m); init_ex2(m); /* ... */ } ``` ```cpp // ex1.cpp void init_ex1(py::module_ &m) { m.def("add", [](int a, int b) { return a + b; }); } ``` ```cpp // ex2.cpp void init_ex2(py::module_ &m) { m.def("sub", [](int a, int b) { return a - b; }); } ``` ```pycon >>> import example >>> example.add(1, 2) 3 >>> example.sub(1, 1) 0 ``` -------------------------------- ### Custom pybind11 Type Setup for GC Support Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/advanced/classes.rst Demonstrates how to use pybind11's custom_type_setup to directly manipulate the underlying Python heap type object. This example enables garbage collection support for a C++ class by setting tp_flags, tp_traverse, and tp_clear. ```cpp struct OwnsPythonObjects { py::object value = py::none(); }; py::class_ cls( m, "OwnsPythonObjects", py::custom_type_setup([](PyHeapTypeObject *heap_type) { auto *type = &heap_type->ht_type; type->tp_flags |= Py_TPFLAGS_HAVE_GC; type->tp_traverse = [](PyObject *self_base, visitproc visit, void *arg) { auto &self = py::cast(py::handle(self_base)); Py_VISIT(self.value.ptr()); return 0; }; type->tp_clear = [](PyObject *self_base) { auto &self = py::cast(py::handle(self_base)); self.value = py::none(); return 0; }; })); cls.def(py::init<>()); cls.def_readwrite("value", &OwnsPythonObjects::value); ``` -------------------------------- ### Configure Mistral Path and Installation in CMake Source: https://github.com/yosyshq/nextpnr/blob/master/mistral/CMakeLists.txt These CMake commands set the path to the Mistral library and control its installation. 'MISTRAL_ROOT' is defined as a cache string for the install path, and 'MISTRAL_DONT_INSTALL' is set to ON to prevent installation. ```cmake set(MISTRAL_ROOT "" CACHE STRING "Mistral install path") set(MISTRAL_DONT_INSTALL ON) ``` -------------------------------- ### CMake Build Configuration for imgui_example_glfw_vulkan Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_glfw_vulkan/CMakeLists.txt This snippet configures the CMake build system for the 'example_glfw_vulkan' executable. It sets the minimum required CMake version, project name, build type, compiler flags for Vulkan prototypes, and locates GLFW and Vulkan libraries. It also includes ImGui and GLFW source files and links the necessary libraries. ```cmake cmake_minimum_required(VERSION 2.8) project(imgui_example_glfw_vulkan C CXX) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE) endif() set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES") # GLFW set(GLFW_DIR ../../../glfw) # Set this to point to an up-to-date GLFW repo option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF) option(GLFW_INSTALL "Generate installation target" OFF) option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) add_subdirectory(${GLFW_DIR} binary_dir EXCLUDE_FROM_ALL) include_directories(${GLFW_DIR}/include) # ImGui set(IMGUI_DIR ../../) include_directories(${IMGUI_DIR} ..) # Libraries find_library(VULKAN_LIBRARY NAMES vulkan vulkan-1) set(LIBRARIES "glfw;${VULKAN_LIBRARY}") # Use vulkan headers from glfw: include_directories(${GLFW_DIR}/deps) file(GLOB sources *.cpp) add_executable(example_glfw_vulkan ${sources} ${IMGUI_DIR}/examples/imgui_impl_glfw.cpp ${IMGUI_DIR}/examples/imgui_impl_vulkan.cpp ${IMGUI_DIR}/imgui.cpp ${IMGUI_DIR}/imgui_draw.cpp ${IMGUI_DIR}/imgui_demo.cpp ${IMGUI_DIR}/imgui_widgets.cpp) target_link_libraries(example_glfw_vulkan ${LIBRARIES}) ``` -------------------------------- ### Submodule Integration with setup_helpers (Python) Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/compiling.rst Demonstrates how to integrate pybind11 as a submodule, particularly when using setup_helpers.py. It manually adjusts the Python path to import the necessary components. ```python DIR = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(DIR, "extern", "pybind11")) from pybind11.setup_helpers import Pybind11Extension # noqa: E402 del sys.path[-1] ``` -------------------------------- ### Recommended CMake Configuration for pybind11 Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/upgrade.rst Starting with pybind11 v2.11, CMake 3.5 is the minimum required version. Future versions may require CMake 3.15+. To prepare for CMake 3.27's removal of FindPythonInterp, it's recommended to use CMake 3.15+ with FindPython or set PYBIND11_FINDPYTHON. pybind11 will automatically use FindPython if FindPythonInterp is unavailable. ```cmake cmake_minimum_required(VERSION 3.15) project(my_project) # Option 1: Use FindPython find_package(PythonLibs REQUIRED) # Option 2: Set PYBIND11_FINDPYTHON (if using pybind11 module) set(PYBIND11_FINDPYTHON ON CACHE BOOL "Use FindPython") pybind11_add_module(my_module src/main.cpp) ``` -------------------------------- ### Testing Packaging Locally Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/release.rst Runs the packaging tests using nox to ensure that the versioning and build process is correct before a release. ```bash nox -s tests_packaging ``` -------------------------------- ### Manual Pybind11 Packaging Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/release.rst Builds source distributions (SDists) and wheels for pybind11 using nox and then uploads them to a package index using twine. ```bash nox -s build twine upload dist/* ``` -------------------------------- ### Install pybind11 using Conda Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/installing.rst Installs pybind11 using the conda package manager from the conda-forge channel. This is a convenient method for users who manage their environments with Anaconda or Miniconda. ```bash conda install -c conda-forge pybind11 ``` -------------------------------- ### Basic ImGui Widgets Example Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/docs/README.md Demonstrates the usage of common Dear ImGui widgets like Text, Button, InputText, and SliderFloat. These functions are used to display text, create interactive buttons, input fields, and sliders within the GUI. No specific dependencies beyond the Dear ImGui library itself. ```cpp ImGui::Text("Hello, world %d", 123); if (ImGui::Button("Save")) { // do stuff } ImGui::InputText("string", buf, IM_ARRAYSIZE(buf)); ImGui::SliderFloat("float", &f, 0.0f, 1.0f); ``` -------------------------------- ### CMake Library Target and Installation with pybind11 Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt This snippet defines a library target 'test_embed_lib' and links it with pybind11::embed. It then configures installation rules for the library and an export set named 'test_export'. This allows the library to be installed and found by other CMake projects. ```cmake # Test custom export group -- PYBIND11_EXPORT_NAME add_library(test_embed_lib ../embed.cpp) target_link_libraries(test_embed_lib PRIVATE pybind11::embed) install( TARGETS test_embed_lib EXPORT test_export ARCHIVE DESTINATION bin LIBRARY DESTINATION lib RUNTIME DESTINATION lib) install(EXPORT test_export DESTINATION lib/cmake/test_export/test_export-Targets.cmake) ``` -------------------------------- ### Clean Output Files using Shell Script Source: https://github.com/yosyshq/nextpnr/blob/master/machxo2/examples/README.md This shell command removes various output files generated by the nextpnr-machxo2 example scripts. It cleans up dot files, JSON outputs, PNG diagrams, simulation logs, Verilog files, and bitstream files, ensuring a fresh state for rerunning the examples. ```shell rm -rf *.dot *.json *.png *.vcd *.smt2 *.log *.txt *.bit {pack,place,pnr}*.v *_simtest* ``` -------------------------------- ### Compile C++ pybind11 Module on Linux Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/basics.rst This bash command compiles a C++ file (`example.cpp`) into a Python extension module using pybind11 on Linux. It includes optimization flags, standard C++11, and specifies how to get pybind11 include paths using `python3 -m pybind11 --includes`. ```bash c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix) ``` -------------------------------- ### Handle py::str and py::bytes Differences in pybind11 v2.7+ Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/upgrade.rst Starting with pybind11 v2.7, `py::str` exclusively represents `PyUnicodeObject`, and `py::isinstance()` is only true for `py::str`. Previously, `py::str` could hold `PyBytesObject` as well. Use the `PYBIND11_STR_LEGACY_PERMISSIVE` macro for temporary backward compatibility. Be mindful of accidental `py::str` usage instead of `py::bytes` and update checks involving `py::isinstance()` for `py::bytes`. ```c++ // Before v2.7, isinstance() was true for both str and bytes. // After v2.7, it's only true for str. // If you encounter issues, consider: // #define PYBIND11_STR_LEGACY_PERMISSIVE // Correcting type usage: // If you intended bytes, use py::bytes instead of py::str. // Updating isinstance checks: // if (py::isinstance(obj) || py::isinstance(obj)) { // // Handle both string and bytes // } ``` -------------------------------- ### Build nextpnr on Linux/Unix with c++ and sdl2-config Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/examples/example_sdl_opengl2/README.md Builds the nextpnr project on Linux and similar Unix-like systems using the c++ compiler. It utilizes `sdl2-config` to fetch compiler flags and libraries for SDL2, and links against OpenGL. Assumes SDL2 development libraries are installed. ```bash c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../imgui_impl_sdl.cpp ../imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL ``` -------------------------------- ### DirectX11 Device Feature Level Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/docs/CHANGELOG.txt This example illustrates how to allow the creation of a DirectX11 device with feature level 10. This is suitable for examples that do not require advanced features and can improve compatibility. ```directx Examples: DirectX11: Allow creating device with feature level 10 since we don't really need much for that example. (#1333) ``` -------------------------------- ### GUI Mode for FPGA Place and Route Source: https://context7.com/yosyshq/nextpnr/llms.txt This snippet shows how to build nextpnr with GUI support and launch it in interactive graphical mode for FPGA design visualization and control. It details the build command for enabling the GUI and the subsequent command to start the interactive interface. ```bash # Build with GUI support cmake .. -DARCH=ice40 -DBUILD_GUI=ON make -j$(nproc) # Launch GUI for interactive placement/routing nextpnr-ice40 --json design.json --pcf constraints.pcf \ --asc output.asc --gui # GUI provides toolbar buttons for: # - Pack: Group cells into larger logic cells # - Place: Assign cells to Bels # - Route: Connect nets to wires # - Write: Generate output files ``` -------------------------------- ### Configure Cell Timing: Setup and Hold Source: https://github.com/yosyshq/nextpnr/blob/master/docs/generic.md Defines the setup and hold timings for a port of a cell, classifying that port as a register input. This is essential for ensuring data integrity in sequential logic. ```c++ void addCellTimingSetupHold(IdString cell, IdString port, IdString clock, float setup, float hold); ``` -------------------------------- ### Displaying C++ function signatures with keyword arguments in Python help Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/basics.rst Demonstrates how pybind11 automatically includes keyword argument information in the Python help() output for bound C++ functions. This provides clear documentation directly within the Python environment. The example shows the signature for the 'add' function. ```pycon >>> help(example) .... FUNCTIONS add(...) Signature : (i: int, j: int) -> int A function which adds two numbers ``` -------------------------------- ### Build nextpnr-ice40 on Windows with vcpkg Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Builds the nextpnr-ice40 tool on Windows using CMake and vcpkg. Allows explicit path specification for dependencies and toolchain. ```shell cmake . -B build -DARCH=ice40 -DICESTORM_INSTALL_PREFIX=C:/ProgramData/icestorm -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -G "Visual Studio 15 2017 Win64" -DPython3_EXECUTABLE=C:/Python364/python.exe -DPython3_LIBRARY=C:/vcpkg/packages/python3_x64-windows/lib/python36.lib -DPython3_INCLUDE_DIR=C:/vcpkg/packages/python3_x64-windows/include/python3.6 cmake --build build --config Release ``` -------------------------------- ### Find pybind11 Package with CMake Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/compiling.rst This CMake code demonstrates how to find an installed pybind11 package using `find_package`. It requires pybind11 to be installed on the system and then uses `pybind11_add_module` to create a Python extension. This method is suitable for projects that do not include pybind11 as a subdirectory. ```cmake cmake_minimum_required(VERSION 3.4...3.18) project(example LANGUAGES CXX) find_package(pybind11 REQUIRED) pybind11_add_module(example example.cpp) ``` -------------------------------- ### Build nextpnr-generic Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Builds the nextpnr-generic tool, which supports placement and routing for arbitrary custom architectures. Configuration is done via CMake. ```shell mkdir -p build && cd build cmake .. -DARCH=generic make -j$(nproc) sudo make install ``` -------------------------------- ### Custom Exception Translator Example Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/advanced/exceptions.rst An example demonstrating a custom exception translator that maps `MyCustomException` to a Python `MyCustomError` and `OtherException` to a Python `RuntimeError`. It utilizes `py::exception` to declare the custom Python exception type and `py::set_error` for error reporting. ```cpp PYBIND11_CONSTINIT static py::gil_safe_call_once_and_store exc_storage; exc_storage.call_once_and_store_result( [&]() { return py::exception(m, "MyCustomError"); }); py::register_exception_translator([](std::exception_ptr p) { try { if (p) std::rethrow_exception(p); } catch (const MyCustomException &e) { py::set_error(exc_storage.get_stored(), e.what()); } catch (const OtherException &e) { py::set_error(PyExc_RuntimeError, e.what()); } }); ``` -------------------------------- ### Pybind11 Automatic Type Casting Example (C++) Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/changelog.rst Shows how pybind11 now automatically casts C++ types to Python types when assigning them as attributes. Previously, a py::cast call was mandatory, but this update allows direct assignment, simplifying the binding process. An example demonstrates assigning an integer to a module attribute. ```cpp py::module m = /* ... */ m.attr("constant") = 123; ``` -------------------------------- ### Pybind11 Overload Casting Example (C++) Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/changelog.rst Illustrates the use of py::overload_cast for selecting among multiple overloads of a C++ function when binding to Python. This example shows how to bind two 'set' methods of a 'Pet' class, one taking an integer and another a string, with corresponding Python docstrings. This feature requires C++14-capable compilers. ```cpp py::class_(m, "Pet") .def("set", py::overload_cast(&Pet::set), "Set the pet's age") .def("set", py::overload_cast(&Pet::set), "Set the pet's name"); ``` -------------------------------- ### nextpnr-ice40 iCEstick workflow Source: https://github.com/yosyshq/nextpnr/blob/master/README.md Demonstrates the typical workflow for nextpnr-ice40 on an iCEstick dev board, including synthesis, place and route, bitstream generation, and uploading. ```shell cd ice40/examples/blinky yosys -p 'synth_ice40 -top blinky -json blinky.json' blinky.v nextpnr-ice40 --hx1k --json blinky.json --pcf blinky.pcf --asc blinky.asc icepack blinky.asc blinky.bin iceprog blinky.bin ``` -------------------------------- ### Build nextpnr with Test Binaries and Coverage (Bash) Source: https://github.com/yosyshq/nextpnr/blob/master/README.md This command sequence builds nextpnr with test binaries enabled and prepares for code coverage reporting. It uses CMake flags to activate tests and coverage, then compiles the project. After compilation, 'make test' can be used to run tests, and specific targets like 'ice40-coverage' generate coverage reports. ```bash cmake .. -DBUILD_TESTS=ON -DCOVERAGE make make test make ice40-coverage ``` -------------------------------- ### Example NumPy Array Usage in Python Console Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/pybind11/docs/advanced/pycpp/numpy.rst This Python console example demonstrates how a vectorized C++ function, exposed via pybind11, can be invoked with NumPy arrays. The input arrays `x` and `y` are processed element-wise by the underlying C++ function `my_func`, and the result is returned as a NumPy array of type float64. ```pycon >>> x = np.array([[1, 3], [5, 7]]) >>> y = np.array([[2, 4], [6, 8]]) ``` -------------------------------- ### Demo: Freely Moving Overlay Window Source: https://github.com/yosyshq/nextpnr/blob/master/3rdparty/imgui/docs/CHANGELOG.txt Adds a context menu item to enable freely moving the overlay window in the ImGui demo. This enhances user interaction with overlay elements. ```cpp // Enable freely moving overlay window via context menu ``` -------------------------------- ### Wire Lookup and Information (C++) Source: https://github.com/yosyshq/nextpnr/blob/master/docs/archapi.md Provides methods for looking up wires by name, retrieving their names and types, accessing their attributes and checksums, binding/unbinding them to nets, checking availability, and getting associated net information. It also includes functions to find conflicting wires and nets, retrieve wire delays, list all wires, and get bel pins attached to a wire. ```C++ WireId getWireByName(IdStringList name) const IdStringList getWireName(WireId wire) const IdString getWireType(WireId wire) const WireAttrsRangeT getWireAttrs(WireId wire) const uint32_t getWireChecksum(WireId wire) const void bindWire(WireId wire, NetInfo *net, PlaceStrength strength) void unbindWire(WireId wire) bool checkWireAvail(WireId wire) const NetInfo *getBoundWireNet(WireId wire) const WireId getConflictingWireWire(WireId wire) const NetInfo *getConflictingWireNet(WireId wire) const DelayQuad getWireDelay(WireId wire) const AllWiresRangeT getWires() const WireBelPinRangeT getWireBelPins(WireId wire) const IdString getWireConstantValue() const ```