Commit Graph

460 Commits

Author SHA1 Message Date
stefan schippers 9917c8276b revert to KeyRelease events (instead of FocusOut) for various widgets in graphdialog (better feedback), fix premature deallocation of data in child process in filter_data() 2023-10-17 17:05:10 +02:00
stefan schippers 306c5d0d15 fix two small memory leaks, doc updates (xschem raw command) Raw.filename renamed to Raw.rawfile 2023-10-17 16:08:27 +02:00
stefan schippers b165720bc8 allow loading more and different analyses from the same raw file. Implied tcleval() in rawfile given in graphdialog, transform multiple saved OP sims into a dc sweep. 2023-10-17 14:00:43 +02:00
stefan schippers 8cfd51d8f9 add the ability to load multiple raw files with different analyses in a single schematic ( extra_rawfile() ) 2023-10-17 00:42:31 +02:00
stefan schippers 5da81a7aea shut down some gcc false warnings (uninitialized vars), add read_more_rawfile() 2023-10-16 11:16:12 +02:00
stefan schippers f10555917e optimized usage of interpolate_yval(), add raw->cursor_b_val[] 2023-10-16 09:53:03 +02:00
stefan schippers a7bcfb7941 do interpolation when annotating "b" cursor values in schematic, as done with measurements with "a" cursor. 2023-10-15 12:05:48 +02:00
stefan schippers f87ab46310 refactor table_read(), less pointer indirections 2023-10-15 10:24:13 +02:00
stefan schippers 663991ce70 add "filename" member in Raw (raw file) struct 2023-10-14 23:09:40 +02:00
stefan schippers 537cedbafe better graphdialog layout, remove tcl redundant raw_level var 2023-10-14 22:43:58 +02:00
stefan schippers 9b4bd44fd0 merged in fast_raw_read branch 2023-10-11 14:05:27 +02:00
stefan schippers b613d65fd9 read_dataset(): better set return codes on errors and cleanup allocated memory 2023-10-02 19:18:12 +02:00
stefan schippers 9fee9610ab vsource.sym and ammeter.sym: add "savecurrent=1|0|true|false" attribute do decide if a .save I(...) is to be printed in netlist. default is 1 for ammeter.sym and 0 for vsource.sym. Add "deltax deltay rot flip" optional parameters for xschem "copy_objects" command to make copy operation scriptable (lot more efficient than using clipboard) 2023-10-02 12:11:05 +02:00
stefan schippers 433ec84278 simpler state bits checking in callback() (use rstate to avoid redundant ShiftMask checks) . Enable loading SP Analysis raw files (they are equal as AC analyses) ) 2023-09-28 21:03:28 +02:00
stefan schippers 112a12a87b add tcl variable no_ask_save: if set to 1 xschem will not ask to save modified schematics 2023-09-23 11:47:11 +02:00
stefan schippers 0119f013e3 correct implementation of previous commit 2023-09-20 11:04:30 +02:00
stefan schippers 1fdf117a84 fix a bug regression in save_schematic when saving an existing schematic to a different filename. Xschem incorretly popped up the alert "Has been changed since opening. Save it anyway?" 2023-09-20 10:19:49 +02:00
stefan schippers 8dfaedf9ea report in-hierarchy overlapped symbols when netlisting 2023-08-29 11:32:48 +02:00
stefan schippers bf46fd3e7b allow "1" / "0" in addition to "true" / "false" in all boolean attributes 2023-07-14 00:49:51 +02:00
stefan schippers c6df85cce5 apply center full zoom in all zoom full commands if tcl variable zoom_full_center is set 2023-06-23 09:04:55 +02:00
stefan schippers f85d46a0cb save_schematic(): avoid copying schname to xctx->sch[xctx->currsch] if dest == src 2023-06-22 08:16:19 +02:00
stefan schippers 89d90c21db xctx->sch made an array of pointers instead of array of PATH_MAX strings (memory saver) 2023-06-17 23:58:35 +02:00
Stefan Schippers 61a659e004 text elements with attribute name=xxx or floater=xxx will go through a tcl substitution (instead of the translate(...) function if the referenced xxx instance does not exist. floater=instname can now be given instead of name=instname (they are equivalent) 2023-06-11 15:57:49 +02:00
stefan schippers ff216e8187 function reset_flags() set flags on symbols and instances; call reset_flags before rebuilding connectivity to update cached values; add short.sym component that can be used to short two nets together (and remove the short using *_ignore=true); instcheck(): do not proces instances that have *_ignore=true set. 2023-06-06 08:42:43 +02:00
stefan schippers 331934afc6 added abs_sym_path() in file name resoluton in `xschem load_new_window` command 2023-06-04 20:44:36 +02:00
Stefan Schippers cff9f7d169 some bug fixes in resolved_net hashing, use some @#n:resolved_net labels in examples 2023-05-27 21:48:21 +02:00
stefan schippers 09a373954f initial implementation of portmap feature: from sub-schematics resolve hierarchic name of schematic nets connected to I/O pins (go to the upper level recursively until resolved) 2023-05-26 11:56:52 +02:00
stefan schippers 5e90f5c319 use find_file_first instead of find_file in C code 2023-05-24 09:12:29 +02:00
stefan schippers 5c22d26072 update copyright info to 2023 2023-05-21 12:52:19 +02:00
stefan schippers 014ebf0477 is_from_web() function to avoid code repetitions, more heuristics when trying to descend into web hierarchies 2023-05-18 20:55:14 +02:00
stefan schippers e0bde2cb1c better handling of web_urls: if already cached do not download again 2023-05-18 11:03:32 +02:00
stefan schippers eef043ef2f sym_vs_sch_pins() do not try to get the "type" attribute of symbols references containing "@" characters (unresolved @parameters) by loading the symbol and checking the xctx->sym[symbol].type attribute, this usually happens in parametrized symbol generators 2023-05-16 14:45:52 +02:00
Stefan Schippers d577bdde7a resolved a memory leak (inst[..].instname) 2023-05-14 17:10:48 +02:00
stefan schippers 96eea54894 some code refactoring, duplicate code replaced with set_inst_flags(), set_sym_flags(), various fixes/optimizations about floaters 2023-05-14 12:58:25 +02:00
stefan schippers 9fcde30a52 do not perform tcl substitution before displaying netlist_commands text into an editor. Correctly restore xctx->current_dirname after netlisting. get_generator_command(): quote command name (just in case its pathname contains spaces). floater example labels in solar_panel.sch. Various corrections and optimizations in new floater labels code. 2023-05-14 01:13:18 +02:00
stefan schippers ee1979b8b2 low level functions for floaters and floater text caches is implemented 2023-05-13 13:13:35 +02:00
stefan schippers 9ea93e9938 hide_texts=true attribute added on instance will avoid the display of all symbol texts (will be probably used when using floater symbol texts) 2023-05-12 12:09:20 +02:00
stefan schippers 4919d8734b remove dbg message 2023-05-12 01:30:38 +02:00
stefan schippers 35354e8fe3 fix: check for NULL type attribute in get_sch_from_sym(). Fix web schematic navigation (descend and return) in load_schematic() 2023-05-12 01:29:38 +02:00
stefan schippers 5e281e7f10 *_ignore attributes for instances and symbols cached in .flags struct member for speed optimization. added some generator netlist testcases in xschemtest.tcl 2023-05-10 23:29:16 +02:00
stefan schippers 0a4f942fb7 symbol_ignore=true attribute can be set on all symbol elements (text, lines, rectangles, arcs, polys, instances, nets) such that these marked elements are not displayed when symbol is instantiated. 2023-05-09 23:26:46 +02:00
stefan schippers b4b2c91481 fix yet another error in "cmd" string handling in load_sym_def(). Added realloc of freed pointers detection in track_memory.awk 2023-05-05 09:29:30 +02:00
stefan schippers d23388ff71 fix cmd memory leak in load_ym_def(), make copy of returned string in some routines to reduce dependencies 2023-05-04 23:23:54 +02:00
stefan schippers 35f4826198 Fix a corruption found by joanne in load_sym_def() where a static result returned from tcl_hook2() was accidentally freed. 2023-05-04 21:20:58 +02:00
stefan schippers 2438d0fa95 translate2(): better handle %xxx tokens in LCC symbols (propagate %xxx to upper level if not assigned to anything in instance) 2023-05-02 23:21:20 +02:00
stefan schippers 9533b17a20 Allow to pass instance attributes (via translate() ) to symbol generators 2023-05-02 12:42:53 +02:00
stefan schippers 4c3b4d0321 various tcl_hook2() additions on instance names to handle procedures, fix bbox calculation in xschem replace_symbol command 2023-05-01 14:37:10 +02:00
stefan schippers aeea23a84d load_sym_def(): fix a debug message possibly printing garbage due to uninitialized variable 2023-04-29 11:02:23 +02:00
stefan schippers 9593d41f09 persistent load file dialog (Shift-Insert) now correctly handles generator script selection (do nothing until user adds () or (param1,param2,...) to generator name). 2023-04-29 00:28:24 +02:00
Stefan Schippers ee7dc8982a load_sym_def: if loading a symbol reading from a pipe (generator script) do not attempt to seek forward looking for embedded symbols. Assume no embedded symbols exist here 2023-04-28 20:33:57 +02:00
stefan schippers 0bb345f764 fix data corruption when netlisting hierarchical symbols with *_stop attribute set, thanks to Joanne Low regression tests, add option in pop_undo() to avoid saving state (push_undo()) for redo. 2023-04-27 11:52:51 +02:00
stefan schippers 10441ef901 allow tcl procedures to generate generator script and parameters, update vhdl and verilog netlisters to handle generator schematic/symbol references 2023-04-26 09:54:35 +02:00
stefan schippers a111c116d9 set netlisting type to symbol when descending into a generator-created symbol 2023-04-25 00:27:58 +02:00
stefan schippers 68cf318134 load_sym_def(): removed embedded parameter, recognize generator names and pipe in data from generator instead of loading from file. No more set flags for generated symbols to EMBEDDED 2023-04-24 23:56:56 +02:00
stefan schippers cd6ef78841 schematic generator netlisting seems to work. renamed is_symgen() -> is_generator() 2023-04-24 13:26:04 +02:00
stefan schippers 94d1865127 fix save_inst resetting all symbols EMBEDDED flags, not only the used symbols in current schematic. Created get_generator_command(), will be used also for schematic generators 2023-04-24 11:36:07 +02:00
stefan schippers 7c04b009ec do not ask to save parent schematic containing generator-created symbols even if user tries to modify them, is_xschem_file() now returns SYMBOL|SCHEMATIC|GENERATOR|0 2023-04-24 09:24:17 +02:00
stefan schippers a2de3cd787 unified copy_symbol() and copy_symbol1(), better new symbol allocation policy 2023-04-22 00:21:53 +02:00
stefan schippers 9eb4e9440c handle symbol_ref(param1,param2,...) symbol generator scripts, added some utility functions str_chars_replace(), is_symgen(), fix some quoting/backslash subst issues in get_sym_template() 2023-04-21 11:41:20 +02:00
stefan schippers 631fedb11b enabled escape_chars convenience function, added "embedded" parameter to load_sym_def() to better distinguish loading an embedded symbol from loading a regular symbol with a provided file descriptor 2023-04-20 10:44:31 +02:00
stefan schippers 340b89c58d add base_name field in xSymbol struct to keep track of the base symbol name the "virtual" symbol is inherited from (instance based implementation selection with schematic=... attribute) 2023-04-13 22:25:36 +02:00
stefan schippers e4e2ba37cc xschem load from script: no alert box warning if new file given 2023-03-25 09:41:53 +01:00
stefan schippers 6d192023de fix web hierarchy navigation error when returning to web schematic after descending into a local symbol 2023-03-13 11:11:43 +01:00
stefan schippers d2d9eaa4e8 instance attribute "hide=true" will make the instance display as a bounding box only 2023-03-10 04:42:21 +01:00
stefan schippers bf6b20a1ce In source Documentation (scheduler.c) of xschem commands, html docs updated 2023-03-03 18:29:17 +01:00
stefan schippers ebf4fa1f44 Initialize stack2[] to double 0.0 2023-03-01 18:34:07 +01:00
stefan schippers dbc123e8cc Make joanne fix for SPICE_DATA preprocessor macro comparison apply for unix as well 2023-02-27 22:32:28 +01:00
stefan schippers a8aaf996e7 use pre-increment where expression is not used 2023-02-18 09:44:11 +01:00
stefan schippers c5261a2ff6 formatting code 2023-02-13 12:18:47 +01:00
stefan schippers 1aaa48a75b 3x faster table_read() on big data 2023-02-12 13:36:03 +01:00
stefan schippers 6c22c47975 added fast newline count routine count_lines_bytes() 2023-02-12 00:53:48 +01:00
stefan schippers f5676f0d16 table_read() optimized for speed 2023-02-11 12:44:38 +01:00
stefan schippers c51f007da3 table_read(): skip initial empty lines, allow 2 or more blank lines for new dataset 2023-02-10 03:36:29 +01:00
stefan schippers 33c2c2d1b2 Some cleanups in raw_read() and table_read() 2023-02-09 21:17:31 +01:00
stefan schippers 42c3024eda remove debug allocation IDs 2023-02-09 21:06:27 +01:00
stefan schippers 3be9a66aed fix memory leak in table_read() 2023-02-09 21:04:22 +01:00
stefan schippers c882a34825 add table_read() function to read simulation data in ascii tabular form 2023-02-09 20:53:16 +01:00
stefan schippers e5227d6a31 rename top_subckt to lvs_netlist (more appropriate), better tcp interface (redirect stdout to socket in addition to command return value) 2023-02-09 11:30:27 +01:00
stefan schippers 29ef08e84b better memory tracking reporting (my_strcat and my_strncat allocations) 2023-02-01 11:38:28 +01:00
stefan schippers baca559ffc refactor some code (use set_text_flags() to avoid repetitive code), add xschem setprop text and xschem getprop text commands to set/get text attributes 2023-02-01 00:23:33 +01:00
stefan schippers 23378b8708 replace u_int32_t with unsigned int in save.c 2023-01-24 01:46:26 +01:00
stefan schippers 48549f1212 update test schematics 2023-01-23 18:23:18 +01:00
stefan schippers 1da5e47d4a remove my*() allocation routines unique IDs and replace with _ALLOC_ID_ macro, to be substituted in debug sessions with create_alloc_ids.awk 2023-01-23 15:42:15 +01:00
stefan schippers 3043989196 fix debug test 2023-01-23 12:17:47 +01:00
stefan schippers fd8f1e6b97 fix a regression in track_memory.awk (did not show leaking source code line) 2023-01-23 12:16:29 +01:00
stefan schippers cffe91146e free paddedData pointer in ascii85_encode() 2023-01-23 11:55:52 +01:00
stefan schippers 9b6b7bc19a Fix some compiler warnings and add a little optimization in ascii85 encoder 2023-01-23 11:49:08 +01:00
rafmag 898f229c61 Merge branch 'master' of https://github.com/rafmag/xschem 2023-01-22 19:44:58 -07:00
rafmag 9c83801d8f Added Ascii85Encoding for better formated & smaller PS files. 2023-01-22 19:35:10 -07:00
stefan schippers 6af6079084 set line buffering when stderr redirected to file 2023-01-20 18:25:43 +01:00
stefan schippers 90bc0fa572 "preserve unchanged props" will be automatically checked when editing attributes on multiple object selection and unchecked on single object selection as this is the 99.9% use case 2023-01-20 00:35:24 +01:00
stefan schippers 6f6bd65035 fflush() all stdio buffers before calling fork(). End child processes with _exit() instead of exit() to avoid double fflushing in parent i/o streams 2023-01-19 02:46:45 +01:00
stefan schippers e06bfe5191 remove some debug changes 2023-01-18 01:17:46 +01:00
stefan schippers 03b2b8652e fixed filter_data routine that was clobbering ps export file, now ps output is correct without the need to add fflush() functions, that are thus removed in psprint.c 2023-01-18 00:24:28 +01:00
stefan schippers af0ddb76f0 cleanups, remove redundant png_reader() definition 2023-01-17 01:23:34 +01:00
stefan schippers 19757ddd8a add menu properties -> Edit header/License text, to allow inserting header or license metadata into the sch/sym file. 2023-01-02 03:04:35 +01:00
stefan schippers 9fa05afad9 fix a bug when loading multiple AC sim datasets (wrong nvars calculation, has to be doubled due to Im/Re complex components) 2022-12-20 01:01:58 +01:00
stefan schippers 2cb58c5c5c added generators/ dir, removed redundant variable in load_schematic() 2022-12-19 23:05:09 +01:00
stefan schippers 1a76f89464 added xschem_library/generators directory for future schematic/symbol generator scripts. Handle empty XSCHEM_LIBRARY_PATH (use [pwd]). 2022-12-18 13:03:38 +01:00
stefan schippers 9c31682517 test and get reading schematics from the web on Windows working 2022-11-18 16:06:06 +01:00
Stefan Frederik e27eea8233 added comments and a fix in descend_symbol() 2022-11-15 15:08:11 +01:00
Stefan Frederik a7066600b4 use tmp subdirectory: better string matching 2022-11-15 13:21:16 +01:00
Stefan Frederik 8f6aaa0ec2 use tmp subdirectory to group web schematics 2022-11-15 12:59:52 +01:00
Stefan Frederik c9380bd8f0 use local name (/tmp/xxx.sch) when displaying schematic name in title, indtead of full url (too long) 2022-11-15 10:25:19 +01:00
Stefan Frederik b2f159706c if loading a new schematic (currsch==0) reset current_dirname 2022-11-15 02:10:18 +01:00
Stefan Frederik 6cd9d76f90 initial implementation of fetch schematics from web 2022-11-15 01:17:33 +01:00
Stefan Frederik ca8ffafe8a code refactoring (update_conn_cues()) 2022-11-07 14:23:57 +01:00
Stefan Frederik 153929806b fill attribute on rectangles to override layer fill style: fill=false will not fill 2022-10-29 23:49:00 +02:00
Stefan Frederik cb652adb5f skip NULL or empty texts in draw_symbol, translate2() skip @@... and @#... tokens (return empty) 2022-10-21 17:48:54 +02:00
Stefan Frederik 4e05fe1bab comment some unneeded dbg messages, update install html page 2022-10-21 12:54:02 +02:00
Stefan Frederik a6dc3d47c3 cache embed attribute of instances for faster lookup 2022-10-21 11:04:20 +02:00
Stefan Frederik 0f25befe31 recursive attribute substitution. use also template attribute of parents if not found in instance prop_ptr 2022-10-20 10:30:48 +02:00
Stefan Frederik 59fb225a36 fix potential string overflow. Thanks JL 2022-10-18 08:38:09 +02:00
Stefan Frederik 33d9afd3a1 avoid hardcoded (relative) paths for label/pins searching, use more general find_file method 2022-10-17 17:20:40 +02:00
Stefan Frederik dad83010f0 perf. improvements in plot_raw_custom_data() / ravg_store() 2022-10-17 15:17:47 +02:00
Stefan Frederik b0359d880a use sim_pinnumber for port ordering in simulation netlists and leave pinnumber for package pin position. These two collide, for example in spice port ordering vs (transistor problem) device package pinnumbers. Dont load graphs in lcc symbols 2022-10-17 12:05:54 +02:00
Stefan Frederik 78ca99e4bf save symbol with ordered pins if pinnumber is present in all pins 2022-10-16 22:26:35 +02:00
Stefan Frederik 407bac461d sort symbol pins: remove useless debug messages 2022-10-16 16:23:00 +02:00
Stefan Frederik fc576f69ac sort symbol pins if key pinnumber is present on all of them 2022-10-16 16:18:38 +02:00
Stefan Frederik e8b2385f24 update xschemtest hashes, uniquify allocation IDs 2022-10-16 14:21:22 +02:00
Stefan Frederik 91ba5fd1d3 annotation of voltage and currents in (nested) LCC instances 2022-10-16 13:08:52 +02:00
Stefan Frederik 0e6c35f598 translate2(): return @spice_get_voltage* strings unchanged; get rid of "@#..." tokens in translate2 (return empty) 2022-10-15 22:50:18 +02:00
Stefan Frederik 93fe5bf414 fix handling empty return value of translate2() in load_sym_def() 2022-10-15 11:16:36 +02:00
Stefan Frederik 3adb192936 @spice_get_voltage(net) error checking 2022-10-15 10:52:07 +02:00
Stefan Frederik adf477fbcc optimization in translate(): @spice_get_voltage will use the "lab" attribute (if existing) to build up the net name to look up in raw file, before reverting to a call to net_name() to get the net from the attached net 2022-10-15 08:55:32 +02:00
Stefan Frederik 7c60f37f54 better atof_spice() suffix checking, set xctx->current_dirname to $PWD when creating an empty new tab (untitled schematic) 2022-10-13 16:45:27 +02:00
Stefan Frederik f7738329a5 my_fgets() 2022-10-13 13:43:01 +02:00
Stefan Frederik 150c2663b9 added netlist_options as list of symbols not to load in schematics-as-symbol instances, load_file_dialog: make remember last dir work again 2022-10-09 23:49:28 +02:00
Stefan Frederik 5fe2f1586b refactor str_hash_* and int_hash_* functions 2022-10-05 01:18:45 +02:00
Stefan Frederik 9c29324c8a allow nets with no label pass thru symbols with duplicated pins. named nets will propagate through duplicated pins 2022-10-04 12:34:09 +02:00
Stefan Frederik 29d6655a01 use limiting mylog()/mylog10() functions in expression calculator 2022-10-03 18:29:36 +02:00
Stefan Frederik 4bbed85d23 faster jump table in plot_raw_custom_data(), added simulation->add waveform reload launcher 2022-10-03 11:15:14 +02:00
Stefan Frederik d174306880 added verilog_extra attribute for list of implicit node connections to symbol in verilog netlists. extra attribute still used in verilog as a list of attributes NOT use as component attributes / symbol parameters. 2022-10-03 01:20:33 +02:00
Stefan Frederik 28c644fba7 doc updates (new graph functions) 2022-10-02 20:52:17 +02:00
Stefan Frederik 9acbf3fb41 added prev(), del() function in graph processing. Extend calculation 1 or 2 point beyond viewport for exact deriv/integ/prev/del calculation at left edge 2022-10-02 11:05:29 +02:00
Stefan Frederik 5a39f7be40 cleanups in plot_raw_custom_data() 2022-10-01 10:38:27 +02:00
Stefan Frederik 6296bbc1c6 compile option for 2nd order 3-point backward derivative calculation formulaes for graph expressions 2022-09-29 18:22:55 +02:00
Stefan Frederik 6d17797d0b add Highlight->Select overlapped instances command 2022-09-27 18:35:42 +02:00
Stefan Frederik 472751dfc0 better file globbing in load_file_dialog 2022-09-27 13:15:04 +02:00
Stefan Frederik 48d1b44220 allow spice multipliers in numbers (20u, 10k, 20p) in graph expressions 2022-09-22 21:12:40 +02:00
Stefan Frederik 2487ee98e2 do not set time_last_modify (set to 0, undefined) when loading a schematic that does not exist (untitled) 2022-09-22 14:46:52 +02:00
Stefan Frederik d473e8b1ab updated docs with additional video on graphs and Xyce sim 2022-09-22 13:45:55 +02:00
Stefan Frederik 931c1520e3 make op backannotation in schematic work also if raw file loaded at hierarchy level > 0 2022-09-21 13:58:01 +02:00
Stefan Frederik e67ff344c8 cleanup/rename some xctx variables and graph-related functions, avoid drawing graphs using data file loaded from from schematics that are unmatched with current schematic or up in the hierarchy levels 2022-09-21 11:25:45 +02:00
Stefan Frederik ea702976ee cleanup/free data in read_dataset() on malformed input file 2022-09-20 23:16:59 +02:00
Stefan Frederik af475e00df xschem raw_read accepts an optional type argument after file name (tran, ac, dc, op, ...) to select type of simulation to load from raw file. New command xschem annotate_op will replace ngspice::annotate tcl procedure. 2022-09-20 16:49:42 +02:00
Stefan Frederik 7abceb3344 fix regression in ngspice::get_current, simplified voltage reporting in net label symbols 2022-09-20 00:12:27 +02:00
Stefan Frederik 7d6b33cda8 limit max size of embedded graph bitmaps in svg export. added deriv0() graph function, does derivative w.r.t. index 0 (sweep) variable, regardless of graph sweep (x axis) variable. 2022-09-16 12:16:26 +02:00
Stefan Frederik f644ce58a6 graphs are now rendered (as detailed png bitmaps) in svg exports 2022-09-15 19:39:16 +02:00
Stefan Frederik e5d60bb92a tuning of is_xschem_file proc to avoid misdetecton of valid files 2022-09-14 11:37:39 +02:00