On 1 Jul 2014, at 8:24 am, ryan.w.hinton@L-3com.com wrote: > FYI, we have a proposal to add arbitrary-range integers. My current favorite option (http://www.eda-twiki.org/cgi-bin/view.cgi/P1076/ArbitraryIntegers#Candidate_expose_UNIVERSAL_INTEG) exposes the UNIVERSAL_INTEGER type as arbitrary width, then keeps INTEGER as implementation-defined but at least signed 32 bits. Arbitrary size arithmetic tends to get partitioned into discrete steps and operand size doesn't it? There's an operand size where arithmetic becomes un-weildy due to wire delays if nothing else. You could note that today any library or functions to implement arbitrary integers would depend on underlying types or operators in a series to reach some arbitrary length (which would be bounded in some fashion). This would likely reflect how any synthesis is done as well. Going through Ada's 4.5 Operators and Expression Evaluation (4.5.1 - 4.6) http://www.adaic.org/resources/add_content/standards/05rm/html/RM-TOC.html for modular integer impact and we see the apparent purpose of modular integers is two fold, limiting the the range of operator results by modulus and providing support for 'bit-wise' logical operators on modular integers. The former not an issue with arbitrary integers, the latter constrained by arithmetic execution time compared to use of 'bit' array representations. (Although I imagine you could use a generate statement with a for generation scheme to create constants for all the 'bits'.). I'm not sure arbitrary integer has a strong place in this issue. > Assuming we accept this proposal in some form, if you ask for integer'high ** integer'high you will be waiting quite a long time for the answer. Kind of like when I forget a wait statement in my process. There are lots of other ways to send the simulator off to an effectively infinite calculation; arbitrary-range integers won't break anything that isn't broken already. The increase in execution time is related to precision. Adding `bit-wise` operators to arbitrary integers sounds like a lot of arithmetic: 4.5.1 Logical Operators and Short-circuit Control Forms http://www.adaic.org/resources/add_content/standards/05rm/html/RM-4-5-1.html ... The following logical operators are predefined for every boolean type T, for every modular type T, and for every one-dimensional array type T whose component type is a boolean type: function "and"(Left, Right : T) return T function "or" (Left, Right : T) return T function "xor"(Left, Right : T) return T ... For modular types, the predefined logical operators are defined on a bit-by-bit basis, using the binary representation of the value of the operands to yield a binary representation for the result, where zero represents False and one represents True. If this result is outside the base range of the type, a final subtraction by the modulus is performed to bring the result into the base range of the type. -- Noting that in 9.2.2 Logical operators, VHDL also has "nand", "nor" and "xnor". In any event the point here is that there is a cross over point for model execution for logical operators that makes interesting arbitrary integer size uninteresting compared to a 'bit' oriented array type. Also see Add Operators to Integers http://www.eda-twiki.org/cgi-bin/view.cgi/P1076/IntegerOperators You could also note the modulus implied in arithmetic operators could be as expensive: 4.5.3 Binary Adding Operators http://www.adaic.org/resources/add_content/standards/05rm/html/RM-4-5-3.html ... NOTES 14 As for all predefined operators on modular types, the binary adding operators + and – on modular types include a final reduction modulo the modulus if the result is outside the base range of the type. -- And you could contemplate that the 'HIGH bound would need to be recorded as an arbitrary integer type or an attribute used to tell whether or not the 'HIGH bound is out of range for an integer type. Anything do do with a modular integer could imply operators using arbitrary integers. There's simply a size (length versus modulus) where 'bit' oriented array types win out over the use of arbitrary integers. The question might be framed in terms of base integer size from a modular integer, is the minimum natural range of an integer sufficient? (and if not, is a 64 bit integer, 128 bit integers?...) > So the current integer range need not restrict the discussion of modular types. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Jun 30 20:22:35 2014
This archive was generated by hypermail 2.1.8 : Mon Jun 30 2014 - 20:23:01 PDT