class JTAG(Elaboratable):
@staticmethod
def _add_files(platform, prefix):
- d = os.path.realpath("{0}{1}{2}{1}vhdl".format(
- os.path.dirname(__file__), os.path.sep, os.path.pardir
+ d = os.path.realpath("{dir}{sep}{par}{sep}{par}{sep}vhdl{sep}jtag".format(
+ dir=os.path.dirname(__file__), sep=os.path.sep, par=os.path.pardir
)) + os.path.sep
for fname in [
"c4m_jtag_pkg.vhdl",
-PWD=$(realpath .)
+CURDIR=$(realpath .)
TOPDIR=$(realpath ../../..)
-VHDLDIR=$(TOPDIR)/rtl/vhdl
+
+ifeq ($(PYTHONPATH),)
+ PYTHONPATH := $(TOPDIR)
+else
+ PYTHONPATH := $(TOPDIR):$(PYTHONPATH)
+endif
+export PYTHONPATH
+
+VHDLDIR=$(TOPDIR)/c4m/vhdl/jtag
VHDL_SOURCES = \
$(VHDLDIR)/c4m_jtag_pkg.vhdl \
$(VHDLDIR)/c4m_jtag_tap_fsm.vhdl \
GPI_IMPL=vhpi
SIM_ARGS=--wave=test.ghw
-COCOTBDIR=$(shell cocotb-path)
+COCOTBMAKEFILESDIR=$(shell cocotb-config --makefiles)
-include $(COCOTBDIR)/makefiles/Makefile.inc
-include $(COCOTBDIR)/makefiles/Makefile.sim
+include $(COCOTBMAKEFILESDIR)/Makefile.inc
+include $(COCOTBMAKEFILESDIR)/Makefile.sim
+++ /dev/null
-../c4m_jtag.py
\ No newline at end of file
from cocotb.utils import get_sim_steps
from cocotb.binary import BinaryValue
-from c4m_jtag import JTAG_Master
+from c4m.cocotb.jtag.c4m_jtag import JTAG_Master
@cocotb.test()
def test01_idcode(dut):
-PWD=$(realpath .)
+CURDIR=$(realpath .)
TOPDIR=$(realpath ../../..)
-VHDLDIR=$(TOPDIR)/rtl/vhdl
+
+ifeq ($(PYTHONPATH),)
+ PYTHONPATH := $(TOPDIR)
+else
+ PYTHONPATH := $(TOPDIR):$(PYTHONPATH)
+endif
+export PYTHONPATH
+
+VHDLDIR=$(TOPDIR)/c4m/vhdl/jtag
VHDL_SOURCES = \
$(VHDLDIR)/c4m_jtag_pkg.vhdl \
$(VHDLDIR)/c4m_jtag_tap_fsm.vhdl \
$(VHDLDIR)/c4m_jtag_ioblock.vhdl \
$(VHDLDIR)/c4m_jtag_idblock.vhdl \
$(VHDLDIR)/c4m_jtag_tap_controller.vhdl \
- $(PWD)/dual_parallel.vhdl
+ $(CURDIR)/dual_parallel.vhdl
TOPLEVEL=dual_parallel
TOPLEVEL_LANG=vhdl
MODULE=test
GPI_IMPL=vhpi
SIM_ARGS=--wave=test.ghw
-COCOTBDIR=$(shell cocotb-path)
+COCOTBMAKEFILESDIR=$(shell cocotb-config --makefiles)
-include $(COCOTBDIR)/makefiles/Makefile.inc
-include $(COCOTBDIR)/makefiles/Makefile.sim
+include $(COCOTBMAKEFILESDIR)/Makefile.inc
+include $(COCOTBMAKEFILESDIR)/Makefile.sim
+++ /dev/null
-../c4m_jtag.py
\ No newline at end of file
import cocotb
from cocotb.utils import get_sim_steps
-from c4m_jtag import JTAG_Master
+from c4m.cocotb.jtag.c4m_jtag import JTAG_Master
@cocotb.test()
def test01_dual(dut):
#!/bin/sh
-ghdl -a --std=08 ../../rtl/vhdl/c4m_jtag_pkg.vhdl
-ghdl -a --std=08 ../../rtl/vhdl/c4m_jtag_tap_fsm.vhdl
-ghdl -a --std=08 ../../rtl/vhdl/c4m_jtag_irblock.vhdl
-ghdl -a --std=08 ../../rtl/vhdl/c4m_jtag_idblock.vhdl
-ghdl -a --std=08 ../../rtl/vhdl/c4m_jtag_iocell.vhdl
-ghdl -a --std=08 ../../rtl/vhdl/c4m_jtag_ioblock.vhdl
-ghdl -a --std=08 ../../rtl/vhdl/c4m_jtag_tap_controller.vhdl
-ghdl -a --std=08 ../../bench/vhdl/idcode.vhdl
-ghdl -r --std=08 bench_idcode --wave=bench_idcode.ghw
+vhdldir=`realpath ../../../c4m/vhdl/jtag`
+testvhdldir=`realpath ../../rtl/vhdl`
+opts=--std=08
+ghdl -a $opts $vhdldir/c4m_jtag_pkg.vhdl
+ghdl -a $opts $vhdldir/c4m_jtag_tap_fsm.vhdl
+ghdl -a $opts $vhdldir/c4m_jtag_irblock.vhdl
+ghdl -a $opts $vhdldir/c4m_jtag_idblock.vhdl
+ghdl -a $opts $vhdldir/c4m_jtag_iocell.vhdl
+ghdl -a $opts $vhdldir/c4m_jtag_ioblock.vhdl
+ghdl -a $opts $vhdldir/c4m_jtag_tap_controller.vhdl
+ghdl -a $opts $testvhdldir/idcode.vhdl
+ghdl -r $opts bench_idcode --wave=bench_idcode.ghw