From: Tim E. <ti...@op...> - 2016-08-25 19:51:49
|
Hello ng-spice developers, I'm surprised at the lack of readable documentation on how to use xspice. I spent some time about a year ago or maybe more trying to figure out how to use it, using the existing ngspice and xspice documents. I wasn't successful until I got a few tips from someone using Electric, and suddenly I find I can do mixed-mode simulation . . . I had no idea it could be that easy. Previously I must have been doing something wrong with the A/D and D/A bridges, but anyway, I can get it all to work now. I was thinking about an addition to my digital flow qflow to convert digital synthesis output into an xspice subcircuit for spice mixed-mode simulation. However, for that, I have to map any arbitrary standard cell set into xspice digital primitives. The problem is that the xspice digital primitives aren't a complete set. I thought about adding a few cells like and-or-invert, etc., but then I realized what it really needs is a cell "d_lut" for an N-input, lookup table, that can implement any arbitrary function of N inputs. So I wrote one. It's so obvious and useful I'm not sure why it hasn't been done before. The attached tarball goes in (should be untarred in) xspice/icm/digital/, and creates a new subdirectory called "d_lut". The name "d_lut" needs to be added to file modpath.lst in xspice/icm/digital/. The d_lut cell follows the general form of the other digital cells, but it has an extra parameter called "table_values", which is a string length 2^N for an N input instance of the cell. Values can be "1", "0", or "X". So a 2-input AND gate could be implemented using a d_lut with 2 inputs and a string "0001" for table_values. The d_lut cell can implement any combinational logic cell in a standard cell set. That will allow me to write the script for qflow to map an entire standard cell set into xspice primitives. Can someone please help me get this code added to the ngspice code base? Thanks, Tim +--------------------------------+-------------------------------------+ | R. Timothy Edwards (Tim) | email: ti...@op... | | Open Circuit Design | web: http://opencircuitdesign.com | | 19412 Cissel Manor Drive | phone: (301) 528-5030 | | Poolesville, MD 20837 | cell: (408) 828-8212 | +--------------------------------+-------------------------------------+ |