Repository Analysis

cocotb/cocotb

cocotb: Python-based chip (RTL) verification

15.8 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of cocotb/cocotb, a Python project with 2,441 GitHub stars. SynthScan v2.0 examined 67,239 lines of code across 304 source files, recording 878 pattern matches distributed across 16 syntactic categories. The overall adjusted score of 15.8 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

15.8
Adjusted Score
15.8
Raw Score
100%
Time Factor
2026-07-13
Last Push
2.4K
Stars
Python
Language
67.2K
Lines of Code
304
Files
878
Pattern Hits
2026-07-14
Scan Date
0.10
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 30MEDIUM 30LOW 818

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 878 distinct pattern matches across 16 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers330 hits · 343 pts
SeverityFileLineSnippetContext
LOWcocotb_build_libs.py53def create_sxs_assembly_manifest(CODE
LOWcocotb_build_libs.py377 def copy_extensions_to_source(self):CODE
LOWnoxfile.py101def build_cocotb_for_dev_test(session: nox.Session) -> None:CODE
LOWnoxfile.py446def release_install_from_sdist(session: nox.Session) -> None:CODE
LOWnoxfile.py492def release_install_from_wheel(session: nox.Session) -> None:CODE
LOWtests/pytest_plugin/test_fixture.py33async def x_async_generator_fixture() -> AsyncGenerator[int, None]:CODE
LOWtests/pytest_plugin/test_fixture.py48async def test_fixture_asynchronous_value(dut, x_async: int) -> None:CODE
LOWtests/pytest_plugin/test_fixture.py53async def test_fixture_asynchronous_generator(dut, x_async_generator: int) -> None:CODE
LOWtests/pytest_plugin/test_timeout.py16async def test_timeout_with_positional_arguments(dut) -> None:CODE
LOWtests/pytest_plugin/test_timeout.py24async def test_timeout_with_named_arguments(dut) -> None:CODE
LOWtests/pytest_plugin/test_cocotb.py94async def test_xfail_condition_false(dut) -> None:CODE
LOWtests/pytest_plugin/test_cocotb.py99async def test_xfail_condition_true(dut) -> None:CODE
LOWtests/pytest_plugin/test_cocotb.py105async def test_xfail_reason_message(dut) -> None:CODE
LOWtests/pytest_plugin/test_sample_module.py81def test_sample_module_parametrize(sample_module: HDL, int_param: int) -> None:CODE
LOWtests/pytest/test_ipython_support.py65def test_ipython_support_interactive(tmp_path: Path) -> None:CODE
LOWtests/pytest/test_logging_with_envs.py23def _restore_root_handler_filters() -> Iterator[None]:CODE
LOWtests/pytest/test_logging_with_envs.py80def test_logging_boolean_envs(CODE
LOWtests/pytest/test_logging_with_envs.py113def test_default_config_no_simulator(caplog: LogCaptureFixture) -> None:CODE
LOWtests/pytest/test_xunit_reporter.py279def test_file_outside_workspace(tmp_path: Path) -> None:CODE
LOWtests/pytest/test_array.py13def test_value_only_construction():CODE
LOWtests/pytest/test_array.py30def test_range_int_construction():CODE
LOWtests/pytest/test_array.py137def test_slicing_infered_start_stop():CODE
LOWtests/pytest/test_array.py151def test_slice_direction_mismatch():CODE
LOWtests/pytest/test_array.py159def test_set_slice_wrong_length():CODE
LOWtests/pytest/test_array.py165def test_slice_correct_infered():CODE
LOWtests/pytest/test_logic_array.py13def test_logic_array_str_construction():CODE
LOWtests/pytest/test_logic_array.py31def test_logic_array_iterable_construction():CODE
LOWtests/pytest/test_logic_array.py53def test_logic_array_int_construction():CODE
LOWtests/pytest/test_logic_array.py71def test_logic_array_copy_construction():CODE
LOWtests/pytest/test_logic_array.py87def test_logic_array_bad_construction():CODE
LOWtests/pytest/test_logic_array.py98def test_logic_array_unsigned_conversion():CODE
LOWtests/pytest/test_logic_array.py121def test_logic_array_signed_conversion():CODE
LOWtests/pytest/test_logic_array.py148def test_logic_array_bytes_conversion():CODE
LOWtests/pytest/test_logic_array.py165def test_logic_array_properties():CODE
LOWtests/pytest/test_logic_array.py170def test_logic_array_properties_deprecated():CODE
LOWtests/pytest/test_logic_array.py272def test_logic_array_literal_casts():CODE
LOWtests/pytest/test_logic_array.py277def test_logic_array_index_casts():CODE
LOWtests/pytest/test_logic_array.py385def test_slicing_infered_start_stop():CODE
LOWtests/pytest/test_logic_array.py399def test_slice_direction_mismatch():CODE
LOWtests/pytest/test_logic_array.py407def test_set_slice_wrong_length():CODE
LOWtests/pytest/test_logic_array.py413def test_slice_correct_infered():CODE
LOWtests/pytest/test_futures.py118def test_envvar_unknown_future(monkeypatch: pytest.MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py45def test_env_exists_undefined(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py224def test_env_cocotb_testcase_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py235def test_env_cocotb_test_modules_empty(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py249def test_env_cocotb_test_modules_undefined(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py263def test_env_cocotb_testcase_with_cocotb_test_filter(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py277def test_env_cocotb_random_seed(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py288def test_env_random_seed_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py300def test_plusargs_ntb_random_seed_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py313def test_plusargs_seed_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py326def test_env_cocotb_enable_profiling(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py338def test_env_cocotb_resolve_x_weak(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py352def test_env_cocotb_resolve_x_value_error(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py363def test_env_cocotb_resolve_x_invalid(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py377def test_env_cocotb_resolve_x_logic_conversion(resolver: str, tmp_path: Path) -> None:CODE
LOWtests/pytest/test_runner.py54def test_sv_literal_conversion():CODE
LOWtests/pytest/test_runner.py78def test_vhdl_literal_conversion():CODE
LOWtests/pytest/test_parameterize.py44def test_parametrize_bad_args():CODE
LOWtests/pytest/test_range.py57def test_range_index_from_class():CODE
270 more matches not shown…
Unused Imports255 hits · 250 pts
SeverityFileLineSnippetContext
LOWsetup.py7CODE
LOWcocotb_build_libs.py4CODE
LOWnoxfile.py4CODE
LOWtests/pytest_plugin/conftest.py7CODE
LOWtests/pytest_plugin/test_fixture.py7CODE
LOWtests/pytest_plugin/test_timeout.py7CODE
LOWtests/pytest_plugin/test_cocotb.py7CODE
LOWtests/pytest_plugin/test_session.py7CODE
LOWtests/pytest_plugin/test_xfail.py7CODE
LOWtests/pytest_plugin/test_parametrize.py7CODE
LOWtests/pytest_plugin/test_sample_module_1.py7CODE
LOWtests/pytest_plugin/test_caplog.py7CODE
LOWtests/pytest_plugin/test_sample_module_2.py7CODE
LOWtests/pytest_plugin/test_cocotb_top.py7CODE
LOWtests/pytest_plugin/test_end_test.py7CODE
LOWtests/pytest_plugin/test_sample_module.py7CODE
LOWtests/pytest/test_ipython_support.py4CODE
LOWtests/pytest/test_logging_with_envs.py7CODE
LOWtests/pytest/test_vhdl_libraries_multiple.py4CODE
LOWtests/pytest/test_plusargs.py4CODE
LOWtests/pytest/test_xunit_reporter.py7CODE
LOWtests/pytest/test_timescale.py1CODE
LOWtests/pytest/test_cocotb.py4CODE
LOWtests/pytest/test_waves.py1CODE
LOWtests/pytest/test_array.py4CODE
LOWtests/pytest/test_logic_array.py4CODE
LOWtests/pytest/test_futures.py4CODE
LOWtests/pytest/test_env.py8CODE
LOWtests/pytest/test_env.py30CODE
LOWtests/pytest/test_runner.py4CODE
LOWtests/pytest/test_logs.py4CODE
LOWtests/pytest/test_lib_metadata.py4CODE
LOWtests/pytest/test_parameterize.py4CODE
LOWtests/pytest/test_range.py4CODE
LOWtests/pytest/test_parallel_cocotb.py4CODE
LOWtests/pytest/test_logic.py4CODE
LOW…ses/test_verilator_timing_c/test_verilator_timing_c.py4CODE
LOW…test_cases/test_iteration_verilog/test_iteration_es.py5CODE
LOW…ses/test_verilator_timing_d/test_verilator_timing_d.py4CODE
LOW…_cases/test_indexing_warning/indexing_warning_tests.py4CODE
LOW…t_cases/test_indexing_warning/test_indexing_warning.py4CODE
LOWtests/test_cases/test_select_testcase_error/x_tests.py4CODE
LOWtests/test_cases/test_skip/test_skip.py4CODE
LOWtests/test_cases/test_exit_error/test_exit.py1CODE
LOWtests/test_cases/test_plusargs/plusargs.py11CODE
LOWtests/test_cases/test_deadlock/test_deadlock.py5CODE
LOWtests/test_cases/test_array/test_array.py5CODE
LOW…ses/test_verilator_timing_b/test_verilator_timing_b.py4CODE
LOW…_skipped_explicitly_run/test_skipped_explicitly_run.py4CODE
LOWtests/test_cases/test_vhdl_integer/test_vhdl_integer.py4CODE
LOWtests/test_cases/test_max_failures/test_max_failures.py4CODE
LOWtests/test_cases/test_select_testcase/y_tests.py4CODE
LOWtests/test_cases/test_select_testcase/x_tests.py4CODE
LOWtests/test_cases/test_select_testcase/y_tests_again.py4CODE
LOW…incident_triggers/test_first_on_coincident_triggers.py4CODE
LOWtests/test_cases/test_null_ranges/test_null_ranges.py4CODE
LOWtests/test_cases/test_iteration_vhdl/test_iteration.py5CODE
LOW…t_cases/test_forked_exception/test_forked_exception.py11CODE
LOW…/test_cases/test_one_empty_test/test_one_empty_test.py4CODE
LOWtests/test_cases/test_vhdl_libraries/test_ab.py1CODE
195 more matches not shown…
Over-Commented Block150 hits · 145 pts
SeverityFileLineSnippetContext
LOW.codecov.yml1# Copyright cocotb contributorsCOMMENT
LOWpyproject.toml181# - CPython on macOS x86_64 and arm64COMMENT
LOWnoxfile.py81 session.env["PYGPI_DEBUG"] = "1"COMMENT
LOWtests/test_cases/test_discovery/test_discovery.py501COMMENT
LOWdocs/source/conf.py161# non-false value, then it is used:COMMENT
LOWdocs/source/conf.py181# add_function_parentheses = TrueCOMMENT
LOWdocs/source/conf.py221 },COMMENT
LOWdocs/source/conf.py241# html_theme_path = []COMMENT
LOWdocs/source/conf.py261html_js_files = ["cocotb.js"]COMMENT
LOWdocs/source/conf.py281# If false, no index is generated.COMMENT
LOWdocs/source/conf.py301# This is the file name suffix for HTML files (e.g. ".xhtml").COMMENT
LOWdocs/source/conf.py321latex_documents = [COMMENT
LOWdocs/source/conf.py341COMMENT
LOWdocs/source/_static/cocotb.css401// dl.field-list.simple ~ *:not(.versionadded):not(.versionchanged):not(.deprecated):not(.versionremoved) {COMMENT
LOW.github/workflows/backport.yml1# Copyright cocotb contributorsCOMMENT
LOW.github/workflows/ecosystem-compat.yml1# Copyright cocotb contributorsCOMMENT
LOWsrc/cocotb_tools/_vendor/__init__.py1# Copyright cocotb contributorsCOMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py1# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py81COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py201 assert False, "never get here"COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py221# However, people insist on putting letters into their version numbers;COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py241# Two possible solutions come to mind. The first is to tie theCOMMENT
LOWsrc/cocotb_tools/_pytest/_controller.py61 """COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h21#if VPI_COMPATIBILITY_VERSION_1800v2017COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h41#define vpi_put_value vpi_put_value_1364v1995COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h61#define vpi_put_value vpi_put_value_1364v2001COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h81#define vpi_put_value vpi_put_value_1364v2005COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h101#define vpi_put_value vpi_put_value_1800v2005COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h121#define vpi_put_value vpi_put_value_1800v2009COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h141#define vpi_put_value vpi_put_value_1800v2012COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h21* - propertiesCOMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h41#define vpiModport 606COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h61#define vpiClassObj 621COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h81#define vpiUnionTypespec 639COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h101#define vpiThread 647COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h121#define vpiSequenceDecl 661COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h141#define vpiForeachStmt 675COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h161#define vpiStructNet 683COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h181#define vpiIndexTypespec 702COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h201COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h241#define vpiExternAcc 2COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h261#define vpiModportPort 2COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h281COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h301#define vpiMethod 645COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h321#define vpiMode1364v2001 2COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h341#define vpiDPIContext 666COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h361#define vpiUntilOp 92 /* until operator */COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h381#define vpiIffOp 68 /* iff operator */COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h441#define vpiAssertCoverage 760COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h461#define vpiFsmStates 775COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h481#define cbAssertionUnlock 662COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h501#define cbAssertionSysReset 619COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h521#define vpiAssertionSysOn 627COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h61#ifndef PLI_DLLISPECCOMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h81#ifndef PLI_EXTERNCOMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h101COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h121#define vpiForce 16 /* force statement */COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h141#define vpiNet 36 /* scalar or vector net */COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h161#define vpiSysFuncCall 56 /* system function call */COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h181#define vpiCallback 107 /* callback object */COMMENT
90 more matches not shown…
Docstring Block Structure24 hits · 120 pts
SeverityFileLineSnippetContext
HIGHsrc/cocotb_tools/runner.py495Run the tests. Args: test_module: Name(s) of the Python module(s) containing the tests to run. STRING
HIGHsrc/cocotb_tools/sim_versions.py132Parse the output of ``verilator --version``. Example: >>> cmdline = "Verilator 5.041 devel rev v5.0STRING
HIGHsrc/cocotb_tools/_env.py47Convert value of environment variable to Python boolean type. Function is case-insensitive. Args: nameSTRING
HIGHsrc/cocotb_tools/_pytest/mark.py81Mark coroutine function with simulation time duration before the test is forced to fail. Example usage: .. codSTRING
HIGHsrc/cocotb_tools/_pytest/hdl.py337Test HDL design. Args: test_module: Name(s) of the Python module(s) containing the STRING
HIGHsrc/cocotb/_concurrent_waiters.py69Await on all given *awaitables* concurrently and block until the *return_when* condition is met. Every :class:`~colSTRING
HIGHsrc/cocotb/_concurrent_waiters.py192Await on all given *awaitables* concurrently and return the index and result of the first to complete. After the fiSTRING
HIGHsrc/cocotb/handle.py355Translate a discovered child object name into a key. Args: name: The GPI name of the child object. STRING
HIGHsrc/cocotb/handle.py473Query the simulator for an object with the specified *name*. If *extended* is ``True``, run the query only for STRING
HIGHsrc/cocotb/handle.py1812Factory function to create the correct type of `SimHandle` object. Args: handle: The GPI handle to the simuSTRING
HIGHsrc/cocotb/clock.py277Start driving the clock signal. You can later stop the clock by calling :meth:`stop`. Args: STRING
HIGHsrc/cocotb/_extended_awaitables.py309Wait on any awaitable, throw an exception if it waits longer than the given time. When a :term:`python:coroutine` iSTRING
HIGHsrc/cocotb/_test_manager.py226 Schedule a :term:`coroutine` to be run concurrently in a :class:`~cocotb.task.Task`. Note that this is not an STRING
HIGHsrc/cocotb/_bridge.py36Converts a coroutine function into a blocking function. This allows a :term:`coroutine function` that awaits cocotbSTRING
HIGHsrc/cocotb/utils.py36Calculate simulation time in the specified *unit* from the *steps* based on the simulator precision. Args: STRING
HIGHsrc/cocotb/utils.py72Calculates the number of simulation time steps for a given amount of *time*. When *round_mode* is ``"error"``, a :eSTRING
HIGHsrc/cocotb/simtime.py127Retrieve the simulation time from the simulator. Args: unit: String specifying the unit of the result STRING
HIGHsrc/cocotb/simtime.py227Retrieve the ``log10()`` of the scale factor for a given time unit. Args: unit: String specifying the unit STRING
HIGHsrc/cocotb/types/_logic_array.py364Construct a :class:`!LogicArray` from an :class:`int` with unsigned representation. The :class:`int` is treatedSTRING
HIGHsrc/cocotb/types/_logic_array.py442Construct a :class:`!LogicArray` from an :class:`int` with two's complement representation. The :class:`int` isSTRING
HIGHsrc/cocotb/types/_logic_array.py523Construct a :class:`!LogicArray` from :class:`bytes`. The :class:`bytes` is first converted to an unsigned inteSTRING
HIGHsrc/cocotb/types/_logic_array.py980Resolves non-0/1 values to 0/1. The possible values of the *resolver* argument are: * ``"weak"``: STRING
HIGHsrc/cocotb/types/_logic.py271Resolve non-``0``/``1`` values to ``0``/``1``. The possible values of the *resolver* argument are: * `STRING
HIGHsrc/cocotb/types/_abstract_array.py95Find first occurrence of value. Args: value: Value to search for. start: Index to startSTRING
Self-Referential Comments21 hits · 66 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_cases/test_cocotb/test_edge_triggers.py483 # Create a fresh trigger (not the cached dut.clk.rising_edge) so thatCOMMENT
MEDIUMdocs/source/conf.py5# This file is execfile()d with the current directory set to its containing dir.COMMENT
MEDIUMexamples/analog_model/afe.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/analog_model/test_analog_model.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/simple_dff/test_dff.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/simple_dff/test_dff.py24 # Create a 10us period clock driver on port `clk`COMMENT
MEDIUMexamples/mixed_signal/tests/test_rescap.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/mixed_signal/tests/test_regulator_plot.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/mixed_signal/tests/test_regulator_trim.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/mixed_signal/tests/test_rescap_minimalist.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/adder/tests/test_adder.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/adder/model/adder_model.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/first_steps/counter_tests.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUM…les/matrix_multiplier/tests/matrix_multiplier_tests.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUM…les/matrix_multiplier/tests/matrix_multiplier_tests.py442 # Create the testbench, start it and go through resetCOMMENT
MEDIUM…ples/matrix_multiplier/tests/test_matrix_multiplier.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMsrc/cocotb_tools/_pytest/_regression.py163 # Initialize configuration object needed for pytestCOMMENT
MEDIUMsrc/cocotb/_task_manager.py111 # Create the Task and tie it to this TaskManager via the done callback.STRING
MEDIUMsrc/cocotb/_bridge.py244 # Create a threadCOMMENT
MEDIUMsrc/cocotb/_bridge.py245 # Create a trigger that is called as a result of the thread finishingCOMMENT
MEDIUMsrc/cocotb/_bridge.py246 # Create an Event object that the caller can await onCOMMENT
Deep Nesting43 hits · 43 pts
SeverityFileLineSnippetContext
LOWcocotb_build_libs.py227CODE
LOWcocotb_build_libs.py280CODE
LOWtests/pytest/test_waves.py77CODE
LOWtests/test_cases/test_array/test_array.py190CODE
LOW…les/matrix_multiplier/tests/matrix_multiplier_tests.py182CODE
LOW…ples/matrix_multiplier/tests/test_matrix_multiplier.py18CODE
LOWsrc/cocotb_tools/runner.py116CODE
LOWsrc/cocotb_tools/runner.py233CODE
LOWsrc/cocotb_tools/runner.py1274CODE
LOWsrc/cocotb_tools/runner.py1452CODE
LOWsrc/cocotb_tools/config.py229CODE
LOWsrc/cocotb_tools/combine_results.py83CODE
LOWsrc/cocotb_tools/_vendor/distutils_version.py167CODE
LOWsrc/cocotb_tools/_pytest/hdl.py438CODE
LOWsrc/cocotb_tools/_pytest/_regression.py750CODE
LOWsrc/cocotb_tools/_pytest/_controller.py244CODE
LOWsrc/cocotb_tools/_pytest/_controller.py362CODE
LOWsrc/cocotb_tools/_pytest/plugin.py671CODE
LOWsrc/cocotb_tools/_pytest/plugin.py739CODE
LOWsrc/cocotb_tools/_pytest/_option.py68CODE
LOWsrc/cocotb/task.py107CODE
LOWsrc/cocotb/task.py232CODE
LOWsrc/cocotb/task.py328CODE
LOWsrc/cocotb/task.py457CODE
LOWsrc/cocotb/task.py588CODE
LOWsrc/cocotb/_task_manager.py228CODE
LOWsrc/cocotb/regression.py246CODE
LOWsrc/cocotb/regression.py511CODE
LOWsrc/cocotb/regression.py979CODE
LOWsrc/cocotb/_init.py169CODE
LOWsrc/cocotb/_extended_awaitables.py243CODE
LOWsrc/cocotb/_bridge.py161CODE
LOWsrc/cocotb/_decorators.py203CODE
LOWsrc/cocotb/_decorators.py402CODE
LOWsrc/cocotb/_decorators.py557CODE
LOWsrc/cocotb/_decorators.py132CODE
LOWsrc/cocotb/_decorators.py599CODE
LOWsrc/cocotb/simtime.py195CODE
LOWsrc/cocotb/_event_loop.py44CODE
LOWsrc/cocotb/_test_factory.py140CODE
LOWsrc/cocotb/types/_logic_array.py241CODE
LOWsrc/cocotb/types/_logic_array.py589CODE
LOWsrc/cocotb/types/_logic_array.py1023CODE
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHexamples/mixed_language/tests/test_mixed_language.py0simulate the matrix_multiplier example using the python runner. this file can be run directly or via pytest discovery.STRING
HIGHexamples/adder/tests/test_adder.py0simulate the matrix_multiplier example using the python runner. this file can be run directly or via pytest discovery.STRING
HIGH…ples/matrix_multiplier/tests/test_matrix_multiplier.py0simulate the matrix_multiplier example using the python runner. this file can be run directly or via pytest discovery.STRING
HIGHsrc/cocotb/_extended_awaitables.py0a collection of triggers which a testbench can :keyword:`await`.STRING
HIGHsrc/cocotb/_gpi_triggers.py0a collection of triggers which a testbench can :keyword:`await`.STRING
HIGHsrc/cocotb/_base_triggers.py0a collection of triggers which a testbench can :keyword:`await`.STRING
Modern Structural Boilerplate19 hits · 18 pts
SeverityFileLineSnippetContext
LOWcocotb_build_libs.py19logger = logging.getLogger(__name__)CODE
LOWtests/pytest/test_logging_with_envs.py60def _set_env(monkeypatch: MonkeyPatch, name: str, value: str | None) -> None:CODE
LOWsrc/cocotb_tools/runner.py273 def _set_env_common(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py302 def _set_env_build(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py305 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py783 def _set_vhdl_sources(self, sources: Sequence[PathLike | VHDL]) -> None:CODE
LOWsrc/cocotb_tools/runner.py831 def _set_build_args(self, build_args: Sequence[str | Verilog | VHDL]) -> None:CODE
LOWsrc/cocotb_tools/runner.py1204 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py1350 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py1671 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/_pytest/_regression.py391 def _setup_completed(self) -> None:CODE
LOWsrc/cocotb/logging.py157 def set_level(logger_name: str, envvar: str) -> None:CODE
LOWsrc/cocotb/logging.py180def _setup_gpi_logger() -> None:CODE
LOWsrc/cocotb/task.py191 def set_name(self, value: object) -> None:STRING
LOWsrc/cocotb/regression.py300 def set_mode(self, mode: RegressionMode) -> None:CODE
LOWsrc/cocotb/regression.py1144def _setup_regression_manager() -> None:CODE
LOWsrc/cocotb/_init.py169def _setup_random_seed() -> None:CODE
LOWsrc/cocotb/_init.py203def _setup_root_handle() -> None:CODE
LOWsrc/cocotb/_deprecation.py14__all__ = ["deprecated"]CODE
Decorative Section Separators6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMsrc/cocotb/types/_logic.py154 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py156 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py177 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py179 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py200 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py202 # -----------------------------------------------------COMMENT
AI Structural Patterns9 hits · 9 pts
SeverityFileLineSnippetContext
LOWtests/test_cases/test_async_bridge/test_async_bridge.py187CODE
LOWtests/test_cases/test_async_bridge/test_async_bridge.py191CODE
LOWsrc/cocotb_tools/runner.py332CODE
LOWsrc/cocotb_tools/runner.py470CODE
LOWsrc/cocotb_tools/_pytest/hdl.py218CODE
LOWsrc/cocotb_tools/_pytest/hdl.py316CODE
LOWsrc/cocotb_tools/_pytest/_regression.py91CODE
LOWsrc/cocotb/_decorators.py238CODE
LOWsrc/cocotb/_test_factory.py140CODE
Excessive Try-Catch Wrapping5 hits · 6 pts
SeverityFileLineSnippetContext
LOWsrc/cocotb_tools/_pytest/_regression.py763 except Exception:CODE
LOWsrc/pygpi/entry.py32 except Exception as e:CODE
LOWsrc/cocotb/task.py447 except Exception as e:STRING
LOWsrc/cocotb/regression.py411 except Exception:CODE
MEDIUMsrc/cocotb/_decorators.py292def my_test(dut):CODE
Redundant / Tautological Comments5 hits · 4 pts
SeverityFileLineSnippetContext
LOW…ts/test_cases/test_force_release/test_force_release.py209 # Check if the driven signal is actually released.COMMENT
LOWsrc/cocotb_tools/_pytest/_runner.py55 # Check if test_module exists as Python fileCOMMENT
LOWsrc/cocotb/task.py384 # Print the message only if it existsSTRING
LOWsrc/cocotb/task.py562 # Set state to do cancelSTRING
LOWsrc/cocotb/task.py611 # Set state to do cancelSTRING
Dead Code2 hits · 4 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_cases/test_kill_sim/kill_sim_tests.py59CODE
MEDIUMtests/test_cases/test_kill_sim/kill_sim_tests.py86CODE
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_cases/test_discovery/test_discovery.py329# TODO: add tests for Verilog "string_input_port" and "STRING_LOCALPARAM" (see issue #802)COMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/cocotb_tools/config.py56 # NOTE: make sure to keep "helpmsg" aligned with docs/source/library_reference.rstCOMMENT
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWtests/test_cases/test_cocotb/test_deprecated.py178 async def do_something():CODE