77 Commits (d002ba353b47d2619c86cc3529cdeba8e52e8f2d)

Author SHA1 Message Date
Brian Taylor d002ba353b Fix scan_gates to consider correctly gates with an inverted output. Refactor the checks in infix_to_postfix for invalid postfix expressions. 2 years ago
Brian Taylor 0ec0c92eae Go back to before previous merge. 2 years ago
Brian Taylor 57048228e9 Add variable ps_scan_gates_optimize (default 1). If < 1, then turn off the optimizations in scan_gates. 2 years ago
Brian Taylor bd0f725776 There are approx. 47 out of 1455 subckts in PSPICE 9.1 libraries which contain X* subckt calls together with zero or more U* instances. Now this type of subckt can be translated to XSPICE. 2 years ago
Brian Taylor a70297e87a Several PSPICE 9.1 evaluation digital libraries contain timing .model statements at the global level for subckts with U* instances that reference those models. By specifying "set ps_global_tmodels=1" in .spiceinit an extra pass inside u_instances() will collect those global timing models for use in subckts. Report errors detected when ngspice parses a LOGICEXP but has not added support for operator precendence. Include a hint of how to fix those errors by inserting parentheses. This error only occurs in 10 of 585 cases in the libraries. Note that inpcompat.c has been saved as a unix filetype. 2 years ago
Brian Taylor 8f52a67786 Fix set but not used warning. 2 years ago
Brian Taylor 492bb64d92 By default, use the shortest typical delay estimate. This makes the digi_74LS90_74LS42.cir testcase for bug641 behave almost the same as MicroCap 12. In ngspice and MicroCap, the only signal with a glitch is not_y8. The other not_* signals look the same. Setting ps_use_mntymx in .spiceinit will change the delay estimates. See the function set_u_devices_info in src/frontend/udevices.c for the various settings of ps_use_mntymx. 3 years ago
Brian Taylor f16c0556af Add support for PSpice DLYLINE. 3 years ago
Brian Taylor e235fda42b For d0_eff, d0_gff timing models specify the 1.0e-12 minimum Xspice delay valuesrather than defaulting to 1ns. 3 years ago
Brian Taylor b79eca646b 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. 3 years ago
Brian Taylor 6b85bcb805 Allocate compound gate connectors where needed. 3 years ago
Brian Taylor de34a90bb4 Create correct translations of degenerate compound gates with $d_hi/$d_lo inputs. 3 years ago
Brian Taylor 14a403e193 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. 3 years ago
Brian Taylor 40a540a2ff 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. 3 years ago
Brian Taylor 164db58404 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. 3 years ago
Brian Taylor a6b2773c90 For a ugate timing model, when tphlXX/tplhXX is not found, set the fall/rise delay to zero (1.0e-12). 3 years ago
Brian Taylor 0e5a5a62ac 74F550 and 74F551 have only fall delays on the inverters. Use the fall delay for both rise and fall. 3 years ago
Brian Taylor 3a76a1ef52 Prepare for inertial_delay model parameter. 3 years ago
Brian Taylor 4b30113f60 Check current_subckt is set when printing TRANS_OUT. 3 years ago
Brian Taylor 56d0c72924 Add port directions when logicexp or pindly are present. 3 years ago
Brian Taylor 9c9301eca8 Remove delay ifdefs. 3 years ago
Brian Taylor f674b64264 Remove dead code from previous commit. 3 years ago
Brian Taylor f570b04d6c 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. 3 years ago
Brian Taylor dcfe4e7134 ERROR messages should be printed to stderr. 3 years ago
Brian Taylor a76f8d5149 Fix some comments. 3 years ago
Brian Taylor 6117836d01 Ensure that amatch output is not binary data. 3 years ago
Brian Taylor 90ec717f3b Add variable ps_udevice_exit. If set non-zero, ngspice will exit if there is an error processing f_logicexp or f_pindly. 3 years ago
Brian Taylor 5e6452099e Return errors from f_logicexp and f_pindly without calling exit. 3 years ago
Brian Taylor 0805856fb7 Distinguish between set/reset delays when possible. 3 years ago
Brian Taylor 253df17949 Make it optional to use zl/zh/lz/hz delays for utgate. 3 years ago
Brian Taylor 4c457a3cd4 Avoid unnecessary calculations for utgate. 3 years ago
Brian Taylor a4b609fb6a For utgate timing models, if hl/lh are not present use zl/zh/lz/hz to give a more accurate tristate delay. 3 years ago
Brian Taylor 021982799e More conservative delay estimates for timing model type ugff. 3 years ago
Brian Taylor 11f6eace68 For dff/jkff, obtain more conservative estimates for clk_delay, set_delay and reset_delay. 3 years ago
Brian Taylor 47260e2eb8 Rewrite extract_model_param. 3 years ago
Brian Taylor 0924fbb7eb Modify the delay calculation for non-conforming timing model in .subckt CD4572UB. 3 years ago
Giles Atkinson 73e8fed0fc Fix warnings from gcc 10.2.1. 3 years ago
Brian Taylor 7ff8f3773f 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. 3 years ago
Brian Taylor b142be7fde 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. 3 years ago
Brian Taylor 4e76586b6b Reduce the delays of 'zero' delay gates to 1.0e-11. Add decoder test for logicexpr and pindly. 3 years ago
Brian Taylor 62aab3885d Move f_logicexp, f_pindly calls to u_process_instance. Use u_add_instance to copy gate instances and models to the replacement cards. 3 years ago
Brian Taylor a54aa4d1f7 Initial logicexp parser and gate generator. 3 years ago
Brian Taylor 4a904cdf18 Add drive 0/1 for $d_lo/$d_hi. 3 years ago
Brian Taylor 150839dd1a Remove VisualC compile warnings. 4 years ago
Holger Vogt 2547115eeb Prevent Visual Studio compiler warnings 4 years ago
Brian Taylor bd00738a49 Fix memory leaks in ff/latch code. 4 years ago
Brian Taylor e2652d813d If ps_udevice_msgs >= 2, print complete line of unsupported PSpice instance. For debugging purposes. 4 years ago
Brian Taylor e703bd9142 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. 4 years ago
Brian Taylor e9855be595 If variable ps_port_directions >= 2, also show the translated Xspice statements. 4 years ago
Brian Taylor 3ca91aa1ac 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. 4 years ago