Ejemplo n.º 1
0
        public AbstractValue Evaluate(Or expr)
        {
            AbstractValue left  = Evaluate(expr.Left);
            AbstractValue right = Evaluate(expr.Right);

            if ((left != null) && (right != null) && (left is STD_ULOGIC_VALUE) && (right is STD_ULOGIC_VALUE))
            {
                return(STD_ULOGIC_VALUE.OR(left as STD_ULOGIC_VALUE, right as STD_ULOGIC_VALUE));
            }
            throw new NotImplementedException();
        }
Ejemplo n.º 2
0
        public AbstractValue Evaluate(Not expr)
        {
            AbstractValue val = Evaluate(expr.Expression);

            if ((val != null) && (val is CHARACTER_VALUE))
            {
                STD_LOGIC_VALUE v = STD_LOGIC_VALUE.CreateSTD_LOGIC_VALUE(((val as CHARACTER_VALUE).Value as VHDL.type.EnumerationType.CharacterEnumerationLiteral).getLiteral());
                return(STD_LOGIC_VALUE.NOT(v as STD_LOGIC_VALUE));
            }

            if ((val != null) && (val is STD_LOGIC_VALUE))
            {
                return(STD_LOGIC_VALUE.NOT(val as STD_LOGIC_VALUE));
            }

            if ((val != null) && (val is STD_ULOGIC_VALUE))
            {
                return(STD_ULOGIC_VALUE.NOT(val as STD_ULOGIC_VALUE));
            }
            return(null);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Преобразование STD_ULOGIC_VALUE в строку
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public static string ToTestBenchString(STD_ULOGIC_VALUE value)
 {
     return(new string(new char[] { (value.Value as VHDL.type.EnumerationType.CharacterEnumerationLiteral).getLiteral() }));
 }