Examples of fixValue()


Examples of ptolemy.data.FixToken.fixValue()

                    localName, stringTokenClass, stringTokenConstructor,
                    StringConstant.v(((StringToken) token).stringValue()));
            return tokenLocal;
        } else if (token instanceof FixToken) {
            FixToken fixToken = (FixToken) token;
            FixPoint fixValue = fixToken.fixValue();
            List args = new ArrayList(3);

            // Some possible loss of precision?
            args.add(DoubleConstant.v(fixValue.doubleValue()));
            args.add(IntConstant.v(fixValue.getPrecision().getNumberOfBits()));
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

                // Try to create a new [fix] type with just one member.
                // The following conversion will fail if the member cannot
                // be converted to an int.
                FixToken singleMember = FixToken.convert(token);
                FixPoint[][] matrix = new FixPoint[1][1];
                matrix[0][0] = singleMember.fixValue();
                return new FixMatrixToken(matrix);
            }
        }
    }
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

            if (!address.hasToken(0)) {
                return;
            }

            FixToken addressToken = (FixToken) address.get(0);
            FixPoint addressFixValue = addressToken.fixValue();

            _checkFixTokenWidth(addressToken, _addressWidth);

            addressValue = addressFixValue.getUnscaledValue().intValue();
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

            if (B.hasToken(0)) {
                inputB = (FixToken) B.get(0);
            }

            if (inputA.fixValue().getPrecision().getNumberOfBits() != inputB
                    .fixValue().getPrecision().getNumberOfBits()) {

                throw new IllegalActionException(this,
                        "Input A has different width than Input B port");
            }
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

        // Concat bits from each input port.
        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(i)) {
                FixToken in = (FixToken) input.get(i);
                bits.append(in.fixValue().toBitString());
            }
        }

        //FIXME: what do we do if input is negative?
        //bits = bits.replace('-', '1');
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

            if (select.hasToken(0)) {
                FixToken channel = (FixToken) select.get(0);

                _checkFixTokenWidth(channel, 1);

                _channel = channel.fixValue().getUnscaledValue().intValue();
            }

            Precision outputPrecision = new Precision(
                    ((Parameter) getAttribute("outputPrecision"))
                            .getExpression());
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

                            "Input A has different width than the output port");
                }
            }
            if (B.hasToken(0)) {
                tokenB = (FixToken) B.get(0);
                if (tokenB.fixValue().getPrecision().getNumberOfBits() != outputPrecision
                        .getNumberOfBits()) {

                    throw new IllegalActionException(this,
                            "Input B has different width than the output port");
                }
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

            // Consume tokens from all input ports.
            FixToken in = ((FixToken) dataIn.get(0));

            FixToken addressToken = (FixToken) address.get(0);
            FixPoint addressFixValue = addressToken.fixValue();

            FixToken writeEnableToken = (FixToken) writeEnable.get(0);
            FixPoint writeEnableValue = writeEnableToken.fixValue();

            _checkFixTokenWidth(writeEnableToken, 1);
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

            FixToken addressToken = (FixToken) address.get(0);
            FixPoint addressFixValue = addressToken.fixValue();

            FixToken writeEnableToken = (FixToken) writeEnable.get(0);
            FixPoint writeEnableValue = writeEnableToken.fixValue();

            _checkFixTokenWidth(writeEnableToken, 1);
            _checkFixTokenWidth(addressToken, _addressWidth);
            _checkFixTokenWidth(in, _dataWidth);
View Full Code Here

Examples of ptolemy.data.FixToken.fixValue()

            if (enable.getContainer() != null && enable.hasToken(0)) {
                FixToken enableToken = (FixToken) enable.get(0);

                _checkFixTokenWidth(enableToken, 1);

                boolean enableValue = enableToken.fixValue().toBitString()
                        .equals("1");

                if (enableValue) {
                    _currentCount++;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.