📄 prmtvs_p.vhdl
字号:
-- -- OUT -- none -- -- Returns -- std_logic_vector2 The output of the 2-bit decoder. -- std_logic_vector4 The output of the 4-bit decoder. -- std_logic_vector8 The output of the 8-bit decoder. -- std_logic_vector The output of the n-bit decoder. -- -- ------------------------------------------------------------------------- FUNCTION VitalDECODER ( CONSTANT Data : IN std_logic_vector; CONSTANT Enable : IN std_ulogic; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ) RETURN std_logic_vector; FUNCTION VitalDECODER2 ( CONSTANT Data : IN std_ulogic; CONSTANT Enable : IN std_ulogic; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ) RETURN std_logic_vector2; FUNCTION VitalDECODER4 ( CONSTANT Data : IN std_logic_vector2; CONSTANT Enable : IN std_ulogic; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ) RETURN std_logic_vector4; FUNCTION VitalDECODER8 ( CONSTANT Data : IN std_logic_vector3; CONSTANT Enable : IN std_ulogic; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ) RETURN std_logic_vector8; -- ------------------------------------------------------------------------- -- -- Concurrent -- Primitive -- Procedure Name: VitalDECODER, VitalDECODER2, VitalDECODER4, -- VitalDECODER8 -- -- Description: The VitalDECODER procedures are the concurrent primitive -- procedure calls for decoder functions. The procedures -- are provided for N, 2, 4 and 8 outputs. -- -- The N-bit decoder is (2**(bits of data)) wide. -- -- The procedural form of the decoder is used for -- distributed delay modeling. The delay information for -- each path is passed as an argument to the procedure. -- -- Result is set to 0 if enable is 0. -- The result bit represented by data is set to 1 if -- enable is 1. All other bits of result are set to 0. -- -- The result array is in descending order: (n-1 downto 0). -- -- For the N-bit decoder, the delay path is a vector of -- delays from inputs to outputs. -- -- Arguments: -- -- IN Type Description -- Data std_ulogic Input signal for 2-bit decoder. -- std_logic_vector2 Input signals for 4-bit decoder. -- std_logic_vector3 Input signals for 8-bit decoder. -- std_logic_vector Input signals for N-bit decoder. -- enable std_ulogic Enable input signal. The result is -- output when enable is high. -- tpd_data_q VitalDelayType01 Propagation delay from input data -- to output q for 2-bit decoder. -- VitalDelayArrayType01 Propagation delay from input data -- to output q for 4, 8 and n-bit -- decoders. -- tpd_enable_q VitalDelayType01 Propagation delay from input enable -- to output q for 2, 4, 8 and n-bit -- decoders. -- -- INOUT -- none -- -- OUT -- q std_logic_vector2 Output signals for 2-bit decoder. -- std_logic_vector4 Output signals for 4-bit decoder. -- std_logic_vector8 Output signals for 8-bit decoder. -- std_logic_vector Output signals for n-bit decoder. -- -- Returns -- none -- -- ------------------------------------------------------------------------- PROCEDURE VitalDECODER ( SIGNAL q : OUT std_logic_vector; SIGNAL Data : IN std_logic_vector; SIGNAL Enable : IN std_ulogic; CONSTANT tpd_data_q : IN VitalDelayArrayType01; CONSTANT tpd_enable_q : IN VitalDelayType01 := VitalDefDelay01; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ); PROCEDURE VitalDECODER2 ( SIGNAL q : OUT std_logic_vector2; SIGNAL Data : IN std_ulogic; SIGNAL Enable : IN std_ulogic; CONSTANT tpd_data_q : IN VitalDelayType01 := VitalDefDelay01; CONSTANT tpd_enable_q : IN VitalDelayType01 := VitalDefDelay01; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ); PROCEDURE VitalDECODER4 ( SIGNAL q : OUT std_logic_vector4; SIGNAL Data : IN std_logic_vector2; SIGNAL Enable : IN std_ulogic; CONSTANT tpd_data_q : IN VitalDelayArrayType01; CONSTANT tpd_enable_q : IN VitalDelayType01 := VitalDefDelay01; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ); PROCEDURE VitalDECODER8 ( SIGNAL q : OUT std_logic_vector8; SIGNAL Data : IN std_logic_vector3; SIGNAL Enable : IN std_ulogic; CONSTANT tpd_data_q : IN VitalDelayArrayType01; CONSTANT tpd_enable_q : IN VitalDelayType01 := VitalDefDelay01; CONSTANT ResultMap : IN VitalResultMapType := VitalDefaultResultMap ); -- ------------------------------------------------------------------------- -- Function Name: VitalTruthTable -- -- Description: VitalTruthTable implements a truth table. Given -- a set of inputs, a sequential search is performed -- to match the input. If a match is found, the output -- is set based on the contents of the CONSTANT TruthTable. -- If there is no match, all X's are returned. There is -- no limit to the size of the table. -- -- There is a procedure and function for VitalTruthTable. -- For each of these, a single value output (std_logic) and -- a multi-value output (std_logic_vector) are provided. -- -- The first dimension of the table is for number of -- entries in the truth table and second dimension is for -- the number of elements in a row. The number of inputs -- in the row should be Data'LENGTH plus result'LENGTH. -- -- Elements is a row will be interpreted as -- Input(NumInputs - 1),.., Input(0), -- Result(NumOutputs - 1),.., Result(0) -- -- All inputs will be mapped to the X01 subtype -- -- If the value of Result is not in the range 'X' to 'Z' -- then an error will be reported. Also, the Result is -- always given either as a 0, 1, X or Z value. -- -- Arguments: -- -- IN Type Description -- TruthTable The input constant which defines the -- behavior in truth table form. -- DataIn The inputs to the truth table used to -- perform input match to select -- output(s) to value(s) to drive. -- -- INOUT -- none -- -- OUT -- Result std_logic Concurrent procedure version scalar -- output. -- std_logic_vector Concurrent procedure version vector -- output. -- -- Returns -- Result std_logic Function version scalar output. -- std_logic_vector Function version vector output. -- -- ------------------------------------------------------------------------- FUNCTION VitalTruthTable ( CONSTANT TruthTable : IN VitalTruthTableType; CONSTANT DataIn : IN std_logic_vector ) RETURN std_logic_vector; FUNCTION VitalTruthTable ( CONSTANT TruthTable : IN VitalTruthTableType; CONSTANT DataIn : IN std_logic_vector ) RETURN std_logic; PROCEDURE VitalTruthTable ( SIGNAL Result : OUT std_logic_vector; CONSTANT TruthTable : IN VitalTruthTableType; SIGNAL DataIn : IN std_logic_vector -- IR#236 ); PROCEDURE VitalTruthTable ( SIGNAL Result : OUT std_logic; CONSTANT TruthTable : IN VitalTruthTableType; SIGNAL DataIn : IN std_logic_vector -- IR#236 ); -- ------------------------------------------------------------------------- -- -- Function Name: VitalStateTable -- -- Description: VitalStateTable is a non-concurrent implementation of a -- state machine (Moore Machine). It is used to model -- sequential devices and devices with internal states. -- -- The procedure takes the value of the state table -- data set and performs a sequential search of the -- CONSTANT StateTable until a match is found. Once a -- match is found, the result of that match is applied -- to Result. If there is no match, all X's are returned. -- The resultant output becomes the input for the next -- state. -- -- The first dimension of the table is the number of -- entries in the state table and second dimension is the -- number of elements in a row of the table. The number of -- inputs in the row should be DataIn'LENGTH. Result should -- contain the current state (which will become the next -- state) as well as the outputs -- -- Elements is a row of the table will be interpreted as -- Input(NumInputs-1),.., Input(0), State(NumStates-1), -- ..., State(0),Output(NumOutputs-1),.., Output(0) -- -- where State(numStates-1) DOWNTO State(0) represent the -- present state and Output(NumOutputs - 1) DOWNTO -- Outputs(NumOutputs - NumStates) represent the new -- values of the state variables (i.e. the next state). -- Also, Output(NumOutputs - NumStates - 1) -- -- This procedure returns the next state and the new -- outputs when a match is made between the present state -- and present inputs and the state table. A search is -- made starting at the top of the state table and -- terminates with the first match. If no match is found -- then the next state and new outputs are set to all 'X's. -- -- (Asynchronous inputs (i.e. resets and clears) must be -- handled by placing the corresponding entries at the top -- of the table. ) -- -- All inputs will be mapped to the X01 subtype. -- -- NOTE: Edge transitions should not be used as values -- for the state variables in the present state -- portion of the state table. The only valid -- values that can be used for the present state -- portion of the state table are: -- 'X', '0', '1', 'B', '-' -- -- Arguments: -- -- IN Type Description -- StateTable VitalStateTableType The input constant which defines -- the behavior in state table form. -- DataIn std_logic_vector The current state inputs to the -- state table used to perform input -- matches and transition -- calculations. -- NumStates NATURAL Number of state variables -- -- INOUT -- Result
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -