UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor vizzie
Visitor
10,926 Views
Registered: ‎10-02-2008

ModelSim XE script: sending email after simulation has finished

Jump to solution

Hello,

I have a big simulation program that takes a while to finish. I have to periodically check it to find out if the script for automated simulation is still running. Is there a way I can include something in my tcl (.do) script (for automating simulations in ModelSim XE) so that it sends me an email every time it finishes executing the entire script?

Thanks.

Regards,

 

Vijay.

0 Kudos
1 Solution

Accepted Solutions
Visitor vizzie
Visitor
12,990 Views
Registered: ‎10-02-2008

Re: ModelSim XE script: sending email after simulation has finished

Jump to solution

Hello,

 

I realized that the script that I posted before may not work on some networks as it doesn't have the originator labeled on it. The complete script then would be as follows:

 

proc send_simulation_complete_mail {from to email_server subject body} {
package require smtp
package require mime

set token [mime::initialize -canonical text/plain -string $body]
mime::setheader $token Subject $subject
smtp::sendmessage $token -originator $from -recipients $to -servers $email_server
mime::finalize $token
}

send_simulation_complete_mail fromemail@frommailplace toemail@tomailplace name_of_email_server "Subject: Your simulation is complete." "Body: It was boring, monotonous, sedate, tedious, soporific,..."

 

 

Regards,

 

Kumar Vijay Mishra.

View solution in original post

5 Replies
Teacher eilert
Teacher
10,915 Views
Registered: ‎08-14-2007

Re: ModelSim XE script: sending email after simulation has finished

Jump to solution

Hi Vijay,

there's a email package for Tcl:

 

http://web.uvic.ca/~erempel/tcl/Email/Email.html

 

Just found it using google with these searchwords: tcl email

So I have no experience with it.

 

Please give some feedback on how it worked, or whatever solution you found for this problem. 

 

Have a nice simulation

  Eilert

Visitor vizzie
Visitor
10,889 Views
Registered: ‎10-02-2008

Re: ModelSim XE script: sending email after simulation has finished

Jump to solution

Thanks eilert for your reply.

 

Turns out this was a simpler task as far as Tcl/Tk is concerned.But I was a tad worried if all the packages are available with Modelsim XE or not. However, the Tcl/Tk solution worked for the ModelSim scripts also.

 

What I did is added the following after the last line of my simulation script:

 

 

proc send_simulation_complete_mail {recipient email_server subject body} { package require smtp package require mime set token [mime::initialize -canonical text/plain -string $body] mime::setheader $token Subject $subject smtp::sendmessage $token -recipients $recipient -servers $email_server mime::finalize $token } send_simulation_complete_mail myemail@mymailplace.mydomain name_of_my_local_smtp_host "Subject: Your simulation is complete." "Body: It was boring, monotonous, tedious, soporific,...but Good God! I am done."

 

I am using 32-bit Windows OS for ModelSim XE simulations where I have set my default email client as Thunderbird. So, the above proc operates through Thunderbird. Other email client users (EVolution, Outlook, Macmail etc) should evaluate this code for their email clients. I am pretty sure it would work there as well.

 

I also found some other useful Tcl scripts which worked with ModelSim  regardinggenerating email (not sending it) and more detailed sendmail ecripts (with attachments etc).Please see here and here.

 

Regards,

 

Kumar Vijay Mishra.

 

Tags (4)
0 Kudos
Visitor vizzie
Visitor
12,991 Views
Registered: ‎10-02-2008

Re: ModelSim XE script: sending email after simulation has finished

Jump to solution

Hello,

 

I realized that the script that I posted before may not work on some networks as it doesn't have the originator labeled on it. The complete script then would be as follows:

 

proc send_simulation_complete_mail {from to email_server subject body} {
package require smtp
package require mime

set token [mime::initialize -canonical text/plain -string $body]
mime::setheader $token Subject $subject
smtp::sendmessage $token -originator $from -recipients $to -servers $email_server
mime::finalize $token
}

send_simulation_complete_mail fromemail@frommailplace toemail@tomailplace name_of_email_server "Subject: Your simulation is complete." "Body: It was boring, monotonous, sedate, tedious, soporific,..."

 

 

Regards,

 

Kumar Vijay Mishra.

View solution in original post

8,064 Views
Registered: ‎11-08-2013

Re: ModelSim XE script: sending email after simulation has finished

Jump to solution

Hi

     I am getting an error "Could'nt open socket: Invalid argument". Please help me. It is helpfull if example server name is provided.

0 Kudos
Contributor
Contributor
6,204 Views
Registered: ‎07-17-2012

Re: ModelSim XE script: sending email after simulation has finished

Jump to solution

I also tried this now, and getting the same error:

"couldn't open socket: invalid argument"

 

Furthermore, what should I put instead of:

fromemail@frommailplace toemail@tomailplace name_of_email_server

why 2 emails are needed?

name of email server is just outlook (if I'm using outlook)?

Thx.

0 Kudos