Commit Graph

70 Commits

Author SHA1 Message Date
Brian Taylor b67d895a7b Add support for PSpice DLYLINE. 2023-08-05 10:34:16 -07:00
Brian Taylor 04b5abfa14 For d0_eff, d0_gff timing models specify the 1.0e-12 minimum Xspice delay valuesrather than defaulting to 1ns. 2023-08-01 14:37:20 -07:00
Brian Taylor 49f5f5134a Prevent crashes in udevices.c when malformed U* instances are present. This would happen with incorrectly written U* gates, ff, latches which do not conform to the PSpice specs. Instead, ERROR messages are output which, hopefully, will help a user to debug their subckt. 2023-07-21 16:33:03 -07:00
Brian Taylor bf2f38c8d3 Allocate compound gate connectors where needed. 2023-04-09 09:57:55 -07:00
Brian Taylor 0bf1a37432 Create correct translations of degenerate compound gates with $d_hi/$d_lo inputs. 2023-04-08 16:36:23 -07:00
Brian Taylor 4dd2ad8d21 Use ~ on the input of a tristate buffer for INV3, and avoid creating an extra inverter. For ff/latch use ~ on set/reset and jkff clock inputs to avoid creating extra inverters. 2023-04-01 10:28:04 -07:00
Brian Taylor 7e4f9146dc Add inertial_delay=true to .model statements generated when U* instances in PSpice library subckts are translated to Xspice. Any other Xspice A* digital instances might have different inertial_delay settings in their models, so potentially there could be a mixture of delay types. For example, if a user wishes to model a DLYLINE using a d_buffer with inertial_delay=false and equal rise/fall delays. 2023-03-17 07:18:12 -07:00
Brian Taylor 2dec3d2dc0 The intent now is to rely on a variable setting in .spiceinit to control the use of inertial delay XSPICE digital models. This will apply to U* instances in subcircuits which are translated to XSPICE. 2023-03-10 11:40:37 -08:00
Brian Taylor d3c5a31571 For a ugate timing model, when tphlXX/tplhXX is not found, set the fall/rise delay to zero (1.0e-12). 2023-03-04 11:08:09 -08:00
Brian Taylor 8453e1d1a9 74F550 and 74F551 have only fall delays on the inverters. Use the fall delay for both rise and fall. 2023-03-03 12:48:02 -08:00
Brian Taylor 70b3eca708 Prepare for inertial_delay model parameter. 2023-03-02 17:40:15 -08:00
Brian Taylor 2a32f2ebd2 Check current_subckt is set when printing TRANS_OUT. 2023-03-02 12:19:53 -08:00
Brian Taylor dcafbbcf90 Add port directions when logicexp or pindly are present. 2023-01-30 14:41:49 -08:00
Brian Taylor da6a311260 Remove delay ifdefs. 2023-01-28 13:11:28 -08:00
Brian Taylor df8b349085 Remove dead code from previous commit. 2023-01-27 07:35:56 -08:00
Brian Taylor 2db2b3416f For unspecified gate delays (logic and tristate gates), which PSpice would consider as zero, set the rise and fall delays to 1.e-12s (the minimum for Xspice). For dff, jkff, dlatch, and srlatch use the Xspice default 1.0ns for rise and fall delays. If the ngspice variable (ps_port_directions & 2) is true, write the translated subckt to stdout, with TRANS_OUT prefix, for debugging purposes. The user could edit and replace the translated subckt if desired. 2023-01-26 15:49:18 -08:00
Brian Taylor c72781584a ERROR messages should be printed to stderr. 2023-01-09 12:23:38 -08:00
Brian Taylor 7af21d1f5f Fix some comments. 2023-01-03 09:38:57 -08:00
Brian Taylor f137cc0c5c Ensure that amatch output is not binary data. 2022-12-27 20:48:53 -08:00
Brian Taylor afcab5f907 Add variable ps_udevice_exit. If set non-zero, ngspice will exit if there is an error processing f_logicexp or f_pindly. 2022-12-27 14:42:23 -08:00
Brian Taylor d35491fa8f Return errors from f_logicexp and f_pindly without calling exit. 2022-12-26 21:47:38 -08:00
Brian Taylor bda5d3f845 Distinguish between set/reset delays when possible. 2022-12-09 09:46:00 -08:00
Brian Taylor afb5dcbffb Make it optional to use zl/zh/lz/hz delays for utgate. 2022-12-08 17:15:34 -08:00
Brian Taylor 4054d4a580 Avoid unnecessary calculations for utgate. 2022-12-08 11:31:34 -08:00
Brian Taylor 74df1a1913 For utgate timing models, if hl/lh are not present use zl/zh/lz/hz to give a more accurate tristate delay. 2022-12-08 10:46:19 -08:00
Brian Taylor d5cf918ce0 More conservative delay estimates for timing model type ugff. 2022-12-07 19:52:11 -08:00
Brian Taylor e7a85f95f0 For dff/jkff, obtain more conservative estimates for clk_delay, set_delay and reset_delay. 2022-12-07 11:12:22 -08:00
Brian Taylor 5238d6f18a Rewrite extract_model_param. 2022-12-04 10:39:47 +01:00
Brian Taylor a317639d23 Modify the delay calculation for non-conforming timing model in .subckt CD4572UB. 2022-12-04 10:39:40 +01:00
Giles Atkinson b124749122 Fix warnings from gcc 10.2.1. 2022-11-28 22:34:23 +01:00
Brian Taylor 44c69f5bf5 Handle cases where logicexp has a timing model but no pindly. This is rare, only 22 tests from the digital libraries. Move digital examples, add missing .spiceint file. 2022-11-28 22:33:00 +01:00
Brian Taylor 1200092250 Add behavioral (LOGICEXP, PINDLY) test for 283 circuit. There are glitches in the simulation for some of the s* outputs. Probably due to not having inertial delays. And why not set 'zero' delays as close to zero as permitted by XSPICE. 2022-11-07 14:47:18 +01:00
Brian Taylor ab7634e72e Reduce the delays of 'zero' delay gates to 1.0e-11. Add decoder test for logicexpr and pindly. 2022-11-07 14:47:13 +01:00
Brian Taylor 9d239dc2f7 Move f_logicexp, f_pindly calls to u_process_instance. Use u_add_instance to copy gate instances and models to the replacement cards. 2022-11-07 14:45:57 +01:00
Brian Taylor 67369f1c67 Initial logicexp parser and gate generator. 2022-11-07 14:45:45 +01:00
Brian Taylor db81d7ca28 Add drive 0/1 for $d_lo/$d_hi. 2022-11-07 14:45:33 +01:00
Brian Taylor ff58fbbe56 Remove VisualC compile warnings. 2022-10-09 10:15:14 +02:00
Holger Vogt dcb3bf0f8b Prevent Visual Studio compiler warnings 2022-10-08 17:20:48 +02:00
Brian Taylor 41b7c867ff Fix memory leaks in ff/latch code. 2022-09-23 14:59:17 +02:00
Brian Taylor 93bd661a3e If ps_udevice_msgs >= 2, print complete line of unsupported PSpice instance. For debugging purposes. 2022-09-23 14:59:01 +02:00
Brian Taylor 78f732a8a1 Add comment about ps_udevice_msgs variable. Set to 1 will print PSpice instance names and types which are not supported and are found when processing a subckt. 2022-09-14 15:01:39 +02:00
Brian Taylor a361d63ca1 Make a trivial change to support (n)and3a, (n)or3a, (n)xor3a types. These are not used in any of the Micro Cap libraries. Completes support for Pspice tristate gate types. 2022-08-06 10:43:17 +02:00
Brian Taylor f0876163e8 If variable ps_port_directions >= 2, also show the translated Xspice statements. 2022-08-06 10:43:02 +02:00
Brian Taylor 47753ad5b2 Ignore IO models in a subckt. Setting variable ps_port_directions to a non-zero int prints the directions (IN, OUT, INOUT) of subckt ports. 2022-08-06 10:42:50 +02:00
Brian Taylor 15d987ad0f Check for name collisions between nodes generated during translation from Pspice to Xspice and instance pin or subckt port names. These are reported as ERRRORs. 2022-08-06 10:42:43 +02:00
Brian Taylor ec6938ed70 There needs to be 2 variants of d0_gff. One for d_dlatch, the other for d_srlatch. 2022-07-01 15:55:26 +02:00
Brian Taylor 6418fe75b7 Clean out dead code in model processing. 2022-07-01 15:55:15 +02:00
Brian Taylor 4c2152c74f Add support for srff. 2022-07-01 15:55:06 +02:00
Brian Taylor b64f684a62 Remove debug code. 2022-07-01 15:55:00 +02:00
Brian Taylor 4d9f834f5e Remove invalid check. 2022-07-01 15:54:45 +02:00