

|
 |
| Electronic Equipment > VHDL > Re: Signed, Uns... |
|
| << Topic |
< Post |
Post 44 of 49 Topic 6057 of 6417
|
Post > |
Topic >> |
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
by Jonathan Bromley <jonathan.bromley@[EMAIL PROTECTED]
>
Jun 15, 2008 at 09:25 PM
| On Sun, 15 Jun 2008 10:32:43 -0700, Jim Lewis wrote:
>> [overloaded := operator] would prevent errors that are
>> currently unavoidable: if you use := or <= to copy a
>> fixed-point value from one place to another, and the
>> target object is of the wrong subytpe, you can get its
>> fixed-point scaling silently and disastrously screwed-up.
>
>For fixed point math, to address the range issue, this seems
>reasonable, but it also seems open other issues. For example,
>if I use an intermediate object that is too small, overloading
>":=" will automatically downsize it.
This is true, although errors of precision seem to me
to be less disastrous than errors of scaling. In truth,
there is probably no one-size-fits-all solution to this
kind of problem. For example, fixed-point math surely
needs both saturating and truncating forms of overflow;
how can that be controlled, for individual assignments,
without needing very clunky syntax?
VHDL is a million miles ahead of Verilog, and of just about
any other language, in its ability to sup****t this kind of
control. Assignment overloading allows the programmer to
take *sub*type compatibility into account for assignment,
whereas the base language only considers *type*
compatibility. In an ideal world one could imagine the
ability to add user attributes that behave more like
built-in attributes - i.e. they propagate from actual to
formal parameters of a subprogram - so that a variable
could be tagged as "when assigning to me, do saturating
overflow" or "when assigning to me, error out if my
(target) subtype doesn't match the expression's subtype".
>> Personally I think this leaves VHDL's fixed-point package
>> holed below the waterline; I would never use it on a
>> serious project because of this risk of silent rescaling.
>I think no matter what you do there are issues to watch.
Fair enough. I took care to qualify my statement with
"personally" - others will surely see things differently.
>> Reason 2: There are a few places in VHDL where you need a
>> boolean expression, but other kinds of expression would
>> make good sense. For example:
>>
>> signal enable: std_logic;
>> ...
>> if enable then ... -- currently illegal
>
>There is something for this already ("??"). Although := overloading
>could be made to work the same way. There are lots of details.
OK. Again there's some personal preference/prejudice at work
here: I'm probably over-sensitive in my distaste for special-
purpose syntax designed to deal with a single issue.
Thanks for the sanity-check!
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@[EMAIL PROTECTED]
contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.


|
49 Posts in Topic:
|
nitrogenocide@[EMAIL PROT |
2008-05-31 11:58:04 |
|
Mike Treseler <mtresel |
2008-05-31 12:41:27 |
|
Mike Treseler <mtresel |
2008-05-31 12:43:10 |
|
"KJ" <kkjenn |
2008-05-31 15:41:06 |
|
Jonathan Bromley <jona |
2008-05-31 20:43:17 |
|
"KJ" <kkjenn |
2008-05-31 19:53:08 |
|
Andy Peters <google@[E |
2008-06-02 15:04:56 |
|
rickman <gnuarm@[EMAIL |
2008-06-09 11:06:36 |
|
Mike Treseler <mike_tr |
2008-06-09 11:28:44 |
|
Andy <jonesandy@[EMAIL |
2008-06-09 12:42:54 |
|
rickman <gnuarm@[EMAIL |
2008-06-09 16:55:47 |
|
Jim Lewis <jim@[EMAIL |
2008-06-09 17:14:34 |
|
Mike Treseler <mike_tr |
2008-06-09 17:26:13 |
|
Andy <jonesandy@[EMAIL |
2008-06-10 14:59:39 |
|
rickman <gnuarm@[EMAIL |
2008-06-11 08:52:56 |
|
Mike Treseler <mike_tr |
2008-06-11 11:14:07 |
|
Brian Drummond <brian_ |
2008-06-12 14:02:55 |
|
Brian Drummond <brian_ |
2008-06-16 11:43:24 |
|
Jonathan Bromley <jona |
2008-06-16 12:45:30 |
|
Brian Drummond <brian_ |
2008-06-17 12:18:49 |
|
Jim Lewis <jim@[EMAIL |
2008-06-12 11:42:18 |
|
"KJ" <kkjenn |
2008-06-12 21:41:42 |
|
Jim Lewis <jim@[EMAIL |
2008-06-15 10:38:11 |
|
"KJ" <kkjenn |
2008-06-15 20:25:41 |
|
Jim Lewis <jim@[EMAIL |
2008-06-16 09:22:19 |
|
KJ <kkjennings@[EMAIL |
2008-06-16 07:35:46 |
|
KJ <kkjennings@[EMAIL |
2008-06-11 09:17:20 |
|
KJ <kkjennings@[EMAIL |
2008-06-11 11:41:59 |
|
rickman <gnuarm@[EMAIL |
2008-06-12 00:11:48 |
|
Mike Treseler <mike_tr |
2008-06-12 09:51:58 |
|
KJ <kkjennings@[EMAIL |
2008-06-12 04:58:01 |
|
rickman <gnuarm@[EMAIL |
2008-06-12 21:02:00 |
|
Mike Treseler <mike_tr |
2008-06-13 10:31:24 |
|
rickman <gnuarm@[EMAIL |
2008-06-12 21:10:12 |
|
KJ <kkjennings@[EMAIL |
2008-06-13 05:24:59 |
|
Jim Lewis <jim@[EMAIL |
2008-06-15 10:06:35 |
|
rickman <gnuarm@[EMAIL |
2008-06-13 17:05:12 |
|
rickman <gnuarm@[EMAIL |
2008-06-13 17:25:08 |
|
"KJ" <kkjenn |
2008-06-13 22:35:18 |
|
rickman <gnuarm@[EMAIL |
2008-06-13 20:58:54 |
|
"MikeWhy" <b |
2008-06-14 02:30:44 |
|
Jonathan Bromley <jona |
2008-06-14 11:27:40 |
|
Jim Lewis <jim@[EMAIL |
2008-06-15 10:32:43 |
|
Jonathan Bromley <jona |
2008-06-15 21:25:43 |
|
"KJ" <kkjenn |
2008-06-15 20:43:25 |
|
"KJ" <kkjenn |
2008-06-14 12:52:42 |
|
"KJ" <kkjenn |
2008-06-14 12:47:00 |
|
Andy <jonesandy@[EMAIL |
2008-06-16 06:08:33 |
|
KJ <kkjennings@[EMAIL |
2008-06-16 07:16:43 |
|
Post A Reply:

|
|
|
|