Subject: Re: Checking for dimensional consistency in VHDL-AMS models
From: Mark Zwolinski (mz@ecs.soton.ac.uk)
Date: Fri Dec 17 1999 - 10:29:47 PST
Joe Gwinn wrote:
>
> Some years ago, during the development of the VHDL-AMS standard, there was
> a desire to build into the VHDL-AMS language some kind of type-checking
> mechanism to detect inconsistent use of dimensions (meters, seconds, m/s,
> newtons, amps, etc) in the user-written equations describing the system
> being modeled. At the time, dimensional checking was voted down, on the
> theory that we didn't know how to do such a thing, and so didn't know how
> to write the VHDL-AMS to implement such consistency checking.
>
> The physics community writes very large mathematical models of physics
> problems, now using C++, and they had the same desire to find an efficient
> yet effective way to catch inconsistent dimensions in equations, to reduce
> the difficulty and expense of debugging their simulation code.
>
> Now, years later, the physics community has solved the problem, at least
> for C++, and their solution could be a model for a future extension of
> VHDL-AMS. The following website, from Los Alamos National Laboratory, is
> a good starting point:
>
> http://www.fnal.gov/fermitools/abstracts/siunits/abstract.html
>
> Title: "The SI Library of Unit-Based Computation"
>
> Joe Gwinn
Joe,
I think you should be thanked for finding this. It does appear to solve
the dimension checking problem - for C++. I haven't completely
understood how the technique works, BUT it should be noted that the
checking takes place at compile time. There is heavy reliance on
templates, inline coding and #defines. I can't see how this would
translate into VHDL(-AMS). I'm not even sure that the various
object-oriented extensions to VHDL offer the kinds of mechanisms needed
for this method to work.
Having said that, the basic idea (as I understand it) that any quantity
has a dimension attribute expressed as powers of seven fundamental
dimensions seems like a good starting point. (One moment ... "quantity",
"attribute" - have I inadvertently suggested a solution? - let me think
about that!)
Mark
-- =================================================================== Dr Mark Zwolinski Electronic System Design Group Tel. (+44) (0)23 8059 3528 Dept. of Electronics & Computer Science Fax. (+44) (0)23 8059 2901 University of Southampton Email. mz@ecs.soton.ac.uk Southampton SO17 1BJ, UK http://www.ecs.soton.ac.uk/~mz
This archive was generated by hypermail 2b28 : Wed Jan 26 2000 - 15:58:30 PST