Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging of all user interaction #278

Open
ananthchellappa opened this issue Jan 17, 2025 · 3 comments
Open

Logging of all user interaction #278

ananthchellappa opened this issue Jan 17, 2025 · 3 comments

Comments

@ananthchellappa
Copy link

I am interested in implementing this feature. Any guidance regarding the code would be greatly appreciated. Thanks in advance.

One feature Cadence offers, which is very useful, is to capture all interaction to a log file. (In truth, it is not as comprehensive in this function as Tanner S-Edit (Mentor Graphics, not Siemens EDA, which captures all mouse click coordinates when they are used to input info). It is useful because one can refer the log file to create scripts for frequently repeated tasks and attach those to keyboard shortcuts.

Every command is captured in the log file - every command - opening a file? Zooming into a certain area (mouse coordinates for the two points must be recorded).
Any input through the mouse must be logged - such as, user enters wire drawing mode and now the tool expects a series of points representing the start and end points of various line segments.
In this specific case of wire drawing, the log can look like
wire()
mouse_click(x, y)
mouse_click(x, y)
end_function() ; when user presses ESC to terminate a command

Note that xschem can be invoked with a script option. The idea behind the log file is to (as far as is reasonable) create a script that xschem can run. Informational logs can be preceded with a ; or # or whatever denotes a comment in TCL.

Where to log? Default is the users home directory.
The variable "log_location" can be set in the xschemrc will override this. For example, if the user sets it to ./logs, then the subdirectory "logs" within the directory from which xschem was launched will be used.

The file name will default to xschem.log. If this file aleady exists, then the file name will be xschem.log.1. If that one already exists, then the name will be xschem.log.2 (you get the idea).

@StefanSchippers
Copy link
Owner

This is a nice feature. It requires time to implement it.
xschem has more than 1000 dbg() function calls. These are used to debug the program, not to track the user work.
I think another function should be created (use a short name since you will be using it hundred of times) that reports commands in a form they can be replayed by xschem as scripts. If some user action can not be scripted efficiently we can add another 'xschem command' for that.

@ananthchellappa
Copy link
Author

Thank you Stefan. I will update you on the progress. We may have more specific questions as we work on it.

Is this action already supported by a command that can be submitted through the TCL interface?:

you are deep down in the hierarchy - having descended into a few cells. Now you want to return to the top level with a single command, not multiple "returns" (or pops?).

To accompany that, given an instance name (at current level), is it possible to send a TCL command to descend into it?

@StefanSchippers
Copy link
Owner

you are deep down in the hierarchy - having descended into a few cells. Now you want to return to the top level with a single command, not multiple "returns" (or pops?).

you can do it this way:

while {[xschem get currsch]} {xschem go_back}

To accompany that, given an instance name (at current level), is it possible to send a TCL command to descend into it?

xschem select instance x1
xschem descend [n]

The 'n' integer parameter is optional and is used to descend into a specific instance of a vectored instance:

xschem select instance {xrdec[31:0]}
xschem descend 3

this will descend into xrdec[29]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants