📄 jtagchain.cpp
字号:
// JTAGChain.cpp: implementation of the CJTAGChain class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FluteD.h"
#include <string.h>
#include "Pin.h"
#include "Group.h"
#include "JTAGDev.h"
#include "JTAGPort.h"
#include "FCDFile.h"
#include "JTAGChain.h"
CJTAGChain::CJTAGChain()
{
nDevNumber = 0;
nChainLength = 0;
error = ERR_FALSE;
}
CJTAGChain::~CJTAGChain()
{
}
int CJTAGChain::SetDev(LPCTSTR strBSDLFile)
{
int result;
#ifdef _LOG
fprintf(lp, "JTAGChain::Add Device ...\n");
#endif
Device.Init(nInChain, nOutChain, nChainLength);
result = Device.SetBSDL(strBSDLFile);
if(result == ERR_FALSE)
{
nChainLength += Device.nBSRLength;
nDevNumber++;
}
else
{
AddLog(CString("Get BSDL ERROR !"));
AddLog(CString(" - ") + CString(strBSDLFile));
}
error = result;
return error;
}
int CJTAGChain::CheckDev(CJTAGPort & port)
{
AddLog("\n[Check Device ID]\n");
port.On();
port.Reset();
port.ScanIR( Device.nInstLength, Device.nInstIdcode);
error = Device.CheckID( port.GetIDR() );
port.Off();
if(port.error == ERR_TRUE)
{
error = ERR_TRUE;
return ERR_TRUE;
}
return error;
}
void CJTAGChain::SafeChain()
{
Device.SetSafe();
}
int CJTAGChain::Dump()
{
return Device.Dump();
}
int CJTAGChain::Setup(CFCDFile * fcd)
{
AddLog("\n[Setup Scan Chain]\n");
AddLog("Parse BSDL file ");
AddLog(fcd -> bsdl_file);
AddLog(" ... ");
if(SetDev(fcd -> bsdl_file) == ERR_FALSE)
{
AddLog("OK\n");
}
else
{
AddLog("Failed\n");
return error;
}
return error;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -