ictest 发表于 2009-7-7 09:47:28

在IC测试中如何应用欠采样理论进行波形的抓取

各位在实际的IC测试中有没有用过欠采样理论,在程序中如何实现,可否分享一下?

admin 发表于 2009-7-9 14:36:58

抛块砖头:欠采样在实际测试中用的不多,目前高端测试机采样频率已经很高,基本满足目前市场上的芯片测试,另外欠采样对所采波形有严格要求,不是所有的波形都可以用欠采样来实现

半仙 发表于 2009-7-22 17:26:34

&nbsp;有啊..其实J750里面和93k里面的用来量测PLL的输出频率都是用的欠采样理论实现的..<br/><br/>原理都差不多,就是设置输出全部都是H或者L..然后设定一个期望的范围, 如果有信号频率落在这个范围内,就判断pass.否则就是fail..<br/><br/>当如果输出频率在区间内有两个或两个以上的话, 就会报错..<br/><br/>这个是我所知道的欠采样的唯一应用了...<br/>

ictest 发表于 2009-7-26 11:52:37

多谢两位回复,对于楼上的回复,在下有个疑问:“就是设置输出全部都是H或者L..然后设定一个期望的范围, 如果有信号频率落在这个范围内,就判断pass.否则就是fail”,既然输出都设置成H了,又怎么设置期望的范围呢,是在pattern里实现测试的,还是VB的编程里实现的??楼上能否再详细说一下<br/>

半仙 发表于 2009-7-26 19:45:05

