[译]逻辑电路测试工具
By robot-v1.0
本文链接 https://www.kyfws.com/applications/logic-circuit-testing-tool-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 6 分钟阅读 - 2882 个词 阅读量 0[译]逻辑电路测试工具
原文地址:https://www.codeproject.com/Articles/6454/Logic-Circuit-Testing-Tool
原文作者:Deepak Jain
译文由本站 robot-v1.0 翻译
前言
The product of this project will give a tool in terms of software, capable of extracting a vigorous testing for a given digital module (which is a logical unit) under a mass production.
该项目的产品将提供软件方面的工具,能够在批量生产下为给定的数字模块(逻辑单元)提取有力的测试.
介绍(Introduction)
该项目的产品将提供软件方面的工具,能够在批量生产下为给定的数字模块(逻辑单元)提取有力的测试.(The product of this project will give a tool in terms of software, capable of extracting a vigorous testing for a given digital module (which is a logical unit) under a mass production.)
如今,我们拥有许多测试算法,这些算法足够有效,可以给出可靠的结果并带有一些可以容忍的错误.但是,当我们甚至无法承担产品的单个错误时,我们选择对该产品执行严格的测试,并按照规格测试所有可能的输入输出条件.在其软件需求规范(SRS)文档的范围内,我们将该产品命名为"逻辑电路测试工具".该SRS解释了要开发的系统及其可能的用户的要求和期望.(Today, we have lots of testing algorithms with us, efficient enough to give a reliable result with some bearable errors. But when we cannot afford even a single error in our product, we choose to perform a vigorous-testing on this product where all the possible input-output conditions are tested as per the specifications. In the scope of its software requirement specifications (SRS) document, we name the product as “logic circuit testing tool”. This SRS explains the requirement and expectations of the system to be developed and its probable users.)
项目范围(Scope of the project)
所开发的逻辑电路测试工具(LCTT)将针对给定电路在其输入引脚上的给定输入信号集(0或1)进行严格的测试.系统将创建输入模式以馈入被测电路的输入线,并捕获其输出线的输出以创建电路的真值表. " LCTT"软件与给定电路之间的通信是通过计算机的" LPT"端口(D-25打印机端口/并行端口)进行的.(The logic circuit testing tool (LCTT), as developed, will derive a vigorous testing of a given circuit for a given input signal set (0 or 1) on its input pins. The system will create input patterns to be fed into the input lines of the circuit under test and captures the output from its output lines to create a truth table for the circuit. This communication between ‘LCTT’ software and the given circuit occurs through the ‘LPT’ port of the computer (D-25 printer port/Parallel Port).)
依存关系(Dependencies)
- 尽管该软件不会高度依赖于任何类型的计算机硬件.它可以在高于" 386-intel"的任何PC配置上运行,但是在" Pentium"配置上的性能要快得多.(Although the software will not be highly dependent on any type of computer-hardware. It will be capable to work on any PC-configuration higher than “386-intel”, but the performance will be much faster on ‘Pentium’ configurations.)
- 该软件将首先开发一个具有杰作的数据库,该杰作已经通过手动测试确保是一个完美的数据库.之后,该软件会将其他被测件的真值表与数据库进行比较.如果有任何不匹配,系统将报告故障电路.(The software will first develop a database with a masterpiece that has already been assured to be a perfect one by manual testing. After that, the software compares the truth table for other pieces under test with the database. For any mismatch, the system reports for the faulty circuit.)
- 该系统仅适用于无源逻辑电路,而无任何振荡器或电源.也不涉及使用振动器.(The system will work only for the passive logic circuits, without any oscillators or power sources in them. The use of vibrators is also not involved.)
- 系统将被测单元视为黑盒,并且在其内部不执行任何操作.它仅与输入和相应的输出关系有关.因此,在I/O结果中彼此等效的两个不同电路将被同等对待.例如,如果被测单元像XOR门一样工作,系统将不会检测到它是否是直接XOR门I.C.或由NAND或NOR门组成.结果将仅基于端点真值表.(The system treats the unit-under-test just as a black box and does not do anything inside it. It is concerned to the input and corresponding output relations only. Hence the two different circuits equivalent to each other in their I/O results will be treated equally. For example, if unit under test is working like an XOR gate, the system will not detect if it is a direct XOR-gate I.C. or is composed of NAND or NOR gates. The result will be based on end point truth tables only.)
LCTT产品简介(The product LCTT In brief)
- 产品软件通过计算机的并行端口与一个杰作电路(要生产和测试相同的单元)进行接口,以创建数据库真值表.(The product software interfaces with a masterpiece circuit (whose identical units are to be produced and tested), through the parallel port of computer to create a database truth table.)
- 然后,将其他相同的单元以规定的方式通过并行端口连接到计算机,并创建一个新的真值表以与数据库真值表进行比较.(Then the other identical units are attached to the computer in prescribed manner on the parallel port and a new truth table is created for comparison with the database truth table.)
- 如果有任何不匹配,则报告该单元有故障.(For any mismatch, the unit is reported to be faulty.)
- 系统软件无需告知故障原因或故障点.(The system software needs not to tell the cause or spot of the fault.)
- 顺序和非顺序逻辑电路的单独模块.(Separate modules for sequential and the non-sequential logic circuits.)
用户期望/特征(User expectation/characteristics)
- 期望对系统的用户进行培训,使其能够按预期在被测单元和计算机的并行端口之间建立正确的连接.(The user of the system is expected to be trained to make proper connections as expected between the unit under test and the parallel port of the computer.)
- 连接中的任何错误都可能导致系统故障或错误结果,甚至损坏计算机.(Any error in connection may lead to the failure of the system or faulty-results or even damage to the computer)
- 需要对计算机并行端口有简短的了解.(A brief knowledge of parallel port of computer is desirable.)
- 进行正确的连接后,要求用户遵循系统本身提供的说明.(After making proper connections, the user is required to follow the instructions provided by the system itself.)
连接(The Connections)
- 被测电路的输入线需要连接到计算机" LPT"端口的输出线(插针编号).(The input lines of the circuit under test are required to be connected to the output lines of the ‘LPT’ port of the computer (Pin numbers).)
- 被测电路的输出线应连接到系统并行端口的输入线(引脚号).(The output lines of the circuit under test are to be connected to the input lines of the parallel port of the system (Pin Numbers).)
逻辑电路测试工具(C程序)(Logic Circuit Testing tool ( Program in C ))
#include<span class="code-keyword"><stdio.h></span>
#include<span class="code-keyword"><dos.h></span>
#include<span class="code-keyword"><conio.h></span>
#include<span class="code-keyword"><math.h></span>
const LPTI=0x379; //Parallel Input Port address
const LPTO=0x378; //Parallel Output Port address
/*(if your comupter system has been configured with some other address for
parallel I/O ports, configure this software accordingly. You may check these
addresses from your cpntrol pannel).*/
int IL,OL;
char refdata[256],data[256];
void creatPanel()
/*generates the front panel that is shown to the user on screan with
different informations on it every time the screen is refreshed.*/
{
clrscr();
textattr(10);
gotoxy(1,2);
cprintf("___________________________________________________________\n\r");
gotoxy(10,3);
textattr(20);
cprintf(" Logic Circuit Testing Tool \r\n");
gotoxy(1,4);
textattr(10);
cprintf("--------------------------------------------------\n\r");
gotoxy(35,25);
cprintf("The tool is developed by Mr. Deepak Jain.");
}
//----------------------------------
/*The help screen generation for user in any case of query. here we may put
the documentation relevant information for user to use the tool*/
//----------------------------------
void help()
{
clrscr();
creatPanel();
gotoxy(2,6);
printf("The Help..");
/*here you can give some helping tips for the user reference...!!*/
getch();
}
//----------------------------------
/*Creation of the reference data with a good piece of the circuit whose
identical circuits are to be manufactured. The tool here sends I/P signals to
this circuit & captures the O/P and hence generates a truth table in its
database automatically.*/
//----------------------------------
void refDataCreatA()
{
int i;
int j=1;
char c;
start: clrscr();
creatPanel();
textattr(15);
gotoxy(2,6);
cprintf("Place a pretested circuit as the Reference Circuit on the
parallel port \n\r & press 'Enter'\r\n");
/*Pre tested means already had been tested by manual means to retain the
confidence in the circuit The tool will be command to test the other circuits
w.r.t this circuit only.*/
textattr(10);
gotoxy(2,9);
cprintf("For help in any confusion press 'H'.");
c=getch();
clrscr();
creatPanel();
if(c=='h'|| c=='H')
{
help();
goto start;
}
textcolor(9);
gotoxy(2,6);
cprintf("Enter the number of Input Lines in the circuit: ");
//number of I/P lines in circuit
scanf("%d",&IL);
gotoxy(2,8);
cprintf("\n\rEnter the number of Output Lines in the circuit: ");
//number of I/P lines in circuit
scanf("%d",&OL);
for(i=0;i<IL;i++)
j=j*2;
gotoxy(2,10);
for(i=0;i<j;i++)
{
outportb(LPTO,i);
delay(2);
refdata[i]=inportb(LPTI);
}
}
//----------------------------------
/*Now the tool strats testing the other circuits. The tool will send input
signals to these circuits, one at a time and capture their output signal.
This output is compare with the reference data as prepared in the last step.
If the two matchs, the circuit is assumed to be a correct one, else an error
message is displayed*/
//----------------------------------
void startTest()
{
int result=1;
int i;
int j=1;
for(i=0;i<IL;i++)
j=j*2;
gotoxy(20,15);
for(i=0;i<j;i++)
{
outportb(LPTO,i);
delay(2);
data[i]=inportb(LPTI);
if(data[i]!=refdata[i]) //indicates an error.
{
result=0;
break;
}
}
if(result==0)
{
textattr(132);
cprintf("ERROR:");
textattr(4);
cprintf(" The placed circuit is FAULTY...!!!");
getch();
}
else
{
textattr(138);
cprintf("The placed circuit is O.K.");
getch();
}
textattr(9);
gotoxy(17,22);
cprintf("To test another circuit press any key...!!");
gotoxy(17,23);
cprintf("To Exit press 'Esc'");
}
//----------------------------------
/*The main program that integrates the process...!!*/
//----------------------------------
void main()
{
char c;
start1: creatPanel();
textattr(15);
gotoxy(2,6);
cprintf("Press 'A' for automatic generation of reference data.");
gotoxy(2,9);
textattr(10);
cprintf("For help in any confusion press 'H'");
c=getch();
if(c=='h' || c== 'H')
{ help(); goto start1;}
else if(c=='A' || c=='a')
refDataCreatA();
else goto start1;
start2: clrscr();
creatPanel();
textattr(73);
gotoxy(2,6);
cprintf(" The Reference Data has been created. \n\r");
textattr(2);
gotoxy(2,8);
cprintf("Replace the circuit with the other which is to be tested\n\r
& press Enter.\n\r");
textcolor(10);
cprintf("\nFor help in any confusion press 'H'.\n\r");
c=getch();
clrscr();
creatPanel();
if(c=='h'|| c=='H')
{
help();
goto start2;
}
startTest();
c=getch();
if(c!=27)
goto start2; //Repeat the process.
}
作者在准备本文档时已尽了最大的努力.作者对本文档的准确性或完整性不做任何陈述或保证,并特别否认对内容出于任何特定目的的适用性的任何暗示保证.对于本文所述的规则,作者对工作的成功或预期结果不承担任何责任.对于任何(金融或任何其他)收益或损失或任何商业损失,作者概不负责.(The author has taken his best efforts in preparing this document. The author makes no representation or warranties with respect to the accuracy or completeness of this document & specifically disclaims any implied warranties of fitness of the content for any specific purpose. The author takes no responsibilities for the success of work or expected outcome with the rules stated herein. The author will not be responsible and liable for any (financial or any other) gain or loss or any commercial damages.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C C++ WinXP Win2003 Windows Win2K Visual-Studio Dev 新闻 翻译