Skip to content

Commit

Permalink
Remove Makefile variables that are cocotb-config calls
Browse files Browse the repository at this point in the history
This should increase startup speed. Also the documentation for these
variables was removed.
  • Loading branch information
ktbarrett committed Mar 6, 2024
1 parent 5e055b0 commit 318ec4b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 45 deletions.
1 change: 0 additions & 1 deletion cocotb_build_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ def _get_common_lib_ext(include_dirs, share_lib_dir):
Defines common libraries.
All libraries go into the same directory to enable loading without modifying the library path (e.g. LD_LIBRARY_PATH).
In Makefile `LIB_DIR` (s) is used to point to this directory.
"""

#
Expand Down
33 changes: 0 additions & 33 deletions docs/source/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,36 +411,3 @@ and

..
`CXXFLAGS`, `LDLIBS` are not supported by distutils/pip

Internal Variables
------------------

The following variables are used for cocotb internals.
They may change at any time, and users should not rely on them.

.. envvar:: COCOTB_PY_DIR

Path to the directory containing the cocotb Python package in the :file:`cocotb` subdirectory.

.. envvar:: COCOTB_SHARE_DIR

Path to the directory containing the cocotb Makefiles and simulator libraries in the subdirectories
:file:`lib`, :file:`include`, and :file:`makefiles`.

.. envvar:: COCOTB_LIBRARY_COVERAGE

Enable code coverage collection for cocotb internals.
When set, a file :file:`.coverage.cocotb` will be written which contains statistics about the code coverage.
This is mainly useful for cocotb's own Continuous Integration setup.

..
TODO
Build Defines
-------------

SINGLETON_HANDLES
PYTHON_SO_LIB

simulator sim defines
9 changes: 0 additions & 9 deletions src/cocotb_tools/makefiles/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ sim:
# Make sure to use bash for the pipefail option used in many simulator Makefiles
SHELL := bash

# Directory containing the cocotb Python module
COCOTB_PY_DIR := $(shell cocotb-config --prefix)

# Directory containing all support files required to build cocotb-based
# simulations: Makefile fragments, and the simulator libraries.
COCOTB_SHARE_DIR := $(COCOTB_PY_DIR)/cocotb/share

OS=$(shell uname)
ifneq (, $(findstring MINGW, $(OS)))
OS := Msys
Expand All @@ -66,8 +59,6 @@ PYTHON_BIN ?= $(shell cocotb-config --python-bin)

include $(shell cocotb-config --makefiles)/Makefile.deprecations

LIB_DIR=$(COCOTB_PY_DIR)/cocotb/libs

PYTHON_ARCH := $(shell $(PYTHON_BIN) -c 'from platform import architecture; print(architecture()[0])')
ifeq ($(filter $(PYTHON_ARCH),64bit 32bit),)
$(error Unknown Python architecture: $(PYTHON_ARCH))
Expand Down
6 changes: 4 additions & 2 deletions src/cocotb_tools/makefiles/simulators/Makefile.verilator
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ ifdef VERILOG_INCLUDE_DIRS
COMPILE_ARGS += $(addprefix +incdir+, $(VERILOG_INCLUDE_DIRS))
endif

$(SIM_BUILD)/Vtop.mk: $(VERILOG_SOURCES) $(CUSTOM_COMPILE_DEPS) $(COCOTB_SHARE_DIR)/lib/verilator/verilator.cpp | $(SIM_BUILD)
$(CMD) -cc --exe -Mdir $(SIM_BUILD) -DCOCOTB_SIM=1 $(TOPMODULE_ARG) $(COMPILE_ARGS) $(EXTRA_ARGS) $(VERILOG_SOURCES) $(COCOTB_SHARE_DIR)/lib/verilator/verilator.cpp
VERILATOR_CPP := $(shell cocotb-config --share)/lib/verilator/verilator.cpp

$(SIM_BUILD)/Vtop.mk: $(VERILOG_SOURCES) $(CUSTOM_COMPILE_DEPS) $(VERILATOR_CPP) | $(SIM_BUILD)
$(CMD) -cc --exe -Mdir $(SIM_BUILD) -DCOCOTB_SIM=1 $(TOPMODULE_ARG) $(COMPILE_ARGS) $(EXTRA_ARGS) $(VERILOG_SOURCES) $(VERILATOR_CPP)

# Compilation phase
$(SIM_BUILD)/Vtop: $(SIM_BUILD)/Vtop.mk
Expand Down

0 comments on commit 318ec4b

Please sign in to comment.