Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #572618 > unrolled thread

design rigor: electronics vs. software

Started byomnilobe@gmail.com
First post2020-01-10 21:46 -0800
Last post2020-01-15 05:58 -0800
Articles 13 on this page of 133 — 24 participants

Back to article view | Back to sci.electronics.design


Contents

  design rigor: electronics vs. software omnilobe@gmail.com - 2020-01-10 21:46 -0800
    Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-10 22:10 -0800
      Re: design rigor: electronics vs. software Winfield Hill <winfieldhill@yahoo.com> - 2020-01-11 05:57 -0800
        Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-11 06:57 -0800
          Re: design rigor: electronics vs. software upsidedown@downunder.com - 2020-01-11 17:32 +0200
            Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-11 07:49 -0800
              Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-11 16:09 +0000
            Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-11 15:54 +0000
          Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-11 08:52 -0800
            Re: design rigor: electronics vs. software John S <Sophi.2@invalid.org> - 2020-01-11 11:07 -0600
              Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-11 09:16 -0800
                Re: design rigor: electronics vs. software John S <Sophi.2@invalid.org> - 2020-01-11 15:24 -0600
            Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-11 17:59 +0000
            Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-11 18:08 +0000
              Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-11 14:03 -0800
                Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-11 15:58 -0800
                  Re: design rigor: electronics vs. software Winfield Hill <winfieldhill@yahoo.com> - 2020-01-11 17:50 -0800
                    Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-11 19:09 -0800
                    Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-11 21:42 -0800
                      Re: design rigor: electronics vs. software George Herold <ggherold@gmail.com> - 2020-01-12 15:10 -0800
                        Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-12 17:04 -0800
                        Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-13 09:58 -0800
          Re: design rigor: electronics vs. software Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2020-01-12 16:58 +0000
            Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-12 18:25 +0000
            Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-12 18:32 +0000
            Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-12 15:20 -0500
              Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-12 20:31 +0000
                Re: design rigor: electronics vs. software jjhudak4@gmail.com - 2020-01-12 14:38 -0800
                  Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-12 17:55 -0500
                    Re: design rigor: electronics vs. software Klaus Kragelund <klauskvik@hotmail.com> - 2020-01-12 15:34 -0800
                    Re: design rigor: electronics vs. software Clifford Heath <no.spam@please.net> - 2020-01-13 10:47 +1100
                    Re: design rigor: electronics vs. software jjhudak4@gmail.com - 2020-01-12 16:13 -0800
                      Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-12 19:33 -0500
                        Re: design rigor: electronics vs. software three_jeeps <jjhudak@gmail.com> - 2020-01-14 11:43 -0800
                    Re: design rigor: electronics vs. software jjhudak4@gmail.com - 2020-01-12 16:23 -0800
                  Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-12 15:38 -0800
              Re: design rigor: electronics vs. software Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2020-01-14 08:34 +0000
            Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-12 17:07 -0800
              Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-13 09:04 +0000
                Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-13 09:27 +0000
                Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-13 09:01 -0500
                  Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-13 16:22 +0000
                    Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-13 20:35 -0500
                Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-13 07:45 -0800
                  Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-13 16:35 +0000
                    Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-13 09:49 -0800
                Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-13 07:58 -0800
                  Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-13 16:40 +0000
                    Re: design rigor: electronics vs. software John Larkin <jjlarkin@highlandtechnology.com> - 2020-01-13 09:41 -0800
                      Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-13 10:14 -0800
                      Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-13 19:26 +0000
                        Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-13 18:43 -0800
                          Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-14 08:19 +0000
                            Re: design rigor: electronics vs. software RBlack <news@rblack01.plus.com> - 2020-01-14 09:34 +0000
                            Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-14 08:39 -0800
                              Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-14 17:27 +0000
                              Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-14 12:35 -0500
                                Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-14 09:49 -0800
                                Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-14 17:53 +0000
                                  Re: design rigor: electronics vs. software John Larkin <jlarkin@highland_atwork_technology.com> - 2020-01-14 11:45 -0800
                                    Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-14 21:55 +0000
                                Re: design rigor: electronics vs. software RBlack <news@rblack01.plus.com> - 2020-01-15 08:17 +0000
                                  Blood glucose (was: design rigor: electronics vs. software) Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-15 07:28 -0500
                                    Re: Blood glucose (was: design rigor: electronics vs. software) Steve Wilson <9fe142ac@gmail.com> - 2020-01-15 05:41 -0800
                                      Re: Blood glucose Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-15 10:15 -0500
                                        Re: Blood glucose Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-15 11:47 -0500
                                          Re: Blood glucose jlarkin@highlandsniptechnology.com - 2020-01-15 09:15 -0800
                                        Re: Blood glucose Steve Wilson <no@spam.com> - 2020-01-15 18:06 +0000
                                    Re: Blood glucose (was: design rigor: electronics vs. software) jlarkin@highlandsniptechnology.com - 2020-01-15 07:46 -0800
                                      Re: Blood glucose Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-15 11:00 -0500
                                      Re: Blood glucose (was: design rigor: electronics vs. software) George Herold <ggherold@gmail.com> - 2020-01-15 10:59 -0800
                                    Re: Blood glucose (was: design rigor: electronics vs. software) George Herold <ggherold@gmail.com> - 2020-01-15 10:43 -0800
                                      Re: Blood glucose Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-15 14:29 -0500
                                        Re: Blood glucose George Herold <ggherold@gmail.com> - 2020-01-15 12:45 -0800
                                          Re: Blood glucose Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-15 16:01 -0500
                                            Re: Blood glucose DecadentLinuxUserNumeroUno@decadence.org - 2020-01-16 02:52 +0000
                                    Re: Blood glucose (was: design rigor: electronics vs. software) RBlack <news@rblack01.plus.com> - 2020-01-16 11:18 +0000
                                      Re: Blood glucose Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-16 09:39 -0500
                                        Re: Blood glucose omnilobe@gmail.com - 2020-01-16 16:03 -0800
                                          Re: Blood glucose Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-16 16:38 -0800
                                          Re: Blood glucose Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-16 20:32 -0500
                                          Re: Blood glucose Bill Sloman <bill.sloman@ieee.org> - 2020-01-16 19:01 -0800
                  Re: design rigor: electronics vs. software Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2020-01-15 09:01 +0000
                    Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-15 09:46 +0000
                    Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-15 09:48 +0000
                    Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-15 07:49 -0800
        Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-11 15:01 +0000
          Re: design rigor: electronics vs. software Winfield Hill <winfieldhill@yahoo.com> - 2020-01-11 07:27 -0800
            Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-11 15:44 +0000
              Re: design rigor: electronics vs. software Winfield Hill <winfieldhill@yahoo.com> - 2020-01-11 08:06 -0800
                Re: design rigor: electronics vs. software mpm <mpmillard@aol.com> - 2020-01-13 16:39 -0800
              Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-13 18:50 -0800
            Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-13 18:46 -0800
              Re: design rigor: electronics vs. software Clifford Heath <no.spam@please.net> - 2020-01-14 17:11 +1100
                Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-13 22:23 -0800
                  Re: design rigor: electronics vs. software Clifford Heath <no.spam@please.net> - 2020-01-14 20:28 +1100
                    Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-14 01:44 -0800
                      Re: design rigor: electronics vs. software Clifford Heath <no.spam@please.net> - 2020-01-14 21:06 +1100
                        Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-14 02:17 -0800
                          Re: design rigor: electronics vs. software Clifford Heath <no.spam@please.net> - 2020-01-14 23:04 +1100
                        Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-14 08:42 -0800
                Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-14 13:03 +0000
                Re: design rigor: electronics vs. software John Larkin <jlarkin@highland_atwork_technology.com> - 2020-01-14 11:48 -0800
              Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-13 22:14 -0800
      Re: design rigor: electronics vs. software mpm <mpmillard@aol.com> - 2020-01-13 16:35 -0800
        Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-13 20:43 -0500
        Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-13 21:53 -0800
          Re: design rigor: electronics vs. software mpm <mpmillard@aol.com> - 2020-01-14 18:04 -0800
            Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-14 18:23 -0800
          Re: design rigor: electronics vs. software DecadentLinuxUserNumeroUno@decadence.org - 2020-01-15 02:41 +0000
    Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-11 06:47 -0800
      Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-11 08:47 -0800
      Re: design rigor: electronics vs. software bitrex <user@example.net> - 2020-01-11 17:31 -0500
        Re: design rigor: electronics vs. software Rick C <gnuarm.deletethisbit@gmail.com> - 2020-01-11 16:00 -0800
          Re: design rigor: electronics vs. software bitrex <user@example.net> - 2020-01-12 03:04 -0500
        Re: design rigor: electronics vs. software John Robertson <spam@flippers.com> - 2020-01-11 16:53 -0800
          Re: design rigor: electronics vs. software bitrex <user@example.net> - 2020-01-12 03:01 -0500
        Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-13 18:51 -0800
          Re: design rigor: electronics vs. software bitrex <user@example.net> - 2020-01-14 16:31 -0500
            Re: design rigor: electronics vs. software Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2020-01-14 16:43 -0500
              Re: design rigor: electronics vs. software bitrex <user@example.net> - 2020-01-15 18:33 -0500
                Re: design rigor: electronics vs. software bitrex <user@example.net> - 2020-01-15 18:38 -0500
        Re: design rigor: electronics vs. software Tom Gardner <spamjunk@blueyonder.co.uk> - 2020-01-14 08:23 +0000
      Re: design rigor: electronics vs. software RBlack <news@rblack01.plus.com> - 2020-01-13 09:27 +0000
        Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-13 18:56 -0800
          Re: design rigor: electronics vs. software RBlack <news@rblack01.plus.com> - 2020-01-14 09:15 +0000
            Re: design rigor: electronics vs. software jlarkin@highlandsniptechnology.com - 2020-01-14 08:28 -0800
              Re: design rigor: electronics vs. software Steve Wilson <no@spam.com> - 2020-01-14 16:43 +0000
                Re: design rigor: electronics vs. software John Larkin <jlarkin@highland_atwork_technology.com> - 2020-01-14 11:52 -0800
                  Re: design rigor: electronics vs. software Steve Wilson <no@spam.com> - 2020-01-14 22:21 +0000
                    Re: design rigor: electronics vs. software John Larkin <jlarkin@highland_atwork_technology.com> - 2020-01-14 16:00 -0800
              Re: design rigor: electronics vs. software Steve Wilson <no@spam.com> - 2020-01-14 16:49 +0000
      Re: design rigor: electronics vs. software Bill Sloman <bill.sloman@ieee.org> - 2020-01-15 05:58 -0800

Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]


#573213

Frombitrex <user@example.net>
Date2020-01-15 18:33 -0500
Message-ID<IjNTF.4265$ew4.1612@fx25.iad>
In reply to#573063
On 1/14/20 4:43 PM, Phil Hobbs wrote:
> On 2020-01-14 16:31, bitrex wrote:
>> On 1/13/20 9:51 PM, jlarkin@highlandsniptechnology.com wrote:
>>> On Sat, 11 Jan 2020 17:31:26 -0500, bitrex <user@example.net> wrote:
>>>
>>>> On 1/11/20 9:47 AM, jlarkin@highlandsniptechnology.com wrote:
>>>>> On Fri, 10 Jan 2020 21:46:19 -0800 (PST), omnilobe@gmail.com wrote:
>>>>>
>>>>>> Hardware designs are more rigorously done than software designs. A 
>>>>>> large company had problems with a 737 and a
>>>>>> rocket to the space station...
>>>>>>
>>>>>> https://www.bloomberg.com/news/articles/2019-06-28/boeing-s-737-max-software-outsourced-to-9-an-hour-engineers 
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I know programmers who do not care for rigor at home at work.
>>>>>> I did hardware design with rigor and featuring reviews by
>>>>>> caring electronics design engineers and marketing engineers.
>>>>>>
>>>>>> Software gets sloppy with OOPs. Object Oriented Programming.
>>>>>>  Windows 10 on a rocket to ISS space station. C++ mud.
>>>>>
>>>>> The easier it is to change things, the less careful people are 
>>>>> about doing them. Software, which includes FPGA code, seldom works 
>>>>> the first time. Almost never. The average hunk of fresh code has a 
>>>>> mistake roughly every 10 lines. Or was that three?
>>>>>
>>>>> FPGAs are usually better than procedural code, but are still mostly 
>>>>> done as hack-and-fix cycles, with software test
>>>>> benches. When we did OTP (fuse based) FPGAs without test
>>>>> benching, we often got them right first try. If compiles took
>>>>> longer, people would be more careful.
>>>>>
>>>>> PCBs usually work the first time, because they are checked and
>>>>>  reviewed, and that is because mistakes are slow and expensive
>>>>>  to fix, and very visible to everyone. Bridges and buildings
>>>>> are almost always right the first time. They are even more 
>>>>> expensive and slow and visible.
>>>>>
>>>>> Besides, electronics and structures have established theory, but 
>>>>> software doesn't. Various people just sort of do it.
>>>>>
>>>>> My Spice sims are often wrong initially, precisely because there 
>>>>> are basically no consequences to running the first try without much 
>>>>> checking. That is of course dangerous; we don't want to base a 
>>>>> hardware design on a sim that runs and makes pretty graphs but is 
>>>>> fundamentally wrong.
>>>>>
>>>>
>>>> Don't know why C++ is getting the rap here. Modern C++ design is
>>>>  rigorous, there are books about what to do and what not to do, and 
>>>> the language has built-in facilities to ensure that e.g. memory is 
>>>> never leaked, pointers always refer to an object that exists, and 
>>>> the user can't ever add feet to meters if they're
>>>> not supposed to.
>>>
>>> Pointers are evil.
> 
>> That's why in modern times you avoid working with "naked" ones at
>> all costs. In architectures with managed memory like x86 and ARM with
>> an operating system there's pretty much no good reason to use naked 
>> pointers at all unless you are yourself writing a memory manager or 
>> allocator.
> 
> That's a bit strong. It's still reasonable to use void* deep in the
> implementation of templates for performance-critical stuff.  My
> clusterized EM simulator uses bare pointers in structs, because they
> vectorize dramatically better, but again that's optimized innermost-loop
> stuff.
> 
> For other things, std::shared_ptr, std::unique_ptr, std::weak_ptr, and
> the standard containers are the bomb.

And unique pointers also have no overhead as compared to raw pointers. 
They enforce ownership at no cost.

For bare-metal programming on small ARM processors without managed 
memory you often have no choice but to resort to raw pointers but 
something like a std::observer_ptr, a non-owning pointer, would be nice.

Storing raw references in classes and structures is problematic when you 
add in move construction and assignment, same with const-qualified raw 
pointers. Returning qualified raw pointers from functions and passing 
them into classes/constructors is prickly, too. std::reference_wrapper 
makes a raw reference move-able but a reference isn't always what you 
want since it assumes the object it refers to is "alive"

Something like that may exist.  Wouldn't be too hard to write one I guess.

>> There are test suites to find all potential memory leaks! There's no
>> good excuse to have programs that leak resources anymore...
> 
> RAII is really good medicine.  I used to like mudflap a lot, but it got 
> rolled up into GCC's sanitizers, which are super useful too.
> 
> Cheers
> 
> Phil Hobbs
> 

[toc] | [prev] | [next] | [standalone]


#573216

Frombitrex <user@example.net>
Date2020-01-15 18:38 -0500
Message-ID<TnNTF.168708$aD6.93616@fx38.iad>
In reply to#573213
On 1/15/20 6:33 PM, bitrex wrote:
> On 1/14/20 4:43 PM, Phil Hobbs wrote:
>> On 2020-01-14 16:31, bitrex wrote:
>>> On 1/13/20 9:51 PM, jlarkin@highlandsniptechnology.com wrote:
>>>> On Sat, 11 Jan 2020 17:31:26 -0500, bitrex <user@example.net> wrote:
>>>>
>>>>> On 1/11/20 9:47 AM, jlarkin@highlandsniptechnology.com wrote:
>>>>>> On Fri, 10 Jan 2020 21:46:19 -0800 (PST), omnilobe@gmail.com wrote:
>>>>>>
>>>>>>> Hardware designs are more rigorously done than software designs. 
>>>>>>> A large company had problems with a 737 and a
>>>>>>> rocket to the space station...
>>>>>>>
>>>>>>> https://www.bloomberg.com/news/articles/2019-06-28/boeing-s-737-max-software-outsourced-to-9-an-hour-engineers 
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I know programmers who do not care for rigor at home at work.
>>>>>>> I did hardware design with rigor and featuring reviews by
>>>>>>> caring electronics design engineers and marketing engineers.
>>>>>>>
>>>>>>> Software gets sloppy with OOPs. Object Oriented Programming.
>>>>>>>  Windows 10 on a rocket to ISS space station. C++ mud.
>>>>>>
>>>>>> The easier it is to change things, the less careful people are 
>>>>>> about doing them. Software, which includes FPGA code, seldom works 
>>>>>> the first time. Almost never. The average hunk of fresh code has a 
>>>>>> mistake roughly every 10 lines. Or was that three?
>>>>>>
>>>>>> FPGAs are usually better than procedural code, but are still 
>>>>>> mostly done as hack-and-fix cycles, with software test
>>>>>> benches. When we did OTP (fuse based) FPGAs without test
>>>>>> benching, we often got them right first try. If compiles took
>>>>>> longer, people would be more careful.
>>>>>>
>>>>>> PCBs usually work the first time, because they are checked and
>>>>>>  reviewed, and that is because mistakes are slow and expensive
>>>>>>  to fix, and very visible to everyone. Bridges and buildings
>>>>>> are almost always right the first time. They are even more 
>>>>>> expensive and slow and visible.
>>>>>>
>>>>>> Besides, electronics and structures have established theory, but 
>>>>>> software doesn't. Various people just sort of do it.
>>>>>>
>>>>>> My Spice sims are often wrong initially, precisely because there 
>>>>>> are basically no consequences to running the first try without 
>>>>>> much checking. That is of course dangerous; we don't want to base 
>>>>>> a hardware design on a sim that runs and makes pretty graphs but 
>>>>>> is fundamentally wrong.
>>>>>>
>>>>>
>>>>> Don't know why C++ is getting the rap here. Modern C++ design is
>>>>>  rigorous, there are books about what to do and what not to do, and 
>>>>> the language has built-in facilities to ensure that e.g. memory is 
>>>>> never leaked, pointers always refer to an object that exists, and 
>>>>> the user can't ever add feet to meters if they're
>>>>> not supposed to.
>>>>
>>>> Pointers are evil.
>>
>>> That's why in modern times you avoid working with "naked" ones at
>>> all costs. In architectures with managed memory like x86 and ARM with
>>> an operating system there's pretty much no good reason to use naked 
>>> pointers at all unless you are yourself writing a memory manager or 
>>> allocator.
>>
>> That's a bit strong. It's still reasonable to use void* deep in the
>> implementation of templates for performance-critical stuff.  My
>> clusterized EM simulator uses bare pointers in structs, because they
>> vectorize dramatically better, but again that's optimized innermost-loop
>> stuff.
>>
>> For other things, std::shared_ptr, std::unique_ptr, std::weak_ptr, and
>> the standard containers are the bomb.
> 
> And unique pointers also have no overhead as compared to raw pointers. 
> They enforce ownership at no cost.
> 
> For bare-metal programming on small ARM processors without managed 
> memory you often have no choice but to resort to raw pointers but 
> something like a std::observer_ptr, a non-owning pointer, would be nice.
> 
> Storing raw references in classes and structures is problematic when you 
> add in move construction and assignment, same with const-qualified raw 
> pointers. Returning qualified raw pointers from functions and passing 
> them into classes/constructors is prickly, too. std::reference_wrapper 
> makes a raw reference move-able but a reference isn't always what you 
> want since it assumes the object it refers to is "alive"
> 
> Something like that may exist.  Wouldn't be too hard to write one I guess.

Another thing I do is when array-like data doesn't require very fast 
access I store it in a List<something> class, and the data is accessed 
via iterators rather than manipulating the underlying array directly.

Array indexing errors are the source of a lot of bugs, sanity-checking 
access to the underlying array is a good thing whenever you can afford 
the overhead.

[toc] | [prev] | [next] | [standalone]


#572997

FromTom Gardner <spamjunk@blueyonder.co.uk>
Date2020-01-14 08:23 +0000
Message-ID<rUeTF.167220$GFe.133068@fx12.am4>
In reply to#572705
On 11/01/20 22:31, bitrex wrote:
> On 1/11/20 9:47 AM, jlarkin@highlandsniptechnology.com wrote:
>> On Fri, 10 Jan 2020 21:46:19 -0800 (PST), omnilobe@gmail.com wrote:
>>
>>> Hardware designs are more rigorously done than
>>> software designs. A large company had problems with a 737
>>> and a rocket to the space station...
>>>
>>> https://www.bloomberg.com/news/articles/2019-06-28/boeing-s-737-max-software-outsourced-to-9-an-hour-engineers 
>>>
>>>
>>> I know programmers who do not care for rigor at home at work.
>>> I did hardware design with rigor and featuring reviews by caring
>>> electronics design engineers and marketing engineers.
>>>
>>> Software gets sloppy with OOPs.
>>> Object Oriented Programming.
>>> Windows 10 on a rocket to ISS space station.
>>> C++ mud.
>>
>> The easier it is to change things, the less careful people are about
>> doing them. Software, which includes FPGA code, seldom works the first
>> time. Almost never. The average hunk of fresh code has a mistake
>> roughly every 10 lines. Or was that three?
>>
>> FPGAs are usually better than procedural code, but are still mostly
>> done as hack-and-fix cycles, with software test benches. When we did
>> OTP (fuse based) FPGAs without test benching, we often got them right
>> first try. If compiles took longer, people would be more careful.
>>
>> PCBs usually work the first time, because they are checked and
>> reviewed, and that is because mistakes are slow and expensive to fix,
>> and very visible to everyone. Bridges and buildings are almost always
>> right the first time. They are even more expensive and slow and
>> visible.
>>
>> Besides, electronics and structures have established theory, but
>> software doesn't. Various people just sort of do it.
>>
>> My Spice sims are often wrong initially, precisely because there are
>> basically no consequences to running the first try without much
>> checking. That is of course dangerous; we don't want to base a
>> hardware design on a sim that runs and makes pretty graphs but is
>> fundamentally wrong.
>>
> 
> Don't know why C++ is getting the rap here. Modern C++ design is rigorous, there 
> are books about what to do and what not to do, and the language has built-in 
> facilities to ensure that e.g. memory is never leaked, pointers always refer to 
> an object that exists, and the user can't ever add feet to meters if they're not 
> supposed to.
> 
> If the developer chooses to ignore it all like they always know better than the 
> people who wrote the books on it, well, God bless...

Read the C++ FQA http://yosefk.com/c++fqa/

I'm particularly fond of the const correctness section :)

[toc] | [prev] | [next] | [standalone]


#572900

FromRBlack <news@rblack01.plus.com>
Date2020-01-13 09:27 +0000
Message-ID<MPG.38864855372ea240989682@reader80.eternal-september.org>
In reply to#572637
In article <d0nj1f50mabot5tnfooihn6o50up57n22b@4ax.com>, 
jlarkin@highlandsniptechnology.com says...
> 
[snip]
> 
> My Spice sims are often wrong initially, precisely because there are
> basically no consequences to running the first try without much
> checking. That is of course dangerous; we don't want to base a
> hardware design on a sim that runs and makes pretty graphs but is
> fundamentally wrong.

I just got bitten by a 'feature' of LTSpice XVII, I don't remeber IV 
having this behaviour but I don't have it installed any more:

If you make a tweak to a previously working circuit, which makes the 
netlister fail (in my case it was an inductor shorted to ground at both 
ends), it will pop up a warning to this effect, and then *run the sim 
using the old netlist*.  

It will then allow you to probe around on the new schematic, but the 
schematic nodes are mapped onto the old netlist, so depending on what 
you tweaked, what is displayed can range from slightly wrong to flat-out 
impossible.

Anyone else seen this?

[toc] | [prev] | [next] | [standalone]


#572981

Fromjlarkin@highlandsniptechnology.com
Date2020-01-13 18:56 -0800
Message-ID<o7bq1f54cmsvthkp8om1tqa3jrbau9ko5r@4ax.com>
In reply to#572900
On Mon, 13 Jan 2020 09:27:19 -0000, RBlack <news@rblack01.plus.com>
wrote:

>In article <d0nj1f50mabot5tnfooihn6o50up57n22b@4ax.com>, 
>jlarkin@highlandsniptechnology.com says...
>> 
>[snip]
>> 
>> My Spice sims are often wrong initially, precisely because there are
>> basically no consequences to running the first try without much
>> checking. That is of course dangerous; we don't want to base a
>> hardware design on a sim that runs and makes pretty graphs but is
>> fundamentally wrong.
>
>I just got bitten by a 'feature' of LTSpice XVII, I don't remeber IV 
>having this behaviour but I don't have it installed any more:
>
>If you make a tweak to a previously working circuit, which makes the 
>netlister fail (in my case it was an inductor shorted to ground at both 
>ends), it will pop up a warning to this effect, and then *run the sim 
>using the old netlist*.  

Well, don't ignore the warning.

>
>It will then allow you to probe around on the new schematic, but the 
>schematic nodes are mapped onto the old netlist, so depending on what 
>you tweaked, what is displayed can range from slightly wrong to flat-out 
>impossible.
>
>Anyone else seen this?

LT4 would complain about, say, one end of a cap floating, or your
shorted inductor. The new one doesn't. I prefer it the new way.

I haven't seen the old/new netlist thing that you describe.




-- 

John Larkin         Highland Technology, Inc

The cork popped merrily, and Lord Peter rose to his feet. 
"Bunter", he said, "I give you a toast. The triumph of Instinct over Reason"


[toc] | [prev] | [next] | [standalone]


#573001

FromRBlack <news@rblack01.plus.com>
Date2020-01-14 09:15 +0000
Message-ID<MPG.3887971264a94d3d989683@reader80.eternal-september.org>
In reply to#572981
In article <o7bq1f54cmsvthkp8om1tqa3jrbau9ko5r@4ax.com>, 
jlarkin@highlandsniptechnology.com says...
> 
> On Mon, 13 Jan 2020 09:27:19 -0000, RBlack <news@rblack01.plus.com>
> wrote:
> 
> >In article <d0nj1f50mabot5tnfooihn6o50up57n22b@4ax.com>, 
> >jlarkin@highlandsniptechnology.com says...
> >> 
> >[snip]
> >> 
> >> My Spice sims are often wrong initially, precisely because there are
> >> basically no consequences to running the first try without much
> >> checking. That is of course dangerous; we don't want to base a
> >> hardware design on a sim that runs and makes pretty graphs but is
> >> fundamentally wrong.
> >
> >I just got bitten by a 'feature' of LTSpice XVII, I don't remeber IV 
> >having this behaviour but I don't have it installed any more:
> >
> >If you make a tweak to a previously working circuit, which makes the 
> >netlister fail (in my case it was an inductor shorted to ground at both 
> >ends), it will pop up a warning to this effect, and then *run the sim 
> >using the old netlist*.  
> 
> Well, don't ignore the warning.

Yep.  Although it looks like 'warning' should be 'fatal error'.  I'm 
pretty sure LT4 would refuse to run the sim at all with no valid 
netlist, rather than use the last-known-good one.

> 
> >
> >It will then allow you to probe around on the new schematic, but the 
> >schematic nodes are mapped onto the old netlist, so depending on what 
> >you tweaked, what is displayed can range from slightly wrong to flat-out 
> >impossible.
> >
> >Anyone else seen this?
> 
> LT4 would complain about, say, one end of a cap floating, or your
> shorted inductor. The new one doesn't. I prefer it the new way.
> 
> I haven't seen the old/new netlist thing that you describe.

Another recent one was a boost switcher.  I had that working OK, then 
added a linear post-regulator, using a model from TI.  This added a 
bunch of extra nodes to the netlist.  The TI model turned out to have a 
typo (the warning said something along the lines of 'diode D_XYZ 
undefined.  Using ideal diode model instead.'  

The sim appeared to run OK anyway, but the FET dissipation trace was now 
multiplying the wrong node voltages/currents (node names from the old 
netlist) and it was out by an order of magnitude.  Once I found the typo 
and fixed it everything ran fine.
I suppose labelling all the nodes would also have caught that one.

I found LT4 more comfortable to use.  Still, I can't complain about the 
price.  We have a bunch of PSPICE licenses (came bundled with OrCAD) but 
LTSPICE is good enough that I've never even tried running it.

[toc] | [prev] | [next] | [standalone]


#573027

Fromjlarkin@highlandsniptechnology.com
Date2020-01-14 08:28 -0800
Message-ID<reqr1fl5uvvup49k30gd1emk2pa7ffq0tc@4ax.com>
In reply to#573001
On Tue, 14 Jan 2020 09:15:36 -0000, RBlack <news@rblack01.plus.com>
wrote:

>In article <o7bq1f54cmsvthkp8om1tqa3jrbau9ko5r@4ax.com>, 
>jlarkin@highlandsniptechnology.com says...
>> 
>> On Mon, 13 Jan 2020 09:27:19 -0000, RBlack <news@rblack01.plus.com>
>> wrote:
>> 
>> >In article <d0nj1f50mabot5tnfooihn6o50up57n22b@4ax.com>, 
>> >jlarkin@highlandsniptechnology.com says...
>> >> 
>> >[snip]
>> >> 
>> >> My Spice sims are often wrong initially, precisely because there are
>> >> basically no consequences to running the first try without much
>> >> checking. That is of course dangerous; we don't want to base a
>> >> hardware design on a sim that runs and makes pretty graphs but is
>> >> fundamentally wrong.
>> >
>> >I just got bitten by a 'feature' of LTSpice XVII, I don't remeber IV 
>> >having this behaviour but I don't have it installed any more:
>> >
>> >If you make a tweak to a previously working circuit, which makes the 
>> >netlister fail (in my case it was an inductor shorted to ground at both 
>> >ends), it will pop up a warning to this effect, and then *run the sim 
>> >using the old netlist*.  
>> 
>> Well, don't ignore the warning.
>
>Yep.  Although it looks like 'warning' should be 'fatal error'.  I'm 
>pretty sure LT4 would refuse to run the sim at all with no valid 
>netlist, rather than use the last-known-good one.
>
>> 
>> >
>> >It will then allow you to probe around on the new schematic, but the 
>> >schematic nodes are mapped onto the old netlist, so depending on what 
>> >you tweaked, what is displayed can range from slightly wrong to flat-out 
>> >impossible.
>> >
>> >Anyone else seen this?
>> 
>> LT4 would complain about, say, one end of a cap floating, or your
>> shorted inductor. The new one doesn't. I prefer it the new way.
>> 
>> I haven't seen the old/new netlist thing that you describe.
>
>Another recent one was a boost switcher.  I had that working OK, then 
>added a linear post-regulator, using a model from TI.  This added a 
>bunch of extra nodes to the netlist.  The TI model turned out to have a 
>typo (the warning said something along the lines of 'diode D_XYZ 
>undefined.  Using ideal diode model instead.'  
>
>The sim appeared to run OK anyway, but the FET dissipation trace was now 
>multiplying the wrong node voltages/currents (node names from the old 
>netlist) and it was out by an order of magnitude.  Once I found the typo 
>and fixed it everything ran fine.
>I suppose labelling all the nodes would also have caught that one.
>
>I found LT4 more comfortable to use.  Still, I can't complain about the 
>price.  We have a bunch of PSPICE licenses (came bundled with OrCAD) but 
>LTSPICE is good enough that I've never even tried running it.

When I get a warning, I fix it before I run the sim. That would
explain why I haven't seen the old-netlist-runs thing.

I do label a lot of nodes, but just the interesting ones, not all.

I need to force myself to check all the named nodes when I copy/paste
bits of a circuit. It duplicates all named nodes, which creates some
interesting shorts.



-- 

John Larkin         Highland Technology, Inc

The cork popped merrily, and Lord Peter rose to his feet. 
"Bunter", he said, "I give you a toast. The triumph of Instinct over Reason"


[toc] | [prev] | [next] | [standalone]


#573031

FromSteve Wilson <no@spam.com>
Date2020-01-14 16:43 +0000
Message-ID<XnsAB44775905ACAidtokenpost@144.76.35.198>
In reply to#573027
jlarkin@highlandsniptechnology.com wrote:

> I do label a lot of nodes, but just the interesting ones, not all.
 
> I need to force myself to check all the named nodes when I copy/paste
> bits of a circuit. It duplicates all named nodes, which creates some
> interesting shorts.
 
When you name the nodes, use names made from adjacent components, such as 
R1C1, Q1B, U1N, etc. 

When you copy and paste, the component reference designations will change. 
You can easily find the erroneous node names since they won't match the 
adjacent components.

[toc] | [prev] | [next] | [standalone]


#573054

FromJohn Larkin <jlarkin@highland_atwork_technology.com>
Date2020-01-14 11:52 -0800
Message-ID<oq6s1fpv1cod27rv8fnion08ikdhheag3r@4ax.com>
In reply to#573031
On Tue, 14 Jan 2020 16:43:56 -0000 (UTC), Steve Wilson <no@spam.com>
wrote:

>jlarkin@highlandsniptechnology.com wrote:
>
>> I do label a lot of nodes, but just the interesting ones, not all.
> 
>> I need to force myself to check all the named nodes when I copy/paste
>> bits of a circuit. It duplicates all named nodes, which creates some
>> interesting shorts.
> 
>When you name the nodes, use names made from adjacent components, such as 
>R1C1, Q1B, U1N, etc. 
>
>When you copy and paste, the component reference designations will change. 
>You can easily find the erroneous node names since they won't match the 
>adjacent components.

I'd rather use something that describes the signal, not the parts.
Like ADC_IN or something. So the plots make sense and can be used as
illustrations in manuals, for example. 

-- 

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement 

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#573071

FromSteve Wilson <no@spam.com>
Date2020-01-14 22:21 +0000
Message-ID<XnsAB44B093E6927idtokenpost@144.76.35.198>
In reply to#573054
John Larkin <jlarkin@highland_atwork_technology.com> wrote:

> On Tue, 14 Jan 2020 16:43:56 -0000 (UTC), Steve Wilson <no@spam.com>
> wrote:
> 
>>jlarkin@highlandsniptechnology.com wrote:
>>
>>> I do label a lot of nodes, but just the interesting ones, not all.
>> 
>>> I need to force myself to check all the named nodes when I copy/paste
>>> bits of a circuit. It duplicates all named nodes, which creates some
>>> interesting shorts. 
>> 
>>When you name the nodes, use names made from adjacent components, such
>>as R1C1, Q1B, U1N, etc. 
>>
>>When you copy and paste, the component reference designations will
>>change. You can easily find the erroneous node names since they won't
>>match the adjacent components. 
 
> I'd rather use something that describes the signal, not the parts.
> Like ADC_IN or something. So the plots make sense and can be used as
> illustrations in manuals, for example. 

of course. Vin, Vout, Clk, Diff, VCC, etc. These are all good for
external connecting signals. 

But if you want signals internal to a circuit block, you need some way to 
identify them. If you leave them unnamed, they will get renumbered every 
time you make a change to the circuit. So you cannot use unnamed nodes to 
plot waveforms.

I find it saves time to go ahead and name every node. It doesn't take long, 
and you don't have to waste time naming a node that you find out you need, 
then re-run the sim again.

[toc] | [prev] | [next] | [standalone]


#573089

FromJohn Larkin <jlarkin@highland_atwork_technology.com>
Date2020-01-14 16:00 -0800
Message-ID<s7ls1ft238476nfdlo4eq2deav97og8818@4ax.com>
In reply to#573071
On Tue, 14 Jan 2020 22:21:30 -0000 (UTC), Steve Wilson <no@spam.com>
wrote:

>John Larkin <jlarkin@highland_atwork_technology.com> wrote:
>
>> On Tue, 14 Jan 2020 16:43:56 -0000 (UTC), Steve Wilson <no@spam.com>
>> wrote:
>> 
>>>jlarkin@highlandsniptechnology.com wrote:
>>>
>>>> I do label a lot of nodes, but just the interesting ones, not all.
>>> 
>>>> I need to force myself to check all the named nodes when I copy/paste
>>>> bits of a circuit. It duplicates all named nodes, which creates some
>>>> interesting shorts. 
>>> 
>>>When you name the nodes, use names made from adjacent components, such
>>>as R1C1, Q1B, U1N, etc. 
>>>
>>>When you copy and paste, the component reference designations will
>>>change. You can easily find the erroneous node names since they won't
>>>match the adjacent components. 
> 
>> I'd rather use something that describes the signal, not the parts.
>> Like ADC_IN or something. So the plots make sense and can be used as
>> illustrations in manuals, for example. 
>
>of course. Vin, Vout, Clk, Diff, VCC, etc. These are all good for
>external connecting signals. 

Or for any node that you want to get nicely labeled on a plot.

>
>But if you want signals internal to a circuit block, you need some way to 
>identify them. If you leave them unnamed, they will get renumbered every 
>time you make a change to the circuit. So you cannot use unnamed nodes to 
>plot waveforms.

Sure you can. Just hit it with the probe. It will plot as V(n008) or
something like that. I know what it means because I just probed it.




-- 

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement 

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#573032

FromSteve Wilson <no@spam.com>
Date2020-01-14 16:49 +0000
Message-ID<XnsAB447857C60D9idtokenpost@144.76.35.198>
In reply to#573027
jlarkin@highlandsniptechnology.com wrote:

> I do label a lot of nodes, but just the interesting ones, not all.
 
> I need to force myself to check all the named nodes when I copy/paste
> bits of a circuit. It duplicates all named nodes, which creates some
> interesting shorts.

When you name a node, use names made from adjacent components, such as R1C1, 
Q1B, U1N, etc.

When you copy and post, the component reference designations will change, but 
the named nodes will remain the same. You can easily find them since they 
won't match the new reference designations.

[toc] | [prev] | [next] | [standalone]


#573150

FromBill Sloman <bill.sloman@ieee.org>
Date2020-01-15 05:58 -0800
Message-ID<fddd99e5-33a9-4e3c-8000-98744a76aa9e@googlegroups.com>
In reply to#572637
On Sunday, January 12, 2020 at 1:47:19 AM UTC+11, jla...@highlandsniptechnology.com wrote:
> On Fri, 10 Jan 2020 21:46:19 -0800 (PST), omnilobe@gmail.com wrote:
> 
> >Hardware designs are more rigorously done than
> >software designs. A large company had problems with a 737
> >and a rocket to the space station...
> >
> >https://www.bloomberg.com/news/articles/2019-06-28/boeing-s-737-max-software-outsourced-to-9-an-hour-engineers
> >
> >I know programmers who do not care for rigor at home at work.
> >I did hardware design with rigor and featuring reviews by caring 
> >electronics design engineers and marketing engineers.
> >
> >Software gets sloppy with OOPs.
> >Object Oriented Programming.
> >Windows 10 on a rocket to ISS space station.
> >C++ mud.
> 
> The easier it is to change things, the less careful people are about
> doing them. Software, which includes FPGA code, seldom works the first
> time. Almost never. The average hunk of fresh code has a mistake
> roughly every 10 lines. Or was that three?

Thirty lines was the figure I saw.

Good software practice is to keep your procedures shorter than a page and get somebody else to run through it before you file it.
 
> FPGAs are usually better than procedural code, but are still mostly
> done as hack-and-fix cycles, with software test benches. When we did
> OTP (fuse based) FPGAs without test benching, we often got them right
> first try. If compiles took longer, people would be more careful.

Engineers make mistakes. The art is in finding them early.

> PCBs usually work the first time, because they are checked and
> reviewed, and that is because mistakes are slow and expensive to fix,
> and very visible to everyone. Bridges and buildings are almost always
> right the first time. They are even more expensive and slow and
> visible.

And get reviewed and checked even more carefully.
 
> Besides, electronics and structures have established theory, but
> software doesn't. Various people just sort of do it.

Software is just mathematical procedures. There is a branch of software theory devoted to letting you write provably correct code, but it doesn't to work well enough in practice to be worth the trouble.

https://dl.acm.org/doi/10.1007/978-3-642-34026-0_2
 
> My Spice sims are often wrong initially, precisely because there are
> basically no consequences to running the first try without much
> checking. That is of course dangerous; we don't want to base a
> hardware design on a sim that runs and makes pretty graphs but is
> fundamentally wrong.

Obviously not. My example of that is the Spice simulation of a Baxandall Class-D oscillator with bipolar transistors and a big choke.

The circuit "squegs" in real life, but not in simulation, or at least not with a Gummell-Poon transistor model, which is known to do a bad job of simulating a inverted transistor. The VBIC model might do better, but transistor manufacturers treat them as "commercial in confidence" and I've never got my hand on one to try it.

http://www.sophia-electronica.com/Baxandall_parallel-resonant_Class-D_oscillator1.htm

-- 
Bill Sloman, Sydney

[toc] | [prev] | [standalone]


Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]

Back to top | Article view | sci.electronics.design


csiph-web