from c4m.cocotb.jtag.c4m_jtag import JTAG_Master
from c4m.cocotb.jtag.c4m_jtag_svfcocotb import SVF_Executor
+from itertools import chain
+
+import cocotb
+from cocotb.clock import Clock
+from cocotb.triggers import Timer
+from cocotb.utils import get_sim_steps
+from cocotb.binary import BinaryValue
+
+from c4m.nmigen.jtag.tap import IOType
+from c4m.cocotb.jtag.c4m_jtag import JTAG_Master
+from c4m.cocotb.jtag.c4m_jtag_svfcocotb import SVF_Executor
+
+from soc.config.pinouts import get_pinspecs
+from soc.debug.jtag import Pins
+
#
# Helper functions
#
dut.iovss <= 0
dut.sys_rst <= 1
dut.sys_clk <= 0
+ # adder test (ignore)
+ #dut.a <= 3
+ #dut.b <= 2
+
if run:
yield Timer(int(10.5*clk_steps))
dut.sys_rst <= 0
# Make this a generator
if False:
yield Timer(0)
+ clk_steps = get_sim_steps(tck_period, "ns")
return JTAG_Master(dut.jtag_tck, dut.jtag_tms,
dut.jtag_tdi, dut.jtag_tdo,
- clk_period=tck_period,
+ clk_period=clk_steps,
ir_width=4)
def execute_svf(dut, *, jtag, svf_filename):
dut._log.info("IDCODE test completed")
@cocotb.test()
-def idcode_run(dut):
+def idcode_run_svf(dut):
dut._log.info("Running IDCODE through test; cpu running...")
clk_period = 100 # 10MHz
dut._log.info("IDCODE test completed")
-from itertools import chain
-
-import cocotb
-from cocotb.clock import Clock
-from cocotb.triggers import Timer
-from cocotb.utils import get_sim_steps
-from cocotb.binary import BinaryValue
-
-from c4m.nmigen.jtag.tap import IOType
-from c4m.cocotb.jtag.c4m_jtag import JTAG_Master
-from c4m.cocotb.jtag.c4m_jtag_svfcocotb import SVF_Executor
-
-from soc.config.pinouts import get_pinspecs
-from soc.debug.jtag import Pins
-
@cocotb.test()
def wishbone_basic(dut):