How to check if a signal is toggling after some time in simvision TCL command - tcl

I was working in simvision environment and I was developing to script to check whether a signal is toggling after some time. Could you please let me know if there are TCL command in the simvision console.
I was using waveform values -at time signal but it was displaying one value.

Related

Command to send signals to waveform in SimVision

Is there a (Tcl-)command I can use to send signals to waveform in SimVision?
Of course You can rightclick them and then select "Send to WaveForm Window", but to do that each time you start a simulation will be a pain.
In Modelsim you can easily use "add wave" in a dofile (tcl file), but strange if there would be no way to do this with ncsim...
When you have your waveform window set up the way you like (with all desired signals), you can go to File -> Save Command Script . This will save your window setup as a tcl file. You can look in there to see what the tcl commands are if you are interested in doing it manually.
To restore the waveform window next time, simply go to File -> Source Command Script and select the file you had saved previously.
Note: I'm using SimVision 12.10
a minimal working example I've come up with:
window new WaveWindow -name "Waveform"
waveform using {Waveform}
waveform add -signals tb_foo_u.module_bar_u.signal_xyz
You can type that in the SimVision console (if you're using irun in GUI mode). Tested in 15.20. Those are simulator-specific commands.
If you want it to be done automatically # irun startup (using .tcl file), examine the results of running commands from the other answer, then tailor it to your needs.
For the full, verbose description of waveform instruction, refer to the documentation provided with the simulator under SimVision Tcl Commands / waveform.

Octave input from keyboard not working in a script

I'm writing a script in octave that needs an input from keyboard in order to select a function to be used further. I've read the documentation and understood that
ans = input("choose...")
should wait for the for the input and store it in the ans variable. When I use it in the octave terminal it works just fine, but it doesn't when I insert it in my script : It shows the message "choose..." but it doesn't wait.
I don't get it, What I am missing.
Thanks,

How to disable a modified tclsh interpreter interactive mode?

Run tclsh command without any tcl file, the interpreter will go into interactive mode.
Can I simply disable this feature by modifying the tclsh source code ?
I can't imagine why you would want to bother doing this, given that supplying any script file will turn off interactive mode. The script you supply will have full access to the additional arguments passed in (a list in the global argv variable) and the standard IO channels (stdin, stdout and stderr). It can exit when it is done. Literally anything you want can be done at that point; you've just got to write a script to do it.
If you're including Tcl in your own program, the behaviour of tclsh is implemented in the C function Tcl_Main. If you never call that — instead just using Tcl_FindExecutable, Tcl_CreateInterp and Tcl_Eval/Tcl_EvalFile — then you never get any of that interactive behaviour. While theoretically you could modify the Tcl source itself to do what you want — it's all open source — why would you bother when you could just not call that code in the first place?

Passing execution time parameters to TCL scripts from non interactive shell

I am able to run the TCL scripts on the linux server from the Non-interactive shell created by JSch library used in the java program from windows environment. The problem is I have some scripts which needs to pass certain parameters during the execution of the script based on the intermediate output of the script and after the parameters are entered, the script execution continues from there onwards. But as it is non interactive shell, I am not able to pass this parameters during execution. Is there any way where I can make it work ? I thought of an option where, I will pass the parameters as command line argument, but wanted to know any other way.
When you say "parameters", do you mean anything that a user would have entered in an interactive session as an input to prompts presented by the script?
If yes, there are two possibilities:
If the script does not expect the session to be interactive, and just reads its input from its standard input stream (using gets for instance), then just feed this input to the standard input of the tclsh process which interprets your script.
If the script does expect the session to be interactive (and refuses to just accept the data from its input stream), you will have to allocate a pseudo-TTY for the target process.
I'm not familiar with JSch, but this appears to be a question (and an answer) dealing with the making JSch allocate a PTY.

How to get a response from a script back to Hudson and to fail/success emails?

I'm starting a Python script from a Hudson job. The script is started though 'Execute Windows batch command' in build section as 'python my_script.py'
Now I'd need to get some data created by the script back to Hudson and add it to the fail/success emails. My current approach is that the Python script writes data to stderr which is read to a temp file by the batch and then taken into an environment variable. I can see the environment variable correctly right after the script execution (using set command), but in the post-build actions it's not visible any more. The email sending is probably done in different process, so the variables are not visible anymore. I'm accessing the env vars in the email as ${ENV, varname} (or actually in debug mode as $ENV to print them all)
Is there a way to make the environment variable global inside Hudson?
Or can someone provide a better solution for getting data back from Python script to Hudson.
All the related parts (Hudson, batch and Python script) are under my control and can be modified as needed.
Thanks.
Every build step get's is own shell. This implies, that your environment variables are only valid within the build step.
You can just write the data in a nice format to the std output (use a header that is easy to identify) and if the job fails, the data output gets attached in the email.
If you insist on only putting in the data, you can use the following token for the Editable Email Notification post build action (Email-ext plugin).
${BUILD_LOG_REGEX, regex, linesBefore, linesAfter, maxMatches, showTruncatedLines, substText}