Re: [ng-spice-devel] Constructing vectors


To ng-spice-devel@ieee.ing.uniroma1.it
From p.nenzi@ieee.org
Date Thu, 1 Nov 2001 07:50:57 +0100 (CET)
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
In-Reply-To <a0433010bb80620e89f29@[144.173.2.204] >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it

On Wed, 31 Oct 2001, Charles Williams wrote:

> I occasionally work on a 3f5-based version of MacSpice

> http://newton.ex.ac.uk/teaching/CDHW/Electronics2/MacSpiceRelease.txt

I tried to connect but got a "connection refused".

> and will offer some of my patches to ngspice in due course. As part 
> of my efforts I have have been thinking about getting the frontend 
> processor to handle vectors correctly. My current thoughts are:
> 
> 'let foo = [ 1 2 3 ]' doesn't work as the Berkeley docs imply it 
> should. Mainly because there is no code for this in 3f5! It is not 
> clear to me how the parser could be modified to make it work without 
> breaking other things as the syntax is badly constructed and there 
> are hacks that make assumptions about what '[stuff]' means all over 
> the place... (beware the comma operator!)

Thank you for your offer, as soon as the sourceforge site will be ready
the patches will be integrated. On the spice3f5 parser, while I am not in
a position to judge, it seems very badly written code; probably is the
worst part of the entire system, anyway spice3f  was more a "technology
demonstrator", than a production-quality simulator. 



> For the time being I have fixed various bugs in com_let() which 
> prevented expressions like 'let foo[2] = 99' working and incorporated 
> index range checking.  I have also implemented a semicolon operator 
> to facilitate construction of vectors and n-dimensional matrices. 
> e.g. the command
> 
> 'let foo = ((11;12);(21;22))' creates a 2x2 matrix, then
> 'let bar = (foo;(31;32))'     creates a 3x2 matrix
> 'let baz = (1;(3,4);5)'       creates a complex vector with 3 elements
> 
> It is necessary to protect the ; with ()'s to prevent it being 
> treated as a command separator.

Interesting, have you written some docs on your add ons ? 

> This seems broadly compatible with the Spice Opus approach and I 
> prefer it to even a finished version of the 'compose' command.

Could you explain better, please ?

> Obviously any command interpreter where 'let foo=a*b' is equivalent 
> to 'foo = a*b' but 'foo=a*b' generates an error is less than ideal, 
> however I regard backward- and cross-compatibility as an essential 
> feature of any Spice like programme.
> 
> Has a policy on how NGspice handles this sort of thing already been agreed?

AFAIK not officially. 

Ciao,
Paolo


Partial thread listing: