Thanks Andy, that's great - I'll add that detail to the wiki. I take it from the below that you seen no need to allow modular ranges such as -1 to 6 (for example)? I've had no reponse from anyone else which indicates support for that kind of "modularity" (which I guess is not modular in the maths sense anyway!) either, which I imagine means we can not make it a requirement. Cheers, Martin From: owner-vhdl-200x@eda.org [mailto:owner-vhdl-200x@eda.org] On Behalf Of Jones, Andy D Sent: 24 July 2014 20:37 To: vhdl-200x@eda.org Subject: [vhdl-200x] RE: Modular types Martin, "Overloading" the resolution function (e.g. "resolved") is not required. A resolved subtype declaration can specify a resolution function of any name. We would have to implement integer/natural versions of the logical operations. These would return integer/natural results. They would be much less useful without the use of modular resolved types. Then the modular resolved subtype's resolution function would perform the modulo operation upon assignment or association to/with a signal object of the modular resolved subtype. To permit modular operations using variables, we would need to extend resolution function calls to assignments/associations to/with variables of resolved types. Finally, for ease of declaring modular subtypes of different moduli, we could extend the resolution function specification to include explicit arguments (not including the implicit argument that is associated with the array of driven values.) Example: Subtype modulo4 is modular(4) integer; Where modular() is a resolution function that takes the modulus (positive) and an array of driven values (integer_vector), and returns an integer within the range of 0 to modulus - 1. Without this last change, the user would have to declare a unique resolution function for each value of modulus they wanted to use. Example: Function modular8(driven_values: integer_vector) return integer is Begin Assert driven_values'length = 1; -- do not allow multiple drivers Return driven_values(driven_values'left) mod 8; End function modular8; The above function would then be used to declare the modular subtype: Subtype modulo8 is modular8 integer; An alternative to modifying the syntax in the resolved subtype declaration, available today, would be to put the resolved subtype declaration in a generic package, and instantiate the package for each value of modulus (the generic) needed. Andy D Jones Electrical Engineering Lockheed Martin Missiles and Fire Control Dallas TX From: owner-vhdl-200x@eda.org<mailto:owner-vhdl-200x@eda.org> [mailto:owner-vhdl-200x@eda.org] On Behalf Of Martin.J Thompson Sent: Thursday, July 24, 2014 4:20 AM To: vhdl-200x@eda.org<mailto:vhdl-200x@eda.org> Subject: EXTERNAL: [vhdl-200x] RE: Modular types Hi all, and thanks to Jim for the reminder :) I've summarised the past discussions on the implementation of a modular type. You can find a proposal here: http://www.eda-twiki.org/cgi-bin/view.cgi/P1076/ModularTypes A number of questions are still outstanding... First and foremost: Do we implement as a "new type", or by "extending the operation of resolution functions"? Andy, I'm not sure I've grasped all the implications of your proposed solution through the use of resolution functions. In particular - would it be possible to perform logical operations on modular types merely by overloading the resolution function? Also, * Should logical, shift, etc. operators be allowed on non-power-of-2-modulus? * Should assignment operate like Ada or in what has been described as "the expected way"? * Should modular types *have* to go from 0 to something? Or would -1 to 6 be acceptable? And would it allow logicals, shifts and rotates? Comments welcome! Cheers, Martin -- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Fri Jul 25 00:58:31 2014
This archive was generated by hypermail 2.1.8 : Fri Jul 25 2014 - 01:00:44 PDT