コード例 #1
0
def test_virtualprobe_debugmbox():
    vp = DebugProbeVirtual("ID", None)
    with pytest.raises(DebugProbeNotOpenError):
        vp.dbgmlbx_reg_read(0)
    with pytest.raises(DebugProbeNotOpenError):
        vp.dbgmlbx_reg_write(0, 0)

    vp.open()

    assert vp.dbgmlbx_reg_read(0) == 0
    vp.dbgmlbx_reg_write(0, 1)
    assert vp.dbgmlbx_reg_read(0) == 1

    vp.dbgmlbx_reg_write(0, 1)
    assert vp.dbgmlbx_reg_read(0) == 1

    vp.set_coresight_ap_substitute_data({0x02000000: [2, 3]})
    assert vp.dbgmlbx_reg_read(0) == 2
    assert vp.dbgmlbx_reg_read(0) == 3
    assert vp.dbgmlbx_reg_read(0) == 1
コード例 #2
0
def test_virtualprobe_debugmbox():
    """Test of virtual Debug Probe - Debug mailbox API."""
    virtual_probe = DebugProbeVirtual("ID", None)
    with pytest.raises(SPSDKDebugProbeNotOpenError):
        virtual_probe.dbgmlbx_reg_read(0)
    with pytest.raises(SPSDKDebugProbeNotOpenError):
        virtual_probe.dbgmlbx_reg_write(0, 0)

    virtual_probe.open()

    assert virtual_probe.dbgmlbx_reg_read(0) == 0
    virtual_probe.dbgmlbx_reg_write(0, 1)
    assert virtual_probe.dbgmlbx_reg_read(0) == 1

    virtual_probe.dbgmlbx_reg_write(0, 1)
    assert virtual_probe.dbgmlbx_reg_read(0) == 1

    virtual_probe.set_coresight_ap_substitute_data({0x02000000: [2, 3]})
    assert virtual_probe.dbgmlbx_reg_read(0) == 2
    assert virtual_probe.dbgmlbx_reg_read(0) == 3
    assert virtual_probe.dbgmlbx_reg_read(0) == 1