Skip to content

Commit

Permalink
Move to src/ project infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbarrett committed Nov 6, 2023
1 parent a4272cd commit d9f8133
Show file tree
Hide file tree
Showing 103 changed files with 23 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*.gcno
*.gcda
*.gcov
*.xml

# Packaging
*.egg
Expand Down Expand Up @@ -86,7 +87,7 @@ bpad_*.err
waves.shm/

# Interface libraries built on setup
cocotb/libs
src/cocotb/libs
pip-wheel-metadata/

# Mentor Modelsim/Questa
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
rev: "v16.0.6"
hooks:
- id: "clang-format"
exclude: "^cocotb/share/include/(sv_vpi|vhpi|vpi)_user(_ext)?.h"
exclude: "^src/cocotb/share/include/(sv_vpi|vhpi|vpi)_user(_ext)?.h"

- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.4.0"
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
recursive-include cocotb/share *
recursive-include cocotb/_vendor *
recursive-include src/cocotb/share *
recursive-include src/cocotb/_vendor *
include README.md
include LICENSE
include cocotb_build_libs.py
4 changes: 2 additions & 2 deletions cocotb_build_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

logger = logging.getLogger(__name__)
cocotb_share_dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), "cocotb", "share")
os.path.join(os.path.dirname(__file__), "src", "cocotb", "share")
)
_base_warns = [
"-Wall",
Expand Down Expand Up @@ -675,7 +675,7 @@ def get_ext():
share_lib_dir = os.path.relpath(os.path.join(cocotb_share_dir, "lib"))
include_dirs = [
os.path.relpath(os.path.join(cocotb_share_dir, "include")),
os.path.relpath(os.path.join(os.path.dirname(__file__), "cocotb")),
os.path.relpath(os.path.join(os.path.dirname(__file__), "src", "cocotb")),
]

ext = []
Expand Down
2 changes: 1 addition & 1 deletion documentation/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = ../cocotb/share/include/gpi.h
INPUT = ../src/cocotb/share/include/gpi.h

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
8 changes: 4 additions & 4 deletions documentation/source/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Build options and Environment Variables
Make System
===========

Makefiles are provided for a variety of simulators in :file:`cocotb/share/makefiles/simulators`.
The common Makefile :file:`cocotb/share/makefiles/Makefile.sim` includes the appropriate simulator Makefile based on the contents of the :make:var:`SIM` variable.
Makefiles are provided for a variety of simulators in :file:`src/cocotb/share/makefiles/simulators`.
The common Makefile :file:`src/cocotb/share/makefiles/Makefile.sim` includes the appropriate simulator Makefile based on the contents of the :make:var:`SIM` variable.

Make Targets
------------
Expand Down Expand Up @@ -38,7 +38,7 @@ Of the environment variables, only :envvar:`MODULE` is mandatory to be set
(typically done in a makefile or run script), all others are optional.

..
If you edit the following sections, please also update the "helpmsg" text in cocotb/config.py
If you edit the following sections, please also update the "helpmsg" text in src/cocotb/config.py
Cocotb
------
Expand Down Expand Up @@ -261,7 +261,7 @@ The following variables are makefile variables, not environment variables.
.. make:var:: SIM
Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from :file:`cocotb/share/makefiles/simulators/makefile.$(SIM)`
Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from :file:`src/cocotb/share/makefiles/simulators/makefile.$(SIM)`
.. make:var:: WAVES
Expand Down
4 changes: 2 additions & 2 deletions documentation/source/library_reference_c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
GPI Library Reference
*********************

Cocotb contains a library called ``GPI`` (in directory :file:`cocotb/share/lib/gpi/`) written in C++
Cocotb contains a library called ``GPI`` (in directory :file:`src/cocotb/share/lib/gpi/`) written in C++
that is an abstraction layer for the VPI, VHPI, and FLI simulator interfaces.

.. image:: diagrams/svg/cocotb_overview.svg

The interaction between Python and GPI is via a Python extension module called ``simulator``
(in directory :file:`cocotb/share/lib/simulator/`) which provides routines for
(in directory :file:`src/cocotb/share/lib/simulator/`) which provides routines for
traversing the hierarchy, getting/setting an object's value, registering callbacks etc.

.. doxygenfile:: gpi.h
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ omit =

[coverage:paths]
source =
cocotb/
src/cocotb/
.nox/**/cocotb/

[coverage:report]
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def package_files(directory):
paths = []
for fpath, directories, filenames in walk(directory):
for filename in filenames:
paths.append(path.join("..", fpath, filename))
paths.append(path.join("..", "..", fpath, filename))
return paths


# this sets the __version__ variable
exec(read_file(path.join("cocotb", "_version.py")))
exec(read_file(path.join("src", "cocotb", "_version.py")))

# store log from build_libs and display at the end in verbose mode
# see https://github.com/pypa/pip/issues/6634
Expand All @@ -101,13 +101,14 @@ def package_files(directory):
"find_libpython",
],
python_requires=">=3.6",
packages=find_packages(),
packages=find_packages(where="src"),
package_dir={"": "src"},
package_data={
"cocotb": (
package_files("cocotb/share/makefiles")
+ package_files("cocotb/share/include") # noqa: W504
+ package_files("cocotb/share/def") # noqa: W504
+ package_files("cocotb/share/lib/verilator") # noqa: W504
package_files("src/cocotb/share/makefiles")
+ package_files("src/cocotb/share/include") # noqa: W504
+ package_files("src/cocotb/share/def") # noqa: W504
+ package_files("src/cocotb/share/lib/verilator") # noqa: W504
)
},
ext_modules=get_ext(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d9f8133

Please sign in to comment.