cocotb 1.9.2__cp39-cp39-win_amd64.whl → 2.0.0b1__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cocotb might be problematic. Click here for more details.

Files changed (155) hide show
  1. cocotb/{ANSI.py → _ANSI.py} +5 -25
  2. cocotb/__init__.py +76 -332
  3. cocotb/_base_triggers.py +513 -0
  4. cocotb/_bridge.py +187 -0
  5. cocotb/_decorators.py +515 -0
  6. cocotb/_deprecation.py +3 -3
  7. cocotb/_exceptions.py +7 -0
  8. cocotb/_extended_awaitables.py +419 -0
  9. cocotb/_gpi_triggers.py +382 -0
  10. cocotb/_init.py +295 -0
  11. cocotb/_outcomes.py +54 -0
  12. cocotb/_profiling.py +46 -0
  13. cocotb/_py_compat.py +100 -29
  14. cocotb/_scheduler.py +454 -0
  15. cocotb/_test.py +245 -0
  16. cocotb/_test_factory.py +309 -0
  17. cocotb/_test_functions.py +42 -0
  18. cocotb/_typing.py +7 -0
  19. cocotb/_utils.py +296 -0
  20. cocotb/_version.py +3 -7
  21. cocotb/_xunit_reporter.py +66 -0
  22. cocotb/clock.py +271 -108
  23. cocotb/handle.py +1342 -795
  24. cocotb/libs/cocotb.dll +0 -0
  25. cocotb/libs/cocotb.exp +0 -0
  26. cocotb/libs/cocotb.lib +0 -0
  27. cocotb/libs/cocotbfli_modelsim.dll +0 -0
  28. cocotb/libs/cocotbfli_modelsim.exp +0 -0
  29. cocotb/libs/cocotbfli_modelsim.lib +0 -0
  30. cocotb/libs/cocotbutils.dll +0 -0
  31. cocotb/libs/cocotbutils.exp +0 -0
  32. cocotb/libs/cocotbutils.lib +0 -0
  33. cocotb/libs/cocotbvhpi_aldec.dll +0 -0
  34. cocotb/libs/cocotbvhpi_aldec.exp +0 -0
  35. cocotb/libs/cocotbvhpi_aldec.lib +0 -0
  36. cocotb/libs/cocotbvhpi_modelsim.dll +0 -0
  37. cocotb/libs/cocotbvhpi_modelsim.exp +0 -0
  38. cocotb/libs/cocotbvhpi_modelsim.lib +0 -0
  39. cocotb/libs/cocotbvpi_aldec.dll +0 -0
  40. cocotb/libs/cocotbvpi_aldec.exp +0 -0
  41. cocotb/libs/cocotbvpi_aldec.lib +0 -0
  42. cocotb/libs/cocotbvpi_ghdl.dll +0 -0
  43. cocotb/libs/cocotbvpi_ghdl.exp +0 -0
  44. cocotb/libs/cocotbvpi_ghdl.lib +0 -0
  45. cocotb/libs/cocotbvpi_icarus.exp +0 -0
  46. cocotb/libs/cocotbvpi_icarus.lib +0 -0
  47. cocotb/libs/cocotbvpi_icarus.vpl +0 -0
  48. cocotb/libs/cocotbvpi_modelsim.dll +0 -0
  49. cocotb/libs/cocotbvpi_modelsim.exp +0 -0
  50. cocotb/libs/cocotbvpi_modelsim.lib +0 -0
  51. cocotb/libs/embed.dll +0 -0
  52. cocotb/libs/embed.exp +0 -0
  53. cocotb/libs/embed.lib +0 -0
  54. cocotb/libs/gpi.dll +0 -0
  55. cocotb/libs/gpi.exp +0 -0
  56. cocotb/libs/gpi.lib +0 -0
  57. cocotb/libs/gpilog.dll +0 -0
  58. cocotb/libs/gpilog.exp +0 -0
  59. cocotb/libs/gpilog.lib +0 -0
  60. cocotb/libs/pygpilog.dll +0 -0
  61. cocotb/libs/pygpilog.exp +0 -0
  62. cocotb/libs/pygpilog.lib +0 -0
  63. cocotb/{log.py → logging.py} +105 -110
  64. cocotb/queue.py +103 -57
  65. cocotb/regression.py +667 -712
  66. cocotb/result.py +17 -188
  67. cocotb/share/def/aldec.exp +0 -0
  68. cocotb/share/def/aldec.lib +0 -0
  69. cocotb/share/def/ghdl.exp +0 -0
  70. cocotb/share/def/ghdl.lib +0 -0
  71. cocotb/share/def/icarus.exp +0 -0
  72. cocotb/share/def/icarus.lib +0 -0
  73. cocotb/share/def/modelsim.def +1 -0
  74. cocotb/share/def/modelsim.exp +0 -0
  75. cocotb/share/def/modelsim.lib +0 -0
  76. cocotb/share/include/cocotb_utils.h +6 -29
  77. cocotb/share/include/embed.h +5 -28
  78. cocotb/share/include/gpi.h +137 -92
  79. cocotb/share/include/gpi_logging.h +221 -142
  80. cocotb/share/include/py_gpi_logging.h +7 -4
  81. cocotb/share/include/vpi_user_ext.h +4 -26
  82. cocotb/share/lib/verilator/verilator.cpp +59 -54
  83. cocotb/simulator.cp39-win_amd64.exp +0 -0
  84. cocotb/simulator.cp39-win_amd64.lib +0 -0
  85. cocotb/simulator.cp39-win_amd64.pyd +0 -0
  86. cocotb/simulator.pyi +107 -0
  87. cocotb/task.py +434 -212
  88. cocotb/triggers.py +55 -1092
  89. cocotb/types/__init__.py +25 -47
  90. cocotb/types/_abstract_array.py +151 -0
  91. cocotb/types/_array.py +264 -0
  92. cocotb/types/_logic.py +296 -0
  93. cocotb/types/_logic_array.py +834 -0
  94. cocotb/types/{range.py → _range.py} +36 -44
  95. cocotb/types/_resolve.py +76 -0
  96. cocotb/utils.py +119 -587
  97. cocotb-2.0.0b1.dist-info/METADATA +60 -0
  98. cocotb-2.0.0b1.dist-info/RECORD +143 -0
  99. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/WHEEL +1 -1
  100. cocotb-2.0.0b1.dist-info/entry_points.txt +2 -0
  101. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/top_level.txt +1 -0
  102. cocotb_tools/__init__.py +0 -0
  103. cocotb_tools/_coverage.py +33 -0
  104. cocotb_tools/_vendor/__init__.py +3 -0
  105. cocotb_tools/check_results.py +65 -0
  106. cocotb_tools/combine_results.py +152 -0
  107. cocotb_tools/config.py +241 -0
  108. {cocotb → cocotb_tools}/ipython_support.py +29 -22
  109. cocotb_tools/makefiles/Makefile.deprecations +27 -0
  110. {cocotb/share → cocotb_tools}/makefiles/Makefile.inc +82 -54
  111. {cocotb/share → cocotb_tools}/makefiles/Makefile.sim +8 -33
  112. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.activehdl +9 -16
  113. cocotb_tools/makefiles/simulators/Makefile.cvc +61 -0
  114. cocotb_tools/makefiles/simulators/Makefile.dsim +39 -0
  115. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.ghdl +13 -42
  116. cocotb_tools/makefiles/simulators/Makefile.icarus +80 -0
  117. cocotb_tools/makefiles/simulators/Makefile.ius +93 -0
  118. cocotb_tools/makefiles/simulators/Makefile.modelsim +9 -0
  119. cocotb_tools/makefiles/simulators/Makefile.nvc +60 -0
  120. cocotb_tools/makefiles/simulators/Makefile.questa +29 -0
  121. cocotb/share/makefiles/simulators/Makefile.questa → cocotb_tools/makefiles/simulators/Makefile.questa-compat +26 -54
  122. cocotb_tools/makefiles/simulators/Makefile.questa-qisqrun +149 -0
  123. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.riviera +17 -56
  124. cocotb_tools/makefiles/simulators/Makefile.vcs +65 -0
  125. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.verilator +15 -22
  126. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.xcelium +20 -52
  127. cocotb_tools/py.typed +0 -0
  128. {cocotb → cocotb_tools}/runner.py +794 -361
  129. cocotb/_sim_versions.py → cocotb_tools/sim_versions.py +16 -21
  130. pygpi/entry.py +34 -17
  131. pygpi/py.typed +0 -0
  132. cocotb/binary.py +0 -858
  133. cocotb/config.py +0 -289
  134. cocotb/decorators.py +0 -332
  135. cocotb/memdebug.py +0 -35
  136. cocotb/outcomes.py +0 -56
  137. cocotb/scheduler.py +0 -1099
  138. cocotb/share/makefiles/Makefile.deprecations +0 -12
  139. cocotb/share/makefiles/simulators/Makefile.cvc +0 -94
  140. cocotb/share/makefiles/simulators/Makefile.icarus +0 -111
  141. cocotb/share/makefiles/simulators/Makefile.ius +0 -125
  142. cocotb/share/makefiles/simulators/Makefile.modelsim +0 -32
  143. cocotb/share/makefiles/simulators/Makefile.nvc +0 -64
  144. cocotb/share/makefiles/simulators/Makefile.vcs +0 -98
  145. cocotb/types/array.py +0 -309
  146. cocotb/types/logic.py +0 -292
  147. cocotb/types/logic_array.py +0 -298
  148. cocotb/wavedrom.py +0 -199
  149. cocotb/xunit_reporter.py +0 -80
  150. cocotb-1.9.2.dist-info/METADATA +0 -168
  151. cocotb-1.9.2.dist-info/RECORD +0 -121
  152. cocotb-1.9.2.dist-info/entry_points.txt +0 -2
  153. /cocotb/{_vendor/__init__.py → py.typed} +0 -0
  154. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info/licenses}/LICENSE +0 -0
  155. {cocotb → cocotb_tools}/_vendor/distutils_version.py +0 -0
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Common Makefile for the Aldec Active-HDL simulator
6
6
 