&nbsp;其实就是先在pattern里面的输出管脚全部设置成H或者L, 为的就是使输出结果为有pass和fail, 然后通过pass和fail的关系, 采样信号的频率和欠采样的理论计算出可能存在的输出频点(这个频点可能有无穷多个), 然后再根据设定的输出频率的频点范围, 输出的频点的数值..<br/><br/>但是如果输出频点的范围设置比较大的话, 落在这个区间里面有两个或者两个以上的频点, 那么就会报错...<br/><br/>我不知道现在有没有说清楚, 对于750里面的设置和代码的问题, 可以见如下所示:<br/><br/>HOW TO USE FREQUENCY COUNTER MODE ON THE J750<br/>Last update by Daniel Murphy 3/22/99<br/>What is Frequency Counter Mode?<br/>Frequency Counter Mode is a pin setup on the J750 that allows the programmer to<br/>count transitions on the specified pin. When a digital channel is in frequency<br/>counter mode, its comparator output is gated to the positive edge triggered<br/>clock input on the 16-bit frequency counter register associated with that<br/>channel. Thus positive transitions on the specified pin cause the frequency<br/>counter register to be incremented. The contents of frequency counter registers<br/>may be cleared or read by an application program. Reading a frequency counter<br/>register returns a 2’s complement number (range –32768 to +32767). Negative<br/>values occur when the count surpasses 32767. To convert a negative number to a<br/>positive value, add 65536 to it.<br/>What are the restrictions on a test that uses Frequency Counter Mode?<br/>1. The timing sheet used (Edge Set or Time Set Basic) must be in Extended Mode.<br/>2. The timing sheet must set the mode of the pin that will do frequency counting<br/>by selecting “freq_counter” in the Pin/Group Setup column.<br/>3. The timing sheet must set the Compare Mode column of the pin to Window.<br/>4. The pattern file must contain a “pin_setup freq_counter” statement specifying<br/>the pins or channels that are in frequency counter mode. The pattern will use<br/>the symbolic data characters 0 and X to open and close the frequency counter<br/>window. See the description of frequency counter data below.<br/>5. The program should clear the frequency counter register prior to executing<br/>the test and read back the value in the register at the conclusion of the test.<br/>How do I clear or read a channel’s frequency counter register in a test?<br/>As of this writing there are four functions in the J750 Visual Basic for Test<br/>API (Application Program Interface) which may be called by a program to access<br/>the Frequency Counter registers. They are described below as well as in the VB<br/>for Test help:<br/>TheHdw.Digital.FreqCtr.Method where Method is one of the following:<br/>1. ClearChan: This function clears the frequency count for a channel.<br/>Syntax<br/>TheHdw.Digital.FreqCtr.ClearChan(ByVal DigChanNum As Long)<br/>Where DigChanNum = The number of a digital channel.<br/>2. ClearPinSite: Clear the frequency count for a pin at a site.<br/>Syntax<br/>TheHdw.Digital.FreqCtr.ClearPinSite(pinName As String, ByVal Site As<br/>Integer)<br/>Where PinName = The name of a digital pin.<br/>Site = The number of a site.<br/>3. ReadChan: Return the frequency count for a channel.<br/>Syntax<br/>TheHdw.Digital.FreqCtr.ReadChan(ByVal DigChanNum) As Integer<br/>Where DigChanNum = The number of a digital channel.<br/>4. ReadPinSite: Return the frequency count for a pin at a site.<br/>Syntax<br/>TheHdw.Digital.FreqCtr.ReadPinSite(pinName As String, ByVal Site) As<br/>Integer<br/>Where PinName = The name of a single digital pin.<br/>Site = The number of a site.<br/>You may construct your own interpose functions using these API calls. For<br/>reference, the next section has three, well documented sample Interpose<br/>functions. The first, “ClearFreqCounter”, is for clearing a specified pin’s<br/>frequency counter register, site by site. The second, “ReadFreqCounter”, will<br/>read a pin’s Frequency Counter Register, site by site, and compare the values to<br/>specified limits. The third, “MeasureFreq”, will read a pin’s Frequency Counter<br/>Register, site by site, convert the values to frequency, and compare each<br/>calculated frequency to specified limits.<br/>Sample Interpose Function #1: Use to a pin’s Clear Frequency Counter Register<br/>Option Explicit<br/>' ==================================<br/>' Public Functions: ClearFreqCounter<br/>' ==================================<br/>'<br/>' This function clears the Frequency Counter for each active site.<br/>' This routine is typically included in an Functional_T interpose<br/>' function (StartOfBodyF).<br/>'<br/>' Inputs:<br/>' argv(0) = the pinname whose frequency counter register is to be cleared<br/>'<br/>' Returns:<br/>' The Function Fail Status (TL_SUCCESS or TL_ERROR)<br/>'<br/>Public Function ClearFreqCounter(argc As Long, argv() As String) As Long<br/>Dim site As Long<br/>Dim pinname As String<br/>ClearFreqCounter = TL_SUCCESS<br/>On Error GoTo ClearFreqCounterError<br/>' Check to make sure that correct number of values are passed in<br/>If argc &lt;&gt; 1 Then<br/>MsgBox "Interpose function ClearFreqCounter requires a Pin Name as a<br/>Parameter"<br/>ClearFreqCounter = TL_ERROR<br/>Exit Function<br/>Else<br/>pinname = argv(0)<br/>End If<br/>' Serially Clear Frequency Counter by Site<br/>If theexec.Sites.SelectFirst &lt;&gt; loopDone Then<br/>Do<br/>site = theexec.Sites.SelectedSite ' get the site<br/>' clear frequency count<br/>Call TheHDW.Digital.FreqCtr.ClearPinSite(pinname, site)<br/>Loop While theexec.Sites.SelectNext(loopTop) &lt;&gt; loopDone<br/>End If<br/>Exit Function<br/>ClearFreqCounterError:<br/>On Error GoTo 0<br/>Call theexec.ErrorLogMessage("Function Error: ClearFreqCounter")<br/>Call theexec.ErrorReport<br/>ClearFreqCounter = TL_ERROR<br/>End Function<br/>Sample Interpose Function #2: Use to Read Frequency Counter Register<br/>' =====================================<br/>' Public Functions: ReadFreqCounter<br/>' =====================================<br/>'<br/>' This function reads back the Frequency Counter register of the specified<br/>' pin for each active site and compares the value to specified limits. The test<br/>' results will be output to the Datalog in parametric format (i.e. with limits).<br/>' This routine is typically included in an Functional_T interpose<br/>' function (EndOfBodyF).<br/>'<br/>' Inputs:<br/>' argv(0) = the pinname whose frequency is to be measured<br/>' argv(1) = the test lower limit (in counts)<br/>' argv(2) = the test upper limit (in counts)<br/>'<br/>' Returns:<br/>' The Function Fail Status (TL_SUCCESS or TL_ERROR)<br/>'<br/>Public Function ReadFreqCounter(argc As Long, argv() As String) As Integer<br/>Dim site As Long<br/>Dim testnum As Long<br/>Dim freq_count As Double<br/>Dim count_min As Double<br/>Dim count_max As Double<br/>Dim pinname As String<br/>Dim channum As Long<br/>ReadFreqCounter = TL_SUCCESS<br/>On Error GoTo ReadFreqCounterError<br/>

