📄 memory_b.vhdl
字号:
-- ------------------------------------------------------------------------------ Title : Standard VITAL Memory Package-- :-- Library : Vital_Memory-- :-- Developers : IEEE DASC Timing Working Group (TWG), PAR 1076.4-- : Ekambaram Balaji, LSI Logic Corporation-- : Jose De Castro, Consultant-- : Prakash Bare, GDA Technologies-- : William Yam, LSI Logic Corporation-- : Dennis Brophy, Model Technology-- :-- Purpose : This packages defines standard types, constants, functions-- : and procedures for use in developing ASIC memory models.-- : -- -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ Modification History : -- ------------------------------------------------------------------------------ Ver:|Auth:| Date:| Changes Made:-- 0.1 | eb |071796| First prototye as part of VITAL memory proposal-- 0.2 | jdc |012897| Initial prototyping with proposed MTM scheme -- 0.3 | jdc |090297| Extensive updates for TAG review (functional)-- 0.4 | eb |091597| Changed naming conventions for VitalMemoryTable -- | | | Added interface of VitalMemoryCrossPorts() & -- | | | VitalMemoryViolation().-- 0.5 | jdc |092997| Completed naming changes thoughout package body.-- | | | Testing with simgle port test model looks ok.-- 0.6 | jdc |121797| Major updates to the packages:-- | | | - Implement VitalMemoryCrossPorts()-- | | | - Use new VitalAddressValueType-- | | | - Use new VitalCrossPortModeType enum-- | | | - Overloading without SamePort args-- | | | - Honor erroneous address values-- | | | - Honor ports disabled with 'Z'-- | | | - Implement implicit read 'M' table symbol-- | | | - Cleanup buses to use (H DOWNTO L)-- | | | - Message control via MsgOn,HeaderMsg,PortName-- | | | - Tested with 1P1RW,2P2RW,4P2R2W,4P4RW cases-- 0.7 | jdc |052698| Bug fixes to the packages:-- | | | - Fix failure with negative Address values-- | | | - Added debug messages for VMT table search-- | | | - Remove 'S' for action column (only 's')-- | | | - Remove 's' for response column (only 'S')-- | | | - Remove 'X' for action and response columns-- 0.8 | jdc |061298| Implemented VitalMemoryViolation()-- | | | - Minimal functionality violation tables-- | | | - Missing:-- | | | - Cannot handle wide violation variables-- | | | - Cannot handle sub-word cases-- | | | Fixed IIC version of MemoryMatch-- | | | Fixed 'M' vs 'm' switched on debug output-- | | | TO BE DONE:-- | | | - Implement 'd' corrupting a single bit-- | | | - Implement 'D' corrupting a single bit-- 0.9 |eb/sc|080498| Added UNDEF value for VitalPortFlagType-- 0.10|eb/sc|080798| Added CORRUPT value for VitalPortFlagType-- 0.11|eb/sc|081798| Added overloaded function interface for-- | | | VitalDeclareMemory-- 0.14| jdc |113198| Merging of memory functionality and version-- | | | 1.4 9/17/98 of timing package from Prakash-- 0.15| jdc |120198| Major development of VMV functionality-- 0.16| jdc |120298| Complete VMV functionlality for initial testing-- | | | - New ViolationTableCorruptMask() procedure-- | | | - New MemoryTableCorruptMask() procedure-- | | | - HandleMemoryAction():-- | | | - Removed DataOutBus bogus output-- | | | - Replaced DataOutTmp with DataInTmp-- | | | - Added CorruptMask input handling-- | | | - Implemented 'd','D' using CorruptMask-- | | | - CorruptMask on 'd','C','L','D','E'-- | | | - CorruptMask ignored on 'c','l','e'-- | | | - Changed 'l','d','e' to set PortFlag to CORRUPT-- | | | - Changed 'L','D','E' to set PortFlag to CORRUPT-- | | | - Changed 'c','l','d','e' to ignore HighBit, LowBit-- | | | - Changed 'C','L','D','E' to use HighBit, LowBit-- | | | - HandleDataAction():-- | | | - Added CorruptMask input handling-- | | | - Implemented 'd','D' using CorruptMask-- | | | - CorruptMask on 'd','C','L','D','E'-- | | | - CorruptMask ignored on 'l','e'-- | | | - Changed 'l','d','e' to set PortFlag to CORRUPT-- | | | - Changed 'L','D','E' to set PortFlag to CORRUPT-- | | | - Changed 'l','d','e' to ignore HighBit, LowBit-- | | | - Changed 'L','D','E' to use HighBit, LowBit-- | | | - MemoryTableLookUp():-- | | | - Added MsgOn table debug output-- | | | - Uses new MemoryTableCorruptMask()-- | | | - ViolationTableLookUp():-- | | | - Uses new ViolationTableCorruptMask()-- 0.17| jdc |120898| - Added VitalMemoryViolationSymbolType,-- | | | VitalMemoryViolationTableType data -- | | | types but not used yet (need to discuss)-- | | | - Added overload for VitalMemoryViolation()-- | | | which does not have array flags-- | | | - Bug fixes for VMV functionality:-- | | | - ViolationTableLookUp() not handling '-' in-- | | | scalar violation matching-- | | | - VitalMemoryViolation() now normalizes-- | | | VFlagArrayTmp'LEFT as LSB before calling-- | | | ViolationTableLookUp() for proper scanning-- | | | - ViolationTableCorruptMask() had to remove -- | | | normalization of CorruptMaskTmp and-- | | | ViolMaskTmp for proper MSB:LSB corruption-- | | | - HandleMemoryAction(), HandleDataAction() -- | | | - Removed 'D','E' since not being used-- | | | - Use XOR instead of OR for corrupt masks-- | | | - Now 'd' is sensitive to HighBit, LowBit-- | | | - Fixed LowBit overflow in bit writeable case-- | | | - MemoryTableCorruptMask()-- | | | - ViolationTableCorruptMask()-- | | | - VitalMemoryTable()-- | | | - VitalMemoryCrossPorts()-- | | | - Fixed VitalMemoryViolation() failing on-- | | | error AddressValue from earlier VMT()-- | | | - Minor cleanup of code formatting-- 0.18| jdc |032599| - In VitalDeclareMemory()-- | | | - Added BinaryLoadFile formal arg and -- | | | modified LoadMemory() to handle bin-- | | | - Added NOCHANGE to VitalPortFlagType-- | | | - For VitalCrossPortModeType-- | | | - Added CpContention enum-- | | | - In HandleDataAction()-- | | | - Set PortFlag := NOCHANGE for 'S' -- | | | - In HandleMemoryAction()-- | | | - Set PortFlag := NOCHANGE for 's' -- | | | - In VitalMemoryTable() and-- | | | VitalMemoryViolation()-- | | | - Honor PortFlag = NOCHANGE returned -- | | | from HandleMemoryAction()-- | | | - In VitalMemoryCrossPorts()-- | | | - Fixed Address = AddressJ for all-- | | | conditions of DoWrCont & DoCpRead -- | | | - Handle CpContention like WrContOnly-- | | | under CpReadOnly conditions, with-- | | | associated memory message changes-- | | | - Handle PortFlag = NOCHANGE like-- | | | PortFlag = READ for actions-- | | | - Modeling change:-- | | | - Need to init PortFlag every delta-- | | | PortFlag_A := (OTHES => UNDEF);-- | | | - Updated InternalTimingCheck code-- 0.19| jdc |042599| - Fixes for bit-writeable cases-- | | | - Check PortFlag after HandleDataAction-- | | | in VitalMemoryViolation()-- 0.20| jdc |042599| - Merge PortFlag changes from Prakash-- | | | and Willian:-- | | | VitalMemorySchedulePathDelay()-- | | | VitalMemoryExpandPortFlag()-- 0.21| jdc |072199| - Changed VitalCrossPortModeType enums,-- | | | added new CpReadAndReadContention.-- | | | - Fixed VitalMemoryCrossPorts() parameter-- | | | SamePortFlag to INOUT so that it can-- | | | set CORRUPT or READ value.-- | | | - Fixed VitalMemoryTable() where PortFlag-- | | | setting by HandleDataAction() is being-- | | | ignored when HandleMemoryAction() sets-- | | | PortFlagTmp to NOCHANGE.-- | | | - Fixed VitalMemoryViolation() to set-- | | | all bits of PortFlag when violating.-- 0.22| jdc |072399| - Added HIGHZ to PortFlagType. HandleData-- | | | checks whether the previous state is HIGHZ.-- | | | If yes then portFlag should be NOCHANGE-- | | | for VMPD to ignore IORetain corruption.-- | | | The idea is that the first Z should be-- | | | propagated but later ones should be ignored.-- | | |-- 0.23| jdc |100499| - Took code checked in by Dennis 09/28/99-- | | | - Changed VitalPortFlagType to record of-- | | | new VitalPortStateType to hold current,-- | | | previous values and separate disable.-- | | | Also created VitalDefaultPortFlag const.-- | | | Removed usage of PortFlag NOCHANGE-- | | | - VitalMemoryTable() changes:-- | | | Optimized return when all curr = prev-- | | | AddressValue is now INOUT to optimize-- | | | Transfer PF.MemoryCurrent to MemoryPrevious-- | | | Transfer PF.DataCurrent to DataPrevious-- | | | Reset PF.OutputDisable to FALSE-- | | | Expects PortFlag init in declaration-- | | | No need to init PortFlag every delta-- | | | - VitalMemorySchedulePathDelay() changes:-- | | | Initialize with VitalDefaultPortFlag-- | | | Check PortFlag.OutputDisable-- | | | - HandleMemoryAction() changes:-- | | | Set value of PortFlag.MemoryCurrent-- | | | Never set PortFlag.OutputDisable-- | | | - HandleDataAction() changes:-- | | | Set value of PortFlag.DataCurrent-- | | | Set PortFlag.DataCurrent for HIGHZ-- | | | - VitalMemoryCrossPorts() changes:-- | | | Check/set value of PF.MemoryCurrent-- | | | Check value of PF.OutputDisable-- | | | - VitalMemoryViolation() changes:-- | | | Fixed bug - not reading inout PF value-- | | | Clean up setting of PortFlag-- 0.24| jdc |100899| - Modified update of PF.OutputDisable-- | | | to correctly accomodate 2P1W1R case:-- | | | the read port should not exhibit-- | | | IO retain corrupt when reading-- | | | addr unrelated to addr being written.-- 0.25| jdc |100999| - VitalMemoryViolation() change:-- | | | Fixed bug with RDNWR mode incorrectly-- | | | updating the PF.OutputDisable-- 0.26| jdc |100999| - VitalMemoryCrossPorts() change:-- | | | Fixed bugs with update of PF-- 0.27| jdc |101499| - VitalMemoryCrossPorts() change:-- | | | Added DoRdWrCont message (ErrMcpRdWrCo,-- | | | Memory cross port read/write data only-- | | | contention)-- | | | - VitalMemoryTable() change:-- | | | Set PF.OutputDisable := TRUE for the-- | | | optimized cases.-- 0.28| pb |112399| - Added 8 VMPD procedures for vector -- | | | PathCondition support. Now the total-- | | | number of overloadings for VMPD is 24.-- | | | - Number of overloadings for SetupHold-- | | | procedures increased to 5. Scalar violations-- | | | are not supported anymore. Vector checkEnabled-- | | | support is provided through the new overloading-- 0.29| jdc |120999| - HandleMemoryAction() HandleDataAction()-- | | | Reinstated 'D' and 'E' actions but-- | | | with new PortFlagType-- | | | - Updated file handling syntax, must compile-- | | | with -93 syntax now.-- 0.30| jdc |022300| - Formated for 80 column max width-- ----------------------------------------------------------------------------LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.Vital_Timing.all;USE IEEE.Vital_Primitives.all;LIBRARY STD;USE STD.TEXTIO.ALL;-- ----------------------------------------------------------------------------PACKAGE BODY Vital_Memory IS-- ------------------------------------------------------------------------------ Timing Section-- ----------------------------------------------------------------------------FILE LogFile : TEXT OPEN write_mode IS "delayLog";FILE Output : TEXT OPEN write_mode IS "STD_OUTPUT";-- Added for turning off the debug msg..CONSTANT PrintDebugMsg : STD_ULOGIC := '0'; -- '0' - don't print in STD OUTPUT -- '1' - print in STD OUTPUT-- Type and constant definitions for type conversion.TYPE MVL9_TO_CHAR_TBL IS ARRAY (STD_ULOGIC) OF character;--constant MVL9_to_char: MVL9_TO_CHAR_TBL := "UX01ZWLH-";CONSTANT MVL9_to_char: MVL9_TO_CHAR_TBL := "XX01ZX010";-- ------------------------------------------------------------------------------ STD_LOGIC WRITE UTILITIES-- ----------------------------------------------------------------------------PROCEDURE WRITE( l : INOUT line; val : IN std_logic_vector; justify : IN side := right; field : IN width := 0) IS VARIABLE invect : std_logic_vector(val'LENGTH DOWNTO 1); VARIABLE ins : STRING(val'LENGTH DOWNTO 1);BEGIN invect := val; FOR I IN invect'length DOWNTO 1 LOOP ins(I) := MVL9_to_char(invect(I)); END LOOP; WRITE(L, ins, justify, field);END;PROCEDURE WRITE( l : INOUT line; val : IN std_ulogic; justify : IN side := right; field : in width := 0) IS VARIABLE ins : CHARACTER;BEGIN ins := MVL9_to_char(val); WRITE(L, ins, justify, field);END;-- ----------------------------------------------------------------------------PROCEDURE DelayValue( InputTime : IN TIME ; outline : INOUT LINE) IS CONSTANT header : STRING := "TIME'HIGH";BEGIN IF(InputTime = TIME'HIGH) THEN WRITE(outline, header); ELSE WRITE(outline, InputTime); END IF;END DelayValue;-- ----------------------------------------------------------------------------PROCEDURE PrintScheduleDataArray ( ScheduleDataArray : IN VitalMemoryScheduleDataVectorType) IS VARIABLE outline1 : LINE; VARIABLE outline2 : LINE; VARIABLE value : TIME; CONSTANT empty : STRING := " "; CONSTANT header1 : STRING := "i Age PropDly RetainDly"; CONSTANT header2 : STRING := "i Sc.Value Output Lastvalue Sc.Time";BEGIN WRITE (outline1, empty); WRITE (outline1, NOW); 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; FOR i IN ScheduleDataArray'RANGE LOOP WRITE (outline1, i ); WRITE (outline1, empty); DelayValue(ScheduleDataArray(i).InputAge, outline1); WRITE (outline1, empty); DelayValue(ScheduleDataArray(i).PropDelay, outline1); WRITE (outline1, empty); DelayValue(ScheduleDataArray(i).OutputRetainDelay, outline1); outline2 := outline1; WRITELINE (LogFile, outline1); IF (PrintDebugMsg = '1') THEN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -