Commit Graph

104 Commits

Author SHA1 Message Date
Tim Edwards eda5f506f3 Made another change to the netlist-to-layout procedure so that it
better supports re-entrant use, especially for the use case where
the import was abandoned before saving, or the generated cells
were not saved (which is easy to do, because the top level cell
is always written out to disk, but the rest of the cells will only
be written when "writeall" is executed).  The new code detects
input cells that did not have any layout file (has flag "not-found"
after loading) and deletes them and their instances so that they
can be regenerated from scratch.
2023-10-06 19:38:53 -04:00
Tim Edwards 9e7c104d29 Corrected a small error in the device generator toolkit that fails
to pick up properties from an existing cell and prints an error
message instead.  This will likely cause non-default properties
of an instance to be lost if the SPICE import is used in a
re-entrant manner (not exactly a common use-case).
2023-10-06 17:51:40 -04:00
Tim Edwards b156e79b2c Corrected a toolkit error where the callback to check parameter
bounds should be called whenever an entry is changed and either
the entry window loses focus or the <Enter> key is pressed.
This had ended up disabled when the scrollbar was added to the
dialog window, causing the window hierarchy to change, which
invalidated the regexp used to identify the entry and checkbox
widgets.
2023-09-29 09:38:48 -04:00
Tim Edwards 50b1e01cfc Corrected the scrollbar function on the parameterized device
generation dialog window.  The window is now made to fit the
list of parameters when it is made, but can be reduced in size
which allows the scrollbar to function.  Event bindings for the
mouse scrollwheel were added so that it can subsitute for the
scrollbar within the parameter window.
2023-09-13 11:28:07 -04:00
Tim Edwards dfe3a4defd Added a "Place" button in the cell manager after realizing that
other commands like "Place Instance" and "Library Manager" do not
track cells in the internal database, and so are unable to place
a cell instance that does not have a corresponding file on disk
(e.g., a cell read from GDS or LEF).
2023-09-12 11:52:15 -04:00
Tim Edwards 68a088943f Made an enhancement to the code that automatically tries to figure
out where to find the technology corresponding to a file given on
the command line: (1) Changed the default search location from
/usr/share/pdk to /usr/local/share/pdk, which is the actual default
for open_pdks (can still be overridden by environment variable
PDK_ROOT).  (2) Made the PDK name by itself preferable to the PDK
name plus any extension when searching (e.g., "sky130A" is preferred
over "sky130A_backup").  (3) Check the located directory for any
file <tech_name>.tcl and source it if it exists.  (4) Run any tag
callbacks on the "tech load" command, which rebuilds the tool icons.
2023-09-12 11:12:00 -04:00
Tim Edwards d4f8fe04c5 Corrected the variable string "RCS" in tkcon.tcl, which had
become truncated, causing the "About" menu item in the console
to generate an error message.  Since the tkcon.tcl used in my
other software packages like IRSIM was correct, I just pulled
the RCS string from there, and it seems to be okay now.  This
solves github issue #259.
2023-07-25 17:15:11 -04:00
Tim Edwards 7a4a867d6e Extended the "paint" and "erase" commands to accept an option
"pick x y" which acts like "cursor", but operates on a database
coordinate instead of a pointer coordinate.  Made a few other
corrections to the command logging code so that it produces
valid output when the log file is sourced.
2023-07-08 17:34:00 -04:00
Tim Edwards c8a2d06e08 Finally got around to fixing the "logcommands" command, which has
been broken ever since moving to the Tcl/Tk wrapped version.  Added
some new features that allow background commands from the window
handling (like pointer tracking) to be omitted from the log file
via a suspend/resume function.  Added a header file and a few
commands at the top of the log file that align the log file contents
with the screen and box state at the start of logging.  This makes
a log file which can be "played back" by sourcing it from the magic
console prompt.  Per request from Harald Pretl.
2023-06-28 21:31:24 -04:00
Brad Smith c8940ab219 Allow for bash in locations other than /bin 2023-04-22 14:13:57 -04:00
Tim Edwards 6dd5f4d7e3 Corrected problem caused by adding a scrollbar to the parameters
window in the toolkit, which was to the "tkwait" command, which
waits for a change in state.  What was intended was to wait for
a change in state to visible only;  once visible, the "tkwait"
command should not invoked or else the process will block.
2023-03-22 15:28:00 -04:00
Tim Edwards 913c830dee Corrected the extraction of length and width of devices that are
(truly) missing a terminal (such as a MOSCAP made with a gate
extending into but not crossing a diffusion region).  Added the
most requested GUI feature, which is a vertical scrollbar on the
parameterized device window (could be improved by maximizing
window height without exceeding display height).
2023-03-12 16:57:47 -04:00
Tim Edwards 5e5879c53d Made a simple but important change to "readspice.tcl" to unexpand
the cell being reworked for port numbering.  Otherwise *all*
labels are selected, which can take a very long time depending on
how many labels are in the layout.  Note:  Need a "select area
ports" function, and better yet, rework the whole label database
so that magic no longer has to run compute-intensive routines
like DBEraseLabelsByContent().
2023-03-08 11:14:22 -05:00
Tim Edwards d4790d2f31 Corrected the "measure" (Tcl scripted) command to fix an error
when internal units no longer match lambda units.  The text
would match the dimension of the cursor box, but the measurement
lines would be drawn assuming a lambda scale, not the internal
scale.
2023-02-20 16:06:18 -05:00
Tim Edwards 3b396d65f0 Reverted the toolkit change from the last commit after realizing
that the feature for implementing callbacks on a selection list
was already implemented via the add_dependency procedure.
Modified the GDS read to remove cell instances that are placed
directly on top of one another in the same cell.  Modified the
GDS read to make a better selection of a default font size for
text that specifies a font but not a size, using the minimum
width for the layer the text is placed on.  Modified the GDS
read to remove text with empty-string placeholders (created when
a pin layer is read but no text exists to go along with it, due
to GDS not having a specific way to make pins, such that pins
have to be split between one record for geometry and another
for text).
2022-12-15 12:25:23 -05:00
Tim Edwards edecd81046 Modified the toolkit add_selection procedure to take an extra
optional argument that is a callback function, so that the act
of selecting something from the drop-down menu can cause things
to happen such as changing the GUI window contents for the item
selected.
2022-12-14 17:38:19 -05:00
Tim Edwards 075262b2ef Added the ability to read compressed .mag files (writing is not yet
supported).  Fixed the long-standing issue in which DRC does not
get stopped by the "drc off" command (the behavior for interrupting
the DRC was dependent on the DRC being turned on, and the "drc off"
command was turning it off before breaking, causing the interrupt
to be ignored).
2022-11-02 17:12:46 -04:00
Alessandro De Laurenzis b306a39560 Compatibility with C99 standard
This commit makes the code (mostly) C99-compatible, enabling to compile
it without the -Wno-error=implicit-function-declaration flag. This
way, Magic becomes usable on arm64 architectures, specifically on Apple
computers with M1/M2 SoC.
2022-10-29 06:07:46 +02:00
Tim Edwards f45f3c96e5 Updated version to go along with the merge of pull requests 175 and 176
(OpenBSD/NetBSD/DragonFly support), and a change to the wrapper to allow
manual override of the number of icon columns (because sometimes some
window managers are clueless about the correct window dimensions).
2022-08-22 12:20:59 -04:00
Tim Edwards c997f4cccf Modified the configure script and Makefiles so that systems that do
not include zlib by default will pick it up from the compile line.
2022-05-28 17:51:20 -04:00
Tim Edwards f760b038d6 Updated VERSION to go along with the merge of pull requests 160
and 161 from Donn, and modified one of the files from PR 161 to
maintain typographic consistency.
2022-05-03 08:32:00 -04:00
Mohamed Gaber 9bf3d76260 Mac Build Fixes
+ Add "smoke test" build CI to Github Actions
+ Added a configure_mac script (requires brew)
~ caddr_t -> void* (was never a part of any UNIX standard)
2022-05-03 08:30:39 -04:00
Donn 2820aa49e2 Add AppImage Building Capabilities
(Take two)

+ Adds a GitHub Actions flow that builds an AppImage (see AppImages.org) that can produce a monolithic magic binary
~ Fix a portability issue in tcltk/magic.sh.in

This binary should theoretically work on any Linux distro with Glibc 2.3+ and Cairo 1.8+, which is any up to date distro in the last decade.
2022-05-03 08:28:53 -04:00
Tim Edwards e675decfc0 Cleaned up a bunch of stuff around "magicdnull", starting with not
linking it to Tk or X11 graphics.  Added new command "display" which
returns the display type, which is good for finding out if the
display is "NULL".  Added code to allow the wrapper to be defined
for NULL graphics with the Tk console, the main necessities of which
are to remove the "openwrapper" command, and to return immediately
from a number of tag callback functions.
2022-03-30 10:55:08 -04:00
Tim Edwards bae5d9cd06 Added a command-line option "magic --commit" which provides the commit
number from the git repository, which is overall more reliable than
the version number, but mainly to support a common method across the
open source tools for providing information to builds like open_pdks
that may need to know what version of every tool was used for the
build.
2022-02-25 09:56:22 -05:00
Tim Edwards 021e9b5eec Modified the print routines so that TxPrintf and certain uses of
Tcl_SetResult() will backslash-escape "$" characters occurring in
names (e.g., cell and net names) when the "$" does not represent
a Tcl variable.
2021-11-24 12:40:59 -05:00
Sai Charan Lanka b099b17178 Create techbuilder.tcl 2021-08-28 12:58:58 -04:00
Sai Charan Lanka e7bc994224 Delete techbuilder.tcl 2021-08-28 12:58:58 -04:00
Sai Charan Lanka 6b646fd103 Update techbuilder.tcl 2021-08-28 12:58:58 -04:00
Tim Edwards a5e0de031c Corrected the "font measure" line in the wrapper Tcl code from
revision 131, as a Tk default font size less than 10 will round the
scaling factor down to zero and result in bad things happening.
2021-04-06 22:04:53 -04:00
Tim Edwards 8f8c3f77f2 Got rid of the annoying behavior of "popstack" to not return to the
original view position;  this was due to not setting units to
internal before re-applying the previous view position.  Also wrapped
most of the "popstack" routine into a suspendall...resumeall block so
that the view is refreshed only once;  this is especially important
when popping back into a full chip view.
2021-04-01 12:31:46 -04:00
Tim Edwards 187c9285e2 Extended the "port" command with option "-quiet" to suppress error
output when using the "port ... index" or "port ... name" to query
values from a specific port by name or index.  The "readspice"
script has been modified to use this option to prevent unnecessary
error output from the script as it searches a layout for possible
name matches to a SPICE netlist subcircuit pin list.
2021-03-29 11:44:39 -04:00
Tim Edwards 8a0b180cde Modified the crash backup script to add options "disable" and "resume".
However, this has not been implemented as it has been observed that
the use of itimer() has a restriction of one timer per process, which
interferes with the three or more uses of the timer within magic.  The
timer method will have to be changed to use the POSIX timer_create()
routine, before this will work properly.
2021-03-17 12:45:35 -04:00
Tim Edwards f790ea7589 More enhancements for schematic_to_layout to parse various
non-circuit content in a SPICE netlist (mainly to ignore test-
bench elements and commands).
2021-03-11 13:30:28 -05:00
Tim Edwards 56be41932f Restored the toolkit behavior of spreading out cells that are
read in from a SPICE netlist in a row instead of placing them
on top of each other.
2021-03-11 12:27:14 -05:00
Tim Edwards 3bd9adbaf8 Corrected a set of regexps in the schematic-to-layout script that
prevented normal x=y type parameters from being parsed.
2021-03-11 11:09:37 -05:00
Tim Edwards 5b8a59c4ad Added extensions to the toolkit base to add netlist-to-layout
conversion, largely converted from the python script in open_pdks,
which itself was derived from an efabless script, and none of
which have been particularly well tested.
2021-03-09 22:07:51 -05:00
Tim Edwards c99e632744 Modification of readspice.tcl script to work around issue if no ports
are found (i.e., "port first" returns nothing, instead of a number).
2021-03-03 11:39:35 -05:00
Tim Edwards 9a79a1eee2 Fixed a minor error in the plot command that is missing a value
in the print statement on detecting an invalid plot parameter
value name.
2021-02-23 09:58:52 -05:00
Tim Edwards 2e9c554f2c Revised the wrapper script to use the Tk command "font measure"
to get the pixel size of the default font, and scale the window
glyphs and scrollbars to match, so that the display is automatically
adjusted for screen resolution and does not require manual intervention
to correct for high resolution displays.
2021-02-20 13:24:02 -05:00
Tim Edwards c0867ef71e Reverted about half of pull request #41 because it breaks compatibility
with qflow, which wants to launch applications from symbolic links.
The portability of magic now depends only on setting environment
variable CAD_ROOT, but the portability should still be ensured.
2021-02-02 10:19:04 -05:00
Tim Edwards ebb378da08 One additional correction to yesterday's commit, as the 2nd solution
was compatible with CentOS but not OSX.  This solution appears to be
more universally compatible.
2021-01-05 09:30:05 -05:00
Tim Edwards 22c6eb0f2c Changed "realpath" in the scripts (added from a pull request merge
earlier today) to "readlink -f", because "realpath" does not exist
on some systems (e.g., CentOS).  "readlink" seems to be more
universally available.  Noticed that the ext2spice and ext2sim
scripts use /bin/sh instead of /bin/bash, which would cause problems
with some systems where sh != bash.
2021-01-04 14:53:21 -05:00
Tim Edwards 5005f77d3f A few minor changes to the last commit to prevent compiler warnings. 2021-01-04 10:02:15 -05:00
Tim Edwards 20eb6ce6c1 Made a few modifications to the patch from Keno Fischer (pull request
startup.  I'm not sure that it is even possible to have a Tcl variable
set at this point in the startup procedure, though.
2021-01-04 09:47:03 -05:00
Keno Fischer 3e6acd43fd Make bash wrapper relocatable
By having the build system put in a relative path rather
than an absolute path. Unfortunately, make does not support
computing relative paths manually, so a small bash script is
needed that will do this for us.
2021-01-04 09:34:31 -05:00
Keno Fischer 80488a8ee9 Have magic.tcl look for the shared library in the script directory
Rather than having the build process embed an absolute path.
The first of a couple of steps to make the magic build relocatable.
2021-01-04 09:34:31 -05:00
Ahmed Ghazy 4066d50332 Add dependencies on the VERSION file
- this fixes issue where some of the binary objects would contain an
  outdated MAGIC_VERSION if "make clean" was not done after the VERSION
  file changes. (e.g., the "Magic VERSION revision REVISION" message in
  the wish console and the version requirement checks from a tech file)
2021-01-04 14:11:21 +02:00
Tim Edwards 6d009682bc Applied a patch by Matt Guthaus to a routine in the readspice
annotation script, that moves a block of code making a list of
all labels outside of an inner loop where it causes a huge slowdown.
2020-11-12 16:46:51 -05:00
Tim Edwards cd3d765f9d Changed the readspice (annotation) script so that it uses the exact
label name with "port make", resolving any issues that might arise
if the label overlaps another.
2020-11-12 13:59:22 -05:00