📄 memory_b.vhdl
字号:
WRITELINE (output, outline2); END IF; END LOOP; WRITE (outline1, header2); outline2 := outline1; WRITELINE (LogFile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; FOR i IN ScheduleDataArray'RANGE LOOP WRITE (outline1, i ); WRITE (outline1, empty); WRITE (outline1, ScheduleDataArray(i).ScheduleValue); WRITE (outline1, empty); WRITE (outline1, ScheduleDataArray(i).OutputData); WRITE (outline1, empty); WRITE (outline1, ScheduleDataArray(i).LastOutputValue ); WRITE (outline1, empty); DelayValue(ScheduleDataArray(i).ScheduleTime, outline1); outline2 := outline1; WRITELINE (LogFile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; END LOOP; WRITE (outline1, empty); WRITE (outline2, empty); WRITELINE (LogFile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE (Output, outline2); END IF;END PrintScheduleDataArray;-- ----------------------------------------------------------------------------PROCEDURE PrintArcType ( ArcType : IN VitalMemoryArcType) IS VARIABLE outline1, outline2 : LINE; CONSTANT empty : STRING := " "; CONSTANT cross : STRING := "CrossArc"; CONSTANT para : STRING := "ParallelArc"; CONSTANT sub : STRING := "SubWordArc"; CONSTANT Header1 : STRING := "Path considered @ "; CONSTANT Header2 : STRING := " is ";BEGIN WRITELINE (LogFile, outline1); WRITE (outline1, header1); WRITE (outline1, NOW); WRITE (outline1, empty); WRITE (outline1, header2); WRITE (outline1, empty); case ArcType is WHEN CrossArc => WRITE (outline1, cross); WHEN ParallelArc => WRITE (outline1, para); WHEN SubwordArc => WRITE (outline1, sub); END CASE; outline2 := outline1 ; -- Appears on STD OUT IF (PrintDebugMsg = '1') THEN WRITELINE (Output, outline1); END IF; WRITELINE (LogFile, outline2);END PrintArcType;-- ------------------------------------------------------------------------------ This returns the value picked from the delay array-- ----------------------------------------------------------------------------PROCEDURE PrintDelay ( outbitpos : IN INTEGER; InputArrayLow : IN INTEGER; InputArrayHigh : IN INTEGER; debugprop : IN VitalTimeArrayT; debugretain : IN VitalTimeArrayT) IS VARIABLE outline1 : LINE; VARIABLE outline2 : LINE; VARIABLE outline3 : LINE; VARIABLE outline4 : LINE; VARIABLE outline5 : LINE; VARIABLE outline6 : LINE; CONSTANT empty : STRING := " "; CONSTANT empty5 : STRING := " "; CONSTANT header1 : STRING := "Prop. delays : "; CONSTANT header2 : STRING := "Retain delays : "; CONSTANT header3 : STRING := "output bit : ";BEGIN WRITE(outline1, header3); WRITE(outline1, outbitpos); outline2 := outline1; WRITELINE(LogFile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE(output, outline2); END IF; WRITE(outline1, header1); WRITE (outline1, empty5); FOR i IN InputArrayHigh DOWNTO InputArrayLow LOOP DelayValue(debugprop(i), outline1); WRITE(outline1, empty); END LOOP; outline2 := outline1; WRITELINE(LogFile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE(output, outline2); END IF; WRITE(outline1, header2); WRITE (outline1, empty5); FOR i in InputArrayHigh DOWNTO InputArrayLow LOOP DelayValue(debugretain(i), outline1); WRITE(outline1, empty); END LOOP; outline2 := outline1; WRITELINE(LogFile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE(output, outline2); END IF;END PrintDelay;-- ----------------------------------------------------------------------------PROCEDURE DebugMsg1 IS CONSTANT header1:STRING:= "******************************************"; CONSTANT header2 :STRING:="Entering the process because of an i/p change"; variable outline1, outline2 : LINE;BEGIN WRITE(outline1, header1); outline2 := outline1; WRITELINE (Logfile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITE(outline1, header2); outline2 := outline1; WRITELINE (Logfile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITE(outline1, header1); outline2 := outline1; WRITELINE (Logfile, outline1); IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF;END DebugMsg1;-- ----------------------------------------------------------------------------PROCEDURE ScheduleDebugMsg IS CONSTANT header1 : STRING := "******************************************"; CONSTANT header2 : STRING := "Finished executing all the procedures"; VARIABLE outline1 : LINE; VARIABLE outline2 : LINE;BEGIN WRITE(outline1, header1); outline2 := outline1; IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITELINE (Logfile, outline1); WRITE(outline1, header2); outline2 := outline1; IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITELINE (Logfile, outline1); WRITE(outline1, header1); outline2 := outline1; IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITELINE (Logfile, outline1);END ScheduleDebugMsg; -- ----------------------------------------------------------------------------PROCEDURE PrintInputName( InputSignalName : IN STRING) IS VARIABLE outline1 : LINE; VARIABLE outline2 : LINE; CONSTANT header1 : STRING := "***Changing input is "; CONSTANT header2 : STRING := "("; CONSTANT header3 : STRING := ")"; CONSTANT header4 : STRING := "****"; CONSTANT header5 : STRING := "******************************************"; CONSTANT header6 : STRING:="Entering the process because of an i/p change"; CONSTANT empty : STRING := " ";BEGIN WRITE(outline1, header5); outline2 := outline1; WRITELINE (output, outline1); WRITELINE (Logfile, outline2); WRITE(outline1, header6); outline2 := outline1; WRITELINE (output, outline1); WRITELINE (Logfile, outline2); WRITE(outline1, header5); outline2 := outline1; WRITELINE (output, outline1); WRITELINE (Logfile, outline2); WRITE(outline1, header1); WRITE(outline1, InputSignalName); WRITE(outline1, empty); WRITE(outline1, now); WRITE(outline1, empty); WRITE(outline1, header4); WRITELINE (output, outline1); WRITELINE (Logfile, outline2); END PrintInputName;-- ----------------------------------------------------------------------------PROCEDURE PrintInputChangeTime( ChangeTimeArray : IN VitalTimeArrayT) IS VARIABLE outline1 : LINE; VARIABLE outline2 : LINE; CONSTANT header5 : STRING := "*************************************"; CONSTANT header6 : STRING:="ChangeTime Array : "; CONSTANT empty : STRING := " ";BEGIN WRITE(outline1, header5); outline2 := outline1; IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITELINE (Logfile, outline1); WRITE(outline1, header6); FOR i in ChangeTimeArray'range LOOP WRITE(outline1, ChangeTimeArray(i)); WRITE(outline1, empty); END LOOP; outline2 := outline1; IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITELINE (Logfile, outline1); WRITE(outline1, header5); outline2 := outline1; IF (PrintDebugMsg = '1') THEN WRITELINE (output, outline2); END IF; WRITELINE (Logfile, outline1); END PrintInputChangeTime;-- ----------------------------------------------------------------------------PROCEDURE PrintInputChangeTime( ChangeTime : IN Time) IS VARIABLE ChangeTimeArray : VitalTimeArrayT(0 DOWNTO 0);BEGIN ChangeTimeArray(0) := ChangeTime; PrintInputChangeTime(ChangeTimeArray);END PrintInputChangeTime;-- ------------------------------------------------------------------------------ for debug purposeCONSTANT MaxNoInputBits : INTEGER := 1000;TYPE VitalMemoryDelayType IS RECORD PropDelay : TIME; OutputRetainDelay : TIME;END RECORD;-- ------------------------------------------------------------------------------ PROCEDURE: IntToStr---- PARAMETERS: InputInt - Integer to be converted to String.-- ResultStr - String buffer for converted Integer-- AppendPos - Position in buffer to place result---- DESCRIPTION: This procedure is used to convert an input integer-- into a string representation. The converted string-- may be placed at a specific position in the result-- buffer.---- ----------------------------------------------------------------------------PROCEDURE IntToStr ( InputInt : IN INTEGER ; ResultStr : INOUT STRING ( 1 TO 256) ; AppendPos : INOUT NATURAL) IS -- Look-up table. Given an int, we can get the character. TYPE integer_table_type IS ARRAY (0 TO 9) OF CHARACTER ; CONSTANT integer_table : integer_table_type := ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') ; -- Local variables used in this function. VARIABLE inpVal : INTEGER := inputInt ; VARIABLE divisor : INTEGER := 10 ; VARIABLE tmpStrIndex : INTEGER := 1 ; VARIABLE tmpStr : STRING ( 1 TO 256 ) ;BEGIN IF ( inpVal = 0 ) THEN tmpStr(tmpStrIndex) := integer_table ( 0 ) ; tmpStrIndex := tmpStrIndex + 1 ; ELSE WHILE ( inpVal > 0 ) LOOP tmpStr(tmpStrIndex) := integer_table (inpVal mod divisor); tmpStrIndex := tmpStrIndex + 1 ; inpVal := inpVal / divisor ; END LOOP ; END IF ; IF (appendPos /= 1 ) THEN resultStr(appendPos) := ',' ; appendPos := appendPos + 1 ; END IF ; FOR i IN tmpStrIndex-1 DOWNTO 1 LOOP resultStr(appendPos) := tmpStr(i) ; appendPos := appendPos + 1 ; END LOOP ;END IntToStr ;-- ----------------------------------------------------------------------------TYPE CheckType IS ( SetupCheck, HoldCheck, RecoveryCheck, RemovalCheck, PulseWidCheck, PeriodCheck );TYPE CheckInfoType IS RECORD Violation : BOOLEAN; CheckKind : CheckType; ObsTime : TIME; ExpTime : TIME; DetTime : TIME; State : X01;END RECORD;TYPE LogicCvtTableType IS ARRAY (std_ulogic) OF CHARACTER; TYPE HiLoStrType IS ARRAY (std_ulogic RANGE 'X' TO '1') OF STRING(1 TO 4); CONSTANT LogicCvtTable : LogicCvtTableType := ( 'U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'); CONSTANT HiLoStr : HiLoStrType := (" X ", " Low", "High" );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -