Add cocotb testbench for validating generated bus decoder RTL across APB3, APB4, and AXI4-Lite interfaces (#9)
* Initial plan * Add cocotb test infrastructure and testbenches for APB3, APB4, and AXI4-Lite Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Add integration tests, examples, and documentation for cocotb testbenches Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Address code review feedback: use relative imports and update installation docs Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Add implementation summary document Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Merge cocotb dependencies into test group Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Add optional cocotb simulation workflow with Icarus Verilog Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>
This commit is contained in:
39
tests/cocotb/Makefile.common
Normal file
39
tests/cocotb/Makefile.common
Normal file
@@ -0,0 +1,39 @@
|
||||
# Makefile for cocotb simulation
|
||||
# This makefile can be used to run cocotb tests with Icarus Verilog or other simulators
|
||||
|
||||
# Defaults
|
||||
SIM ?= icarus
|
||||
TOPLEVEL_LANG ?= verilog
|
||||
|
||||
# Project paths
|
||||
REPO_ROOT := $(shell git rev-parse --show-toplevel)
|
||||
HDL_SRC_DIR := $(REPO_ROOT)/hdl-src
|
||||
TEST_DIR := $(REPO_ROOT)/tests/cocotb
|
||||
COMMON_DIR := $(TEST_DIR)/common
|
||||
|
||||
# Python paths
|
||||
export PYTHONPATH := $(REPO_ROOT):$(TEST_DIR):$(PYTHONPATH)
|
||||
|
||||
# Simulator options
|
||||
COMPILE_ARGS += -g2012 # SystemVerilog 2012
|
||||
EXTRA_ARGS += --trace --trace-structs
|
||||
|
||||
# Common sources (interfaces)
|
||||
VERILOG_SOURCES += $(HDL_SRC_DIR)/apb4_intf.sv
|
||||
VERILOG_SOURCES += $(HDL_SRC_DIR)/apb3_intf.sv
|
||||
VERILOG_SOURCES += $(HDL_SRC_DIR)/axi4lite_intf.sv
|
||||
|
||||
# Test-specific configuration
|
||||
# These should be overridden by test-specific makefiles
|
||||
|
||||
# Example usage:
|
||||
# To run APB4 test:
|
||||
# make -f Makefile.apb4 test_simple
|
||||
#
|
||||
# To run all tests:
|
||||
# make -f Makefile.apb4 test
|
||||
# make -f Makefile.apb3 test
|
||||
# make -f Makefile.axi4lite test
|
||||
|
||||
# Include cocotb's make rules to build/run simulation
|
||||
include $(shell cocotb-config --makefiles)/Makefile.sim
|
||||
Reference in New Issue
Block a user