半仙 发表于 2009-7-26 19:45:18

<br/>
' Check to make sure that correct number of values are passed in<br/>
If argc &lt;&gt; 3 Then<br/>
MsgBox "Incorrect Number of Arguments to Interpose Function<br/>
ReadFreqCounter."<br/>
ReadFreqCounter = TL_ERROR<br/>
Exit Function<br/>
Else<br/>
pinname = argv(0)<br/>
count_min = argv(1)<br/>
count_max = argv(2)<br/>
End If<br/>
' Serially read back the Frequency Counter Register counter, site by site<br/>
If theexec.Sites.SelectFirst &lt;&gt; loopDone Then<br/>
Do<br/>
site = theexec.Sites.SelectedSite ' get the site<br/>
' Get the frequency count for a pin at a site.<br/>
freq_count = TheHDW.Digital.FreqCtr.ReadPinSite(pinname, site)<br/>
' Get the actual flow testnumber<br/>
testnum = theexec.Sites.site(site).TestNumber<br/>
' Do test and print result (get channel number for printout)<br/>
channum = TheHDW.ChanFromPinSite(pinname, site, chIO)<br/>
If freq_count &lt; count_min Or freq_count &gt; count_max Then<br/>
theexec.Sites.site(site).TestResult = siteFail<br/>
Call theexec.Datalog.WriteParametricResult(site, testnum,<br/>
logTestFail, 0, pinname, channum, count_min, freq_count, count_max, 0, 0, 0, 0)<br/>
Else<br/>
theexec.Sites.site(site).TestResult = sitePass<br/>
Call theexec.Datalog.WriteParametricResult(site, testnum,<br/>
logTestPass, 0, pinname, channum, count_min, freq_count, count_max, 0, 0, 0, 0)<br/>
End If<br/>
Loop While theexec.Sites.SelectNext(loopTop) &lt;&gt; loopDone<br/>
End If<br/>
Exit Function<br/>
ReadFreqCounterError:<br/>
On Error GoTo 0<br/>
Call theexec.ErrorLogMessage("Function Error: ReadFreqCounter")<br/>
Call theexec.ErrorReport<br/>
ReadFreqCounter = TL_ERROR<br/>
End Function<br/>
Sample Interpose Function #3: Use to Measure Frequency on a pin<br/>
' =====================================<br/>
' Public Functions: MeasureFreq<br/>
' =====================================<br/>
'<br/>
' This function reads back the Frequency Counter register of the specified<br/>
' pin for each active site and converts the register value(s) to frequency<br/>
' using the specified vector period and specified number of cycles of the<br/>
' test. The calculated frequency is tested against the specified limits and<br/>
' the test results output to the Datalog in parametric format (i.e. with limits)<br/>
' This routine is typically included in an Functional_T interpose<br/>
' function (EndOfBodyF).<br/>
'<br/>
' Inputs:<br/>
' argv(0) = the pinname whose frequency is to be measured<br/>
' argv(1) = the tester vector period on the specified pin for this test<br/>
(seconds)<br/>
' argv(2) = the number of tester cycles during which the measurement will be<br/>
made<br/>
' argv(3) = the test lower limit (in Hz)<br/>
' argv(4) = the test upper limit (in Hz)<br/>
'<br/>
' Returns:<br/>
' The Function Fail Status (TL_SUCCESS or TL_ERROR)<br/>
'<br/>
Public Function MeasureFreq(argc As Long, argv() As String) As Integer<br/>
Dim site As Long<br/>
Dim testnum As Long<br/>
Dim freq_count As Double<br/>
Dim freq_value As Double<br/>
Dim freq_min As Double<br/>
Dim freq_max As Double<br/>
Dim prog_period As Double<br/>
Dim num_periods As Long<br/>
Dim pinname As String<br/>
Dim channum As Long<br/>
MeasureFreq = TL_SUCCESS<br/>
On Error GoTo MeasureFreqError<br/>
' Check to make sure that correct number of values are passed in<br/>
If argc &lt;&gt; 5 Then<br/>
MsgBox "Incorrect Number of Arguments to Interpose Function<br/>
MeasureFreq."<br/>
MeasureFreq = TL_ERROR<br/>
Exit Function<br/>
Else<br/>
pinname = argv(0)<br/>
prog_period = argv(1)<br/>
num_periods = argv(2)<br/>
freq_min = argv(3)<br/>
freq_max = argv(4)<br/>
End If<br/>
' Serially read back the Frequency Counter Register counter, site by site<br/>
If theexec.Sites.SelectFirst &lt;&gt; loopDone Then<br/>
Do<br/>
site = theexec.Sites.SelectedSite ' get the site<br/>
' Get the frequency count for a pin at a site.<br/>
freq_count = TheHDW.Digital.FreqCtr.ReadPinSite(pinname, site)<br/>
' Calculate frequency value from frequency count<br/>
freq_value = freq_count / (prog_period * num_periods)<br/>
' get actual flow testnumber<br/>
'testnum = tl_FlowGetTestNumber(0)<br/>
testnum = theexec.Sites.site(site).TestNumber<br/>
' Do test and print result (get channel number for printout)<br/>
channum = TheHDW.ChanFromPinSite(pinname, site, chIO)<br/>
If freq_value &lt; freq_min Or freq_value &gt; freq_max Then<br/>
theexec.Sites.site(site).TestResult = siteFail<br/>
'Call tl_FlowSetSiteTestResult(site, 0) ' fail<br/>
Call theexec.Datalog.WriteParametricResult(site, testnum,<br/>
logTestFail, 0, pinname, channum, freq_min, freq_value, freq_max, 0, 0, 0, 0)<br/>
Else<br/>
theexec.Sites.site(site).TestResult = sitePass<br/>
'Call tl_FlowSetSiteTestResult(site, 1) ' pass<br/>
Call theexec.Datalog.WriteParametricResult(site, testnum,<br/>
logTestPass, 0, pinname, channum, freq_min, freq_value, freq_max, 0, 0, 0, 0)<br/>
End If<br/>
Loop While theexec.Sites.SelectNext(loopTop) &lt;&gt; loopDone<br/>
End If<br/>
Exit Function<br/>
MeasureFreqError:<br/>
On Error GoTo 0<br/>
Call theexec.ErrorLogMessage("Function Error: MeasureFreq")<br/>
Call theexec.ErrorReport<br/>
MeasureFreq = TL_ERROR<br/>
End Function<br/>
What does my pattern file need to use frequency counter mode?<br/>
A pattern file that uses a pin in frequency counter mode requires the following<br/>
statements and use of data formats:<br/>
1. Statements:<br/>
A pin_setup statement that identifies pins as freq_count pins must be appear in<br/>
the pattern file before the vector statement and after any compiler control<br/>
statements.<br/>
Syntax<br/>
pin_setup = {pin-item freq_count ;<br/>
...<br/>
}<br/>
Where a pin-item can be:<br/>
a pin name or pin group name (defined in the pin map)<br/>
a digital channel number, from 0 to 1023<br/>
a range of digital channel numbers, in parentheses, in the form<br/>
( channel-# to channel-# )<br/>
any combination of pins and pin groups, or any combination of<br/>
channel numbers and ranges, enclosed in parentheses and separated by<br/>
commas, in the form<br/>
( item, item, ..., item )<br/>
Channels and pins cannot be intermixed in the same pattern file.<br/>
The pingroups used in the pin_setup statement may be identical to<br/>
pingroups in the vector statement pinlist, or supersets of them.<br/>
It is illegal to have a pin appear in multiple pingroups used in the<br/>
pin_setup statement.<br/>
Example:<br/>
pin_setup = { outputclkpin freq_count; }<br/>
2. Data Formats (For Ig-xl 3.20 and later)<br/>
The symbolic vector programming codes are used in special ways for frequency<br/>
counter pins. For frequency counter pins, legal data characters are 0 and X.<br/>
These datacodes do not have their normal meaning when used with frequency<br/>
counter pins. Instead, the datacodes control opening and closing the frequency<br/>
counter window, i.e. gating the pin to its frequency counter register clock.<br/>
A pair of datacodes over 2 cycles is necessary to open or close the window. The<br/>
window will open or close on the first cycle of the pair.<br/>
Before opening a frequency counter window, the datacode for that pin on all<br/>
prior cycles should be X.<br/>
To open the window for a particular pin, begin programming 0 on that pin. The<br/>
window will open the R0 edge of the first cycle programmed to 0, provided that<br/>
on the next cycle the pin is also programmed to 0. Continue programming the pin<br/>
to 0 for the number of cycles that you wish the window to be open.<br/>
To close the frequency counter window, program an X on the cycle after the one<br/>
on which the R1 edge will close the window.<br/>
This example illustrates the use of the frequency counter datacodes:<br/>
vector ($tset, FCP) {<br/>
&gt; 1 X; // program to X on all prior vectors<br/>
&gt; 1 0; // R0 in this cycle opens window<br/>
repeat N &gt; 1 0; // Window stays open during repeat<br/>
&gt; 1 0; // R1 on this cycle closes window<br/>
&gt; 1 X; // program to X on all succeeding vectors<br/>
}<br/>
Once a pin’s value transitions from X to 0, the pattern generator looks ahead<br/>
one cycle to determine whether or not the frequency counter window should be<br/>
opened. If the next vector’s value is 0, the window will open on the R0 edge<br/>
(the open window strobe). As each cycle executes, the window will stay open as<br/>
long as the next vector’s value is 0. If the next vector’s value is X, the<br/>
window will close on edge R1 (Close window strobe).<br/>
Thus the window will remain open for approximately the number of cycles that the<br/>
pin has been programmed to 0.<br/>
For Ig-xl 3.10 and earlier:<br/>
The window opens on the R0 edge of the last vector programmed to X before a<br/>
vector programmed to 0. This will result in a count of one more than the count<br/>
would be under Ig-xl 3.20 and later. Also, because of the lookahead, under Igxl<br/>
3.10 and earlier it is highly recommended that programmers add one vector to<br/>
the pattern file after the vector with the “halt” or “end module” opcode. Make<br/>
sure this additional vector is loaded into the same memory (LVM or SVM) as the<br/>
vector with halt or end_module opcode. The additional vector will not be<br/>
executed but it should have the pin in frequency counter mode set to X. This<br/>
will prevent the pattern generator lookahead from causing the compare window to<br/>
reopen on the last vector, since the next memory location will have the pin set<br/>
to an X. This type of problem is avoided in 3.20 by having the window open on<br/>
consecutive cycles programmed to 0.

ictest 发表于 2009-7-26 20:12:57

<p>多谢半仙了,我得好好研究研究了</p>

reg238 发表于 2010-2-22 21:26:42

好帖!支持楼主!:)<p><p><p>____________________<p>27419-01 54419-01 <p>46319-01 05419-01 <p>96819-01 www.reverse-ssn-lookup.com

reg238 发表于 2010-4-7 22:33:18

Thanks for this valuable thread!<p><p>____________________<p>HWP0000-HWP9999 <p> HWQ0000-HWQ9999 <p> HWR0000-HWR9999 <p> HWS0000-HWS9999 <p> HWT0000-HWT9999 <p>

客人 发表于 2010-5-6 18:09:18

请帮忙看看我的code 那里有问题
页: [1] 2
查看完整版本: 在IC测试中如何应用欠采样理论进行波形的抓取