7
- include $(shell cocotb-config --makefiles)/Makefile.inc
8
-
9
7
  CMD_BIN := vsimsa
10
8
 
11
9
  ifdef ACTIVEHDL_BIN_DIR
@@ -13,6 +11,7 @@ ifdef ACTIVEHDL_BIN_DIR
13
11
  else
14
12
  # auto-detect bin dir from system path
15
13
  CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
14
+ ACTIVEHDL_BIN_DIR := $(shell dirname $(CMD))
16
15
  endif
17
16
 
18
17
  ALOG_ARGS += -timescale $(COCOTB_HDL_TIMEUNIT)/$(COCOTB_HDL_TIMEPRECISION)
@@ -22,8 +21,6 @@ ALOG_ARGS += $(COMPILE_ARGS)
22
21
  ACOM_ARGS += $(COMPILE_ARGS)
23
22
  ASIM_ARGS += $(SIM_ARGS)
24
23
 
25
- ALOG_ARGS += +define+COCOTB_SIM -dbg
26
-
27
24
  ifdef RTL_LIBRARY
28
25
  $(warning Using RTL_LIBRARY is deprecated, please use TOPLEVEL_LIBRARY instead.)
29
26
  TOPLEVEL_LIBRARY ?= $(RTL_LIBRARY)
@@ -31,21 +28,22 @@ else
31
28
  TOPLEVEL_LIBRARY ?= work
32
29
  endif
33
30
 
31
+ ALOG_ARGS += -dbg
34
32
  ACOM_ARGS += -dbg
35
33
 
36
34
  GPI_EXTRA:=
37
35
  ifeq ($(TOPLEVEL_LANG),verilog)
38
36
  # backslashes needed because we embed in `echo` below
39
- GPI_ARGS = -pli \"$(shell cocotb-config --lib-name-path vpi activehdl)\"
37
+ GPI_ARGS = -pli \"$(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vpi activehdl)\"
40
38
  ifneq ($(VHDL_SOURCES),)
41
- GPI_EXTRA = $(shell cocotb-config --lib-name-path vhpi activehdl):cocotbvhpi_entry_point
39
+ GPI_EXTRA = $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vhpi activehdl):cocotbvhpi_entry_point
42
40
  endif
43
41
 
44
42
  else ifeq ($(TOPLEVEL_LANG),vhdl)
45
43
  # backslashes needed because we embed in `echo` below
46
- GPI_ARGS = -loadvhpi \"$(shell cocotb-config --lib-name-path vhpi activehdl):vhpi_startup_routines_bootstrap\"
44
+ GPI_ARGS = -loadvhpi \"$(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vhpi activehdl):vhpi_startup_routines_bootstrap\"
47
45
  ifneq ($(VERILOG_SOURCES),)
48
- GPI_EXTRA = $(shell cocotb-config --lib-name-path vpi activehdl):cocotbvpi_entry_point
46
+ GPI_EXTRA = $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vpi activehdl):cocotbvpi_entry_point
49
47
  endif
50
48
  else
51
49
  $(error A valid value (verilog or vhdl) was not provided for TOPLEVEL_LANG=$(TOPLEVEL_LANG))
@@ -61,7 +59,7 @@ endif
61
59
  ifneq ($(VERILOG_SOURCES),)
62
60
  @echo "alog $(ALOG_ARGS) $(call to_tcl_path,$(VERILOG_SOURCES))" >> $@
63
61
  endif
64
- @echo "asim $(ASIM_ARGS) $(PLUSARGS) +access +w_nets -interceptcoutput $(GPI_ARGS) $(TOPLEVEL) $(EXTRA_TOPS)" >> $@
62
+ @echo "asim $(ASIM_ARGS) $(call deprecate,PLUSARGS,COCOTB_PLUSARGS) +access +w_nets -interceptcoutput $(GPI_ARGS) $(COCOTB_TOPLEVEL) $(EXTRA_TOPS)" >> $@
65
63
  @echo "run -all" >> $@
66
64
  @echo "endsim" >> $@
67
65
 
@@ -69,11 +67,6 @@ $(COCOTB_RESULTS_FILE): $(SIM_BUILD)/runsim.do $(CUSTOM_COMPILE_DEPS) $(CUSTOM_S
69
67
  $(RM) $(COCOTB_RESULTS_FILE)
70
68
 
71
69
  set -o pipefail; GPI_EXTRA=$(GPI_EXTRA) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
72
- MODULE=$(MODULE) TESTCASE=$(TESTCASE) TOPLEVEL=$(TOPLEVEL) $(SIM_CMD_PREFIX) $(CMD) $(RUN_ARGS) -do $(SIM_BUILD)/runsim.do $(SIM_CMD_SUFFIX)
73
-
74
- $(call check_for_results_file)
70
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) $(SIM_CMD_PREFIX) $(CMD) $(RUN_ARGS) -do $(SIM_BUILD)/runsim.do $(SIM_CMD_SUFFIX)
75
71
 
76
- clean::
77
- $(RM) -r $(SIM_BUILD)
78
- $(RM) -r work
79
- $(RM) -r wave.asdb
72
+ $(call check_results)
@@ -0,0 +1,61 @@
1
+ # Copyright cocotb contributors
2
+ # Copyright (c) 2014 Potential Ventures Ltd
3
+ # Licensed under the Revised BSD License, see LICENSE for details.
4
+ # SPDX-License-Identifier: BSD-3-Clause
5
+
6
+ ifneq ($(VHDL_SOURCES),)
7
+
8
+ $(COCOTB_RESULTS_FILE):
9
+ @echo "Skipping simulation as VHDL is not supported on simulator=$(SIM)"
10
+ debug: $(COCOTB_RESULTS_FILE)
11
+
12
+ else
13
+
14
+ CMD_BIN := cvc64
15
+
16
+ ifdef CVC_BIN_DIR
17
+ CMD := $(shell :; command -v $(CVC_BIN_DIR)/$(CMD_BIN) 2>/dev/null)
18
+ else
19
+ # auto-detect bin dir from system path
20
+ CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
21
+ CVC_BIN_DIR := $(shell dirname $(CMD))
22
+ endif
23
+
24
+ #only interpreted mode works for the moment
25
+ CVC_ITERP ?= 1
26
+
27
+ ifeq ($(CVC_ITERP),1)
28
+ CVC_ARGS += +interp
29
+ endif
30
+
31
+ # Compilation phase
32
+ $(SIM_BUILD)/sim.vvp: $(VERILOG_SOURCES) $(CUSTOM_COMPILE_DEPS) | $(SIM_BUILD)
33
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) \
34
+ COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
35
+ $(CMD) $(CVC_ARGS) +acc+2 -o $(SIM_BUILD)/sim.vvp +loadvpi=$(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vpi cvc):vlog_startup_routines_bootstrap $(COMPILE_ARGS) $(EXTRA_ARGS) $(VERILOG_SOURCES)
36
+
37
+ # Execution phase
38
+ ifeq ($(CVC_ITERP),1)
39
+ $(COCOTB_RESULTS_FILE): $(SIM_BUILD)/sim.vvp
40
+ else
41
+ $(COCOTB_RESULTS_FILE): $(SIM_BUILD)/sim.vvp $(CUSTOM_SIM_DEPS)
42
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) \
43
+ COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
44
+ $(SIM_CMD_PREFIX) $(SIM_BUILD)/sim.vvp $(SIM_ARGS) $(EXTRA_ARGS) $(call deprecate,PLUSARGS,COCOTB_PLUSARGS) $(SIM_CMD_SUFFIX)
45
+ endif
46
+
47
+ # Execution phase
48
+ ifeq ($(CVC_ITERP),1)
49
+ debug: $(CUSTOM_SIM_DEPS)
50
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) \
51
+ COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
52
+ $(SIM_CMD_PREFIX) gdb --args $(CMD) $(CVC_ARGS) +acc+2 -o $(SIM_BUILD)/sim.vvp +loadvpi=$(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vpi cvc):vlog_startup_routines_bootstrap $(COMPILE_ARGS) $(EXTRA_ARGS) $(VERILOG_SOURCES)
53
+ else
54
+ debug: $(SIM_BUILD)/sim.vvp $(CUSTOM_SIM_DEPS)
55
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) \
56
+ COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
57
+ gdb --args $(SIM_BUILD)/sim.vvp $(SIM_ARGS) $(EXTRA_ARGS) $(call deprecate,PLUSARGS,COCOTB_PLUSARGS)
58
+ endif
59
+
60
+
61
+ endif
@@ -0,0 +1,39 @@
1
+ # Copyright cocotb contributors
2
+ # Licensed under the Revised BSD License, see LICENSE for details.
3
+ # SPDX-License-Identifier: BSD-3-Clause
4
+
5
+ CMD_BIN := dsim
6
+
7
+ ifdef DSIM_BIN_DIR
8
+ CMD := $(shell :; command -v $(DSIM_BIN_DIR)/$(CMD_BIN) 2>/dev/null)
9
+ else
10
+ # auto-detect bin dir from system path
11
+ CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
12
+ endif
13
+
14
+ ifeq (, $(CMD))
15
+ $(error Unable to locate command >$(CMD_BIN)<)
16
+ endif
17
+
18
+ ifeq ($(WAVES), 1)
19
+ WAVE_ARG := -waves file.vcd
20
+ else
21
+ WAVE_ARG :=
22
+ endif
23
+
24
+ TOPMODULE_ARG = -top $(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL)
25
+
26
+ DSIM_ARGS = -work $(SIM_BUILD) -pli_lib $(shell cocotb-config --lib-name-path vpi dsim) +acc+rwcbfsWF
27
+ COMP_ARGS = $(DSIM_ARGS) -genimage image -timescale $(COCOTB_HDL_TIMEUNIT)/$(COCOTB_HDL_TIMEPRECISION)
28
+ RUN_ARGS = $(DSIM_ARGS) -image image $(WAVE_ARG)
29
+
30
+ $(SIM_BUILD)/image.so: $(VERILOG_SOURCES) $(CUSTOM_COMPILE_DEPS)
31
+ $(SIM_CMD_PREFIX) $(CMD) $(COMP_ARGS) $(TOPMODULE_ARG) $(EXTRA_ARGS) $(VERILOG_SOURCES)
32
+
33
+ $(COCOTB_RESULTS_FILE): $(SIM_BUILD)/image.so $(CUSTOM_SIM_DEPS)
34
+ $(RM) $(COCOTB_RESULTS_FILE)
35
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) \
36
+ GPI_EXTRA=$(GPI_EXTRA) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
37
+ $(SIM_CMD_PREFIX) $(CMD) $(RUN_ARGS) $(TOPMODULE_ARG) $(EXTRA_ARGS) $(VERILOG_SOURCES)
38
+
39
+ $(call check_results)
@@ -1,40 +1,14 @@
1
- ###############################################################################
1
+ # Copyright cocotb contributors
2
2
  # Copyright (c) 2014 Potential Ventures Ltd
3
- # All rights reserved.
4
- #
5
- # Redistribution and use in source and binary forms, with or without
6
- # modification, are permitted provided that the following conditions are met:
7
- # * Redistributions of source code must retain the above copyright
8
- # notice, this list of conditions and the following disclaimer.
9
- # * Redistributions in binary form must reproduce the above copyright
10
- # notice, this list of conditions and the following disclaimer in the
11
- # documentation and/or other materials provided with the distribution.
12
- # * Neither the name of Potential Ventures Ltd,
13
- # SolarFlare Communications Inc nor the
14
- # names of its contributors may be used to endorse or promote products
15
- # derived from this software without specific prior written permission.
16
- #
17
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
- # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
- # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- # DISCLAIMED. IN NO EVENT SHALL POTENTIAL VENTURES LTD BE LIABLE FOR ANY
21
- # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
- # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
- # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
- # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
- # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
- ###############################################################################
3
+ # Licensed under the Revised BSD License, see LICENSE for details.
4
+ # SPDX-License-Identifier: BSD-3-Clause
28
5
 
29
6
  TOPLEVEL_LANG ?= vhdl
30
7
 
31
- include $(shell cocotb-config --makefiles)/Makefile.inc
32
-
33
8
  ifneq ($(or $(filter-out $(TOPLEVEL_LANG),vhdl),$(VERILOG_SOURCES)),)
34
9
 
35
10
  $(COCOTB_RESULTS_FILE):
36
11
  @echo "Skipping simulation as only VHDL is supported on simulator=$(SIM)"
37
- clean::
38
12
 
39
13
  else
40
14
 
@@ -45,16 +19,15 @@ ifdef GHDL_BIN_DIR
45
19
  else
46
20
  # auto-detect bin dir from system path
47
21
  CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
22
+ GHDL_BIN_DIR := $(shell dirname $(CMD))
48
23
  endif
49
24
 
50
- ifeq (, $(CMD))
51
- $(error Unable to locate command >$(CMD_BIN)<)
25
+ ifdef RTL_LIBRARY
26
+ $(warning Using RTL_LIBRARY is deprecated, please use TOPLEVEL_LIBRARY instead.)
27
+ TOPLEVEL_LIBRARY ?= $(RTL_LIBRARY)
52
28
  else
53
- GHDL_BIN_DIR := $(shell dirname $(CMD))
54
- export GHDL_BIN_DIR
29
+ TOPLEVEL_LIBRARY ?= work
55
30
  endif
56
-
57
- RTL_LIBRARY ?= work
58
31
  GHDL_ARGS ?=
59
32
  GHDL_ARGS += $(EXTRA_ARGS)
60
33
 
@@ -97,17 +70,15 @@ endif
97
70
  analyse: $(VHDL_SOURCES) $(CUSTOM_COMPILE_DEPS) | $(SIM_BUILD)
98
71
  $(foreach SOURCES_VAR, $(filter VHDL_SOURCES_%, $(.VARIABLES)), \
99
72
  $(CMD) -i $(GHDL_ARGS) $(COMPILE_ARGS) --workdir=$(SIM_BUILD) --work=$(SOURCES_VAR:VHDL_SOURCES_%=%) $($(SOURCES_VAR)) && ) \
100
- $(CMD) -i $(GHDL_ARGS) $(COMPILE_ARGS) --workdir=$(SIM_BUILD) --work=$(RTL_LIBRARY) $(VHDL_SOURCES) && \
101
- $(CMD) -m $(GHDL_ARGS) $(COMPILE_ARGS) --workdir=$(SIM_BUILD) -P$(SIM_BUILD) --work=$(RTL_LIBRARY) $(TOPLEVEL)
73
+ $(CMD) -i $(GHDL_ARGS) $(COMPILE_ARGS) --workdir=$(SIM_BUILD) --work=$(TOPLEVEL_LIBRARY) $(VHDL_SOURCES) && \
74
+ $(CMD) -m $(GHDL_ARGS) $(COMPILE_ARGS) --workdir=$(SIM_BUILD) -P$(SIM_BUILD) --work=$(TOPLEVEL_LIBRARY) $(COCOTB_TOPLEVEL) $(ARCH)
102
75
 
103
76
  $(COCOTB_RESULTS_FILE): analyse $(CUSTOM_SIM_DEPS)
104
77
  $(RM) $(COCOTB_RESULTS_FILE)
105
78
 
106
- MODULE=$(MODULE) TESTCASE=$(TESTCASE) TOPLEVEL=$(TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
107
- $(SIM_CMD_PREFIX) $(CMD) -r $(GHDL_ARGS) $(GHDL_RUN_ARGS) --workdir=$(SIM_BUILD) -P$(SIM_BUILD) --work=$(RTL_LIBRARY) $(TOPLEVEL) $(ARCH) --vpi=$(shell cocotb-config --lib-name-path vpi ghdl) $(SIM_ARGS) $(PLUSARGS) $(SIM_CMD_SUFFIX)
79
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
80
+ $(SIM_CMD_PREFIX) $(CMD) -r $(GHDL_ARGS) $(GHDL_RUN_ARGS) --workdir=$(SIM_BUILD) -P$(SIM_BUILD) --work=$(TOPLEVEL_LIBRARY) $(COCOTB_TOPLEVEL) $(ARCH) --vpi=$(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vpi ghdl) $(SIM_ARGS) $(call deprecate,PLUSARGS,COCOTB_PLUSARGS) $(SIM_CMD_SUFFIX)
108
81
 
109
- $(call check_for_results_file)
82
+ $(call check_results)
110
83
 
111
- clean::
112
- $(RM) -r $(SIM_BUILD)
113
84
  endif
@@ -0,0 +1,80 @@
1
+ # Copyright cocotb contributors
2
+ # Copyright (c) 2013 Potential Ventures Ltd
3
+ # Copyright (c) 2013 SolarFlare Communications Inc
4
+ # Licensed under the Revised BSD License, see LICENSE for details.
5
+ # SPDX-License-Identifier: BSD-3-Clause
6
+
7
+ TOPLEVEL_LANG ?= verilog
8
+
9
+ ifneq ($(or $(filter-out $(TOPLEVEL_LANG),verilog),$(VHDL_SOURCES)),)
10
+
11
+ $(COCOTB_RESULTS_FILE):
12
+ @echo "Skipping simulation as only Verilog is supported on simulator=$(SIM)"
13
+ debug: $(COCOTB_RESULTS_FILE)
14
+
15
+ else
16
+
17
+ CMD_BIN := iverilog
18
+
19
+ ifdef ICARUS_BIN_DIR
20
+ CMD := $(shell :; command -v $(ICARUS_BIN_DIR)/$(CMD_BIN) 2>/dev/null)
21
+ else
22
+ # auto-detect bin dir from system path
23
+ CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
24
+ ICARUS_BIN_DIR := $(shell dirname $(CMD))
25
+ endif
26
+
27
+ ifdef COCOTB_TOPLEVEL
28
+ TOPMODULE_ARG := -s $(COCOTB_TOPLEVEL)
29
+ else
30
+ TOPMODULE_ARG :=
31
+ endif
32
+
33
+ COMPILE_ARGS += -f $(SIM_BUILD)/cmds.f
34
+
35
+ ifdef VERILOG_INCLUDE_DIRS
36
+ COMPILE_ARGS += $(addprefix -I, $(VERILOG_INCLUDE_DIRS))
37
+ endif
38
+
39
+ # Compilation phase
40
+
41
+ ifeq ($(WAVES), 1)
42
+ VERILOG_SOURCES += $(SIM_BUILD)/cocotb_iverilog_dump.v
43
+ COMPILE_ARGS += -s cocotb_iverilog_dump
44
+ FST = -fst
45
+ else
46
+ # Disable waveform output
47
+ FST = -none
48
+ endif
49
+
50
+ $(SIM_BUILD)/sim.vvp: $(VERILOG_SOURCES) $(CUSTOM_COMPILE_DEPS) | $(SIM_BUILD)
51
+ @echo "+timescale+$(COCOTB_HDL_TIMEUNIT)/$(COCOTB_HDL_TIMEPRECISION)" > $(SIM_BUILD)/cmds.f
52
+ $(CMD) -o $(SIM_BUILD)/sim.vvp $(TOPMODULE_ARG) -g2012 $(COMPILE_ARGS) $(EXTRA_ARGS) $(VERILOG_SOURCES)
53
+
54
+ $(SIM_BUILD)/cocotb_iverilog_dump.v: | $(SIM_BUILD)
55
+ @echo 'module cocotb_iverilog_dump();' > $@
56
+ @echo 'initial begin' >> $@
57
+ @echo ' $$dumpfile("$(SIM_BUILD)/$(COCOTB_TOPLEVEL).fst");' >> $@
58
+ @echo ' $$dumpvars(0, $(COCOTB_TOPLEVEL));' >> $@
59
+ @echo 'end' >> $@
60
+ @echo 'endmodule' >> $@
61
+
62
+ # Execution phase
63
+
64
+ $(COCOTB_RESULTS_FILE): $(SIM_BUILD)/sim.vvp $(CUSTOM_SIM_DEPS)
65
+ $(RM) $(COCOTB_RESULTS_FILE)
66
+
67
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
68
+ $(SIM_CMD_PREFIX) $(ICARUS_BIN_DIR)/vvp -M $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-dir) -m $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name vpi icarus) $(SIM_ARGS) $(EXTRA_ARGS) $(SIM_BUILD)/sim.vvp $(call deprecate,PLUSARGS,COCOTB_PLUSARGS) $(FST) $(SIM_CMD_SUFFIX)
69
+
70
+ $(call check_results)
71
+
72
+ debug: $(SIM_BUILD)/sim.vvp $(CUSTOM_SIM_DEPS)
73
+ $(RM) -r $(COCOTB_RESULTS_FILE)
74
+
75
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
76
+ $(SIM_CMD_PREFIX) gdb --args $(ICARUS_BIN_DIR)/vvp -M $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-dir) -m $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name vpi icarus) $(SIM_BUILD)/sim.vvp $(SIM_ARGS) $(EXTRA_ARGS) $(call deprecate,PLUSARGS,COCOTB_PLUSARGS) $(FST) $(SIM_CMD_SUFFIX)
77
+
78
+ $(call check_results)
79
+
80
+ endif
@@ -0,0 +1,93 @@
1
+ # Copyright cocotb contributors
2
+ # Copyright (c) 2013 Potential Ventures Ltd
3
+ # Copyright (c) 2013 SolarFlare Communications Inc
4
+ # Licensed under the Revised BSD License, see LICENSE for details.
5
+ # SPDX-License-Identifier: BSD-3-Clause
6
+
7
+ # Common Makefile for Cadence Incisive
8
+
9
+ CMD_BIN := irun
10
+
11
+ ifdef IUS_BIN_DIR
12
+ CMD := $(shell :; command -v $(IUS_BIN_DIR)/$(CMD_BIN) 2>/dev/null)
13
+ else
14
+ # auto-detect bin dir from system path
15
+ CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
16
+ IUS_BIN_DIR := $(shell dirname $(CMD))
17
+ endif
18
+
19
+ ifdef VERILOG_INCLUDE_DIRS
20
+ COMPILE_ARGS += $(addprefix +incdir+, $(VERILOG_INCLUDE_DIRS))
21
+ endif
22
+
23
+ EXTRA_ARGS += $(COMPILE_ARGS)
24
+ EXTRA_ARGS += $(SIM_ARGS)
25
+ EXTRA_ARGS += -licqueue
26
+
27
+ ifeq ($(PYTHON_ARCH),64bit)
28
+ EXTRA_ARGS += -64
29
+ endif
30
+
31
+ EXTRA_ARGS += -nclibdirpath $(SIM_BUILD)
32
+ EXTRA_ARGS += -plinowarn
33
+
34
+ ifeq ($(GUI),1)
35
+ EXTRA_ARGS += -gui
36
+ else
37
+ EXTRA_ARGS +=
38
+ endif
39
+
40
+ # IUS errors out if multiple timescales are specified on the command line.
41
+ ifneq (,$(findstring timescale,$(EXTRA_ARGS)))
42
+ $(error Please use COCOTB_HDL_TIMEUNIT and COCOTB_HDL_TIMEPRECISION to specify timescale.)
43
+ endif
44
+
45
+ # Loading the VHPI library causes an error, so we always load the VPI library and supply
46
+ # GPI_EXTRA=$(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vhpi ius) if needed.
47
+
48
+ # Xcelium will use default vlog_startup_routines symbol only if vpi library name is libvpi.so
49
+ GPI_ARGS = -loadvpi $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vpi ius):vlog_startup_routines_bootstrap
50
+
51
+ ifeq ($(TOPLEVEL_LANG),verilog)
52
+ EXTRA_ARGS += -v93
53
+ HDL_SOURCES = $(VERILOG_SOURCES)
54
+ ROOT_LEVEL = $(COCOTB_TOPLEVEL)
55
+ ifneq ($(VHDL_SOURCES),)
56
+ HDL_SOURCES += $(VHDL_SOURCES)
57
+ GPI_EXTRA = $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vhpi ius):cocotbvhpi_entry_point
58
+ endif
59
+ else ifeq ($(TOPLEVEL_LANG),vhdl)
60
+ GPI_EXTRA = $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vhpi ius):cocotbvhpi_entry_point
61
+ EXTRA_ARGS += -v93
62
+ EXTRA_ARGS += -top $(COCOTB_TOPLEVEL)
63
+ ifdef RTL_LIBRARY
64
+ $(warning Using RTL_LIBRARY is deprecated, please use TOPLEVEL_LIBRARY instead.)
65
+ TOPLEVEL_LIBRARY ?= $(RTL_LIBRARY)
66
+ else
67
+ TOPLEVEL_LIBRARY ?= work
68
+ endif
69
+ MAKE_LIB = -makelib $(TOPLEVEL_LIBRARY)
70
+ HDL_SOURCES = $(VHDL_SOURCES)
71
+ ifneq ($(VERILOG_SOURCES),)
72
+ HDL_SOURCES += $(VERILOG_SOURCES)
73
+ endif
74
+ else
75
+ $(error A valid value (verilog or vhdl) was not provided for TOPLEVEL_LANG=$(TOPLEVEL_LANG))
76
+ endif
77
+
78
+ # Builds a list of arguments to support VHDL libraries specified in VHDL_SOURCES_*:
79
+ LIBS := $(foreach LIB, $(VHDL_LIB_ORDER),-makelib $(LIB) $(VHDL_SOURCES_$(LIB)) -endlib)
80
+
81
+ $(COCOTB_RESULTS_FILE): $(HDL_SOURCES) $(CUSTOM_COMPILE_DEPS) $(CUSTOM_SIM_DEPS) | $(SIM_BUILD)
82
+ $(RM) $(COCOTB_RESULTS_FILE)
83
+
84
+ # Make sure all libs in SOURCES_VHDL_* are mentioned in VHDL_LIB_ORDER and vice versa
85
+ $(foreach LIB, $(VHDL_LIB_ORDER), $(check_vhdl_sources))
86
+ $(foreach SOURCES_VAR, $(filter VHDL_SOURCES_%, $(.VARIABLES)), $(check_lib_order))
87
+
88
+ set -o pipefail; \
89
+ COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) GPI_EXTRA=$(GPI_EXTRA) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
90
+ $(SIM_CMD_PREFIX) $(CMD) -timescale $(COCOTB_HDL_TIMEUNIT)/$(COCOTB_HDL_TIMEPRECISION) \
91
+ $(EXTRA_ARGS) $(GPI_ARGS) +access+rwc $(LIBS) $(MAKE_LIB) $(HDL_SOURCES) $(call deprecate,PLUSARGS,COCOTB_PLUSARGS) $(SIM_CMD_SUFFIX)
92
+
93
+ $(call check_results)
@@ -0,0 +1,9 @@
1
+ # Copyright cocotb contributors
2
+ # Copyright (c) 2013 Potential Ventures Ltd
3
+ # Copyright (c) 2013 SolarFlare Communications Inc
4
+ # Licensed under the Revised BSD License, see LICENSE for details.
5
+ # SPDX-License-Identifier: BSD-3-Clause
6
+
7
+
8
+ # Identical to Questa with the compat flow.
9
+ include $(COCOTB_MAKEFILES_DIR)/simulators/Makefile.questa-compat
@@ -0,0 +1,60 @@
1
+ # Copyright cocotb contributors
2
+ # Licensed under the Revised BSD License, see LICENSE for details.
3
+ # SPDX-License-Identifier: BSD-3-Clause
4
+
5
+ ifneq ($(VERILOG_SOURCES),)
6
+
7
+ $(COCOTB_RESULTS_FILE):
8
+ @echo "Skipping simulation as Verilog is not supported on simulator=$(SIM)"
9
+
10
+ else
11
+
12
+ CMD_BIN := nvc
13
+
14
+ ifdef NVC_BIN_DIR
15
+ CMD := $(shell :; command -v $(NVC_BIN_DIR)/$(CMD_BIN) 2>/dev/null)
16
+ else
17
+ # auto-detect bin dir from system path
18
+ CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
19
+ NVC_BIN_DIR := $(shell dirname $(CMD))
20
+ endif
21
+
22
+ PRESERVE_CASE := $(shell $(CMD) --version | $(PYTHON_BIN) -c "from cocotb_tools.sim_versions import NvcVersion; import sys; print('--preserve-case' if NvcVersion.from_commandline(sys.stdin.read()) > NvcVersion('1.16') else '')")
23
+
24
+ ifdef RTL_LIBRARY
25
+ $(warning Using RTL_LIBRARY is deprecated, please use TOPLEVEL_LIBRARY instead.)
26
+ TOPLEVEL_LIBRARY ?= $(RTL_LIBRARY)
27
+ else
28
+ TOPLEVEL_LIBRARY ?= work
29
+ endif
30
+
31
+ .PHONY: analyse
32
+
33
+ # Split SIM_ARGS into those options that need to be passed to -e and
34
+ # those that need to be passed to -r
35
+ NVC_E_FILTER := -g% --cover --cover=%
36
+
37
+ NVC_E_ARGS := $(filter $(NVC_E_FILTER),$(SIM_ARGS))
38
+ NVC_R_ARGS := $(filter-out $(NVC_E_FILTER),$(SIM_ARGS))
39
+
40
+ # Compilation phase
41
+ analyse: $(VHDL_SOURCES) $(SIM_BUILD) $(CUSTOM_COMPILE_DEPS)
42
+ # Make sure all libs in SOURCES_VHDL_* are mentioned in VHDL_LIB_ORDER and vice versa
43
+ $(foreach LIB, $(VHDL_LIB_ORDER), $(check_vhdl_sources))
44
+ $(foreach SOURCES_VAR, $(filter VHDL_SOURCES_%, $(.VARIABLES)), $(check_lib_order))
45
+
46
+ $(foreach LIB_VAR,$(VHDL_LIB_ORDER), \
47
+ $(CMD) $(EXTRA_ARGS) --work=$(LIB_VAR):$(SIM_BUILD)/$(LIB_VAR) -L $(SIM_BUILD) -a $(VHDL_SOURCES_$(LIB_VAR)) $(PRESERVE_CASE) $(COMPILE_ARGS) && ) \
48
+ $(CMD) $(EXTRA_ARGS) --work=$(TOPLEVEL_LIBRARY):$(SIM_BUILD)/$(TOPLEVEL_LIBRARY) -L $(SIM_BUILD) -a $(VHDL_SOURCES) $(PRESERVE_CASE) $(COMPILE_ARGS)
49
+
50
+ $(COCOTB_RESULTS_FILE): analyse $(CUSTOM_SIM_DEPS)
51
+ $(RM) $(COCOTB_RESULTS_FILE)
52
+
53
+ COCOTB_TESTCASE=$(call deprecate,TESTCASE,COCOTB_TESTCASE) COCOTB_TEST_FILTER=$(COCOTB_TEST_FILTER) COCOTB_TEST_MODULES=$(call deprecate,MODULE,COCOTB_TEST_MODULES) COCOTB_TOPLEVEL=$(call deprecate,TOPLEVEL,COCOTB_TOPLEVEL) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
54
+ $(SIM_CMD_PREFIX) $(CMD) $(EXTRA_ARGS) --work=$(TOPLEVEL_LIBRARY):$(SIM_BUILD)/$(TOPLEVEL_LIBRARY) -L $(SIM_BUILD) \
55
+ -e $(COCOTB_TOPLEVEL) --no-save $(NVC_E_ARGS) \
56
+ -r --load $(shell $(PYTHON_BIN) -m cocotb_tools.config --lib-name-path vhpi nvc) $(TRACE) $(NVC_R_ARGS) $(call deprecate,PLUSARGS,COCOTB_PLUSARGS) $(SIM_CMD_SUFFIX)
57
+
58
+ $(call check_results)
59
+
60
+ endif
@@ -0,0 +1,29 @@
1
+ # Copyright cocotb contributors
2
+ # Licensed under the Revised BSD License, see LICENSE for details.
3
+ # SPDX-License-Identifier: BSD-3-Clause
4
+
5
+ # Detect the version of Questa in use to choose the best flow.
6
+
7
+ CMD_BIN := vsim
8
+
9
+ ifdef MODELSIM_BIN_DIR
10
+ CMD := $(shell :; command -v $(MODELSIM_BIN_DIR)/$(CMD_BIN) 2>/dev/null)
11
+ else
12
+ # auto-detect bin dir from system path
13
+ CMD := $(shell :; command -v $(CMD_BIN) 2>/dev/null)
14
+ endif
15
+
16
+ # Determine the version of Questa being used.
17
+ QUESTA_VERSION := $(shell $(CMD) -version | $(PYTHON_BIN) -c 'import re,sys; print(re.sub(r".+vsim (\d+)\.(\d).+", "\\1 \\2", sys.stdin.read()))')
18
+ QUESTA_VERSION_MAJOR := $(firstword $(QUESTA_VERSION))
19
+ QUESTA_VERSION_MINOR := $(lastword $(QUESTA_VERSION))
20
+
21
+ # Use the QIS/Qrun flow for Questa >= 2025.2 (the first version which fully
22
+ # passes the cocotb regression suite). Use the compat flow otherwise.
23
+ ifeq ($(shell test $(QUESTA_VERSION_MAJOR)$(QUESTA_VERSION_MINOR) -lt 20252; echo $$?),0)
24
+ $(info Using the Questa compat flow for Questa version $(QUESTA_VERSION_MAJOR).$(QUESTA_VERSION_MINOR) < 2025.2. Run make with SIM=questa-qisqrun to force the newer QIS/Qrun flow.)
25
+ include $(COCOTB_MAKEFILES_DIR)/simulators/Makefile.questa-compat
26
+ else
27
+ $(info Using the Questa QIS/Qrun flow for Questa $(QUESTA_VERSION_MAJOR).$(QUESTA_VERSION_MINOR) >= 2025.2. Run make with SIM=questa-compat for the compat flow.)
28
+ include $(COCOTB_MAKEFILES_DIR)/simulators/Makefile.questa-qisqrun
29
+ endif