📄 tbs_dec.vhd
字号:
variable DUMMY :line; beginreadline(UNIREF,DUMMY);readline(UNIREF,DUMMY);readline(UNIREF,DUMMY);readline(UNIREF,DUMMY);readline(UNIREF,DUMMY);readline(UNIREF,DUMMY);end unititle_in;--**********************************************************************procedure unidata_out( OUTCHARS : in string) isvariable OUTLINE :LINE;begin write(OUTLINE,OUTCHARS); write(OUTLINE,now); writeline(RESULTSUNI,OUTLINE);end unidata_out;--**********************************************************************procedure unidata_in(REFCHARS : out string) isvariable NEXTCHAR:character;variable CHARLINE:string(92 downto 1);variable INLINE :LINE;begin if not OPEN_LOOP then readline(UNIREF,INLINE); for i in 1 to 92 loop read(INLINE,NEXTCHAR); REFCHARS(93 - i) := NEXTCHAR; end loop; else for i in 1 to 92 loop REFCHARS(93 - i) := '?'; end loop; end if;end unidata_in;--**********************************************************************procedure checkok(CHARS,REFCHARS:in string;FAULTFLAG:out bit) isbegin if CHARS /= REFCHARS then FAULTFLAG := '1'; else FAULTFLAG := '0'; end if;end checkok; --**********************************************************************procedure unireportfault( CHARS,REFCHARS : in string) isvariable OUTLINE :LINE;constant A:string(10 downto 1) := "result ";constant B:string(10 downto 1) := "expected ";begin write(OUTLINE,A); write(OUTLINE,CHARS); write(OUTLINE,now); writeline(FAULTSUNI,OUTLINE); write(OUTLINE,B); write(OUTLINE,REFCHARS); write(OUTLINE,now); writeline(FAULTSUNI,OUTLINE);end unireportfault;--**********************************************************************procedure birreportfault( CHARS,REFCHARS : in string) isvariable OUTLINE :LINE;constant A:string(10 downto 1) := "result ";constant B:string(10 downto 1) := "expected ";begin write(OUTLINE,A); write(OUTLINE,CHARS); write(OUTLINE,now); writeline(FAULTSBIR,OUTLINE); write(OUTLINE,B); write(OUTLINE,REFCHARS); write(OUTLINE,now); writeline(FAULTSBIR,OUTLINE);end birreportfault;--**********************************************************************procedure report_status(BIRSTATUS,UNISTATUS: inout bit) isconstant AP:string(70 downto 1) := "Start of tests -starting load opcode ";constant BP:string(70 downto 1) := "Successfully loaded opcode -starting reset test ";constant CP:string(70 downto 1) := "Successfully completed reset test -starting long call test ";constant DP:string(70 downto 1) := "Successfully completed long call test -starting short jump test ";constant EP:string(70 downto 1) := "Successfully completed short call test -starting jump test ";constant FP:string(70 downto 1) := "Successfully completed jump test -starting cond jump test ";constant GP:string(70 downto 1) := "Successfully completed cond jump test -starting logical test ";constant HP:string(70 downto 1) := "Successfully completed logical test -starting flags test ";constant JP:string(70 downto 1) := "Successfully completed flags test -starting arith test ";constant KP:string(70 downto 1) := "Successfully completed arith test -starting MOVX/MOVC test ";constant LP:string(70 downto 1) := "Successfully completed MOVX/MOVC test -starting push/pop test ";constant MP:string(70 downto 1) := "Successfully completed push/pop test -starting serial test ";constant NP:string(70 downto 1) := "Successfully completed serial test -starting priority test ";constant PP:string(70 downto 1) := "Successfully completed priority test -starting External SFR ";constant QP:string(70 downto 1) := "Successfully completed External SFR - Starting Power Down mode Demo";constant ZP:string(70 downto 1) := "Completed testing -Stopping clock ";constant AF:string(70 downto 1) := "Failed to start tests ";constant BF:string(70 downto 1) := "Failed to load opcode ";constant CF:string(70 downto 1) := "Failed reset test ";constant DF:string(70 downto 1) := "Failed long call test ";constant EF:string(70 downto 1) := "Failed short call test ";constant FF:string(70 downto 1) := "Failed jump test ";constant GF:string(70 downto 1) := "Failed Cond jump test ";constant HF:string(70 downto 1) := "Failed logical test ";constant JF:string(70 downto 1) := "Failed flags test ";constant KF:string(70 downto 1) := "Failed arith test ";constant LF:string(70 downto 1) := "Failed MOVX/MOVC test ";constant MF:string(70 downto 1) := "Failed push/pop test ";constant NF:string(70 downto 1) := "Failed serial test ";constant PF:string(70 downto 1) := "Failed priority test ";constant QF:string(70 downto 1) := "Failed External SFR ";constant ZF:string(70 downto 1) := "Failed on Power Down Demo -Stopping clock ";variable MESSAGE: line;begin if ( ( now <= ( 2 * tick )) and ( now >= tick ) ) then -- ignore mismatches in first vector BIRSTATUS := '0'; UNISTATUS := '0'; end if; if ((now <= (111*tick)) and (now >= 110*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,AP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,AF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (121*tick)) and (now >= 120*tick))then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,BP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,BF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (2321*tick)) and (now >= 2320*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,CP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,CF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (2785*tick)) and (now >= 2784*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,DP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,DF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (2929*tick)) and (now >= 2928*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,EP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,EF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (3217*tick)) and (now >= 3216*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,FP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,FF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (5537*tick)) and (now >= 5536*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,GP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,GF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (11089*tick)) and (now >= 11088*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,HP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,HF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (16801*tick)) and (now >= 16800*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,JP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,JF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (22201*tick)) and (now >= 22200*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,KP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,KF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (24553*tick)) and (now >= 24552*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,LP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,LF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (31465*tick)) and (now >= 31464*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,MP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,MF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (56761*tick)) and (now >= 56760*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,NP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,NF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (72817*tick)) and (now >= 72816*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,PP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,PF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (73129*tick)) and (now >= 73128*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,QP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,QF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if; if ((now <= (74238*tick)) and (now >= 74237*tick)) then if (BIRSTATUS or UNISTATUS) = '0' then write(MESSAGE,ZP); writeline(OUTPUT,MESSAGE); else write(MESSAGE,ZF); writeline(OUTPUT,MESSAGE); BIRSTATUS := '0'; UNISTATUS := '0'; end if; end if;end report_status;--**********************************************************************end TBS_DEC;--**********************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -