Re: [Gems-users] (no subject)


Date: Tue, 31 Mar 2009 20:47:10 +0800 (CST)
From: itecgo@xxxxxxx
Subject: Re: [Gems-users] (no subject)
 Hi, lenglihello,

I've got what you meant.

Instead of a Shell script file, you can create a Python script file like run.py, and put the following lines in it:

import time, string, sys, getpass, os

from cli import *

import sim_commands

sys.path.append('/yourpathtogems/gen-scripts')

import microbench, workloads, mfacet
import mod_xterm_console_commands

//... other code

mfacet.run_sim_command('istc-disable')
mfacet.run_sim_command('dstc-disable')

//... other code

and then from Simics command line, you can type  run-python-file('./run.py')  to run the above Python script.

good luck.
 
 > -----原始邮件-----
> 发件人: "Greg Byrd" <gbyrd@xxxxxxxx>
> 发送时间: 2009年3月31日 星期二
> 收件人: "Gems Users" <gems-users@xxxxxxxxxxx>
> 抄送: 
> 主题: Re: [Gems-users] (no subject)
> 
> Those are simics commands, not python. You need to "include" or
> "run-command-file." Anything that you can type directly to the Simics
> console is a simics command.
> 
> 
> 
> lenglihello wrote:
> > hi,
> > I tried the method as you said, but failed.
> > the error code is :
> > **************
> > simics>run-python-file run.py
> > filename.sh: line 4 istc-disable: command not found
> > filename.sh: line 5 dstc-disable: command not found
> > ......
> > **************
> > It is the same error as before
> > 2009-03-31
> > ------------------------------------------------------------------------
> > lenglihello
> > ------------------------------------------------------------------------
> > *发件人:* itecgo@xxxxxxx
> > *发送时间:* 2009-03-31 18:44:40
> > *收件人:* Gems Users
> > *抄送:*
> > *主题:* Re: [Gems-users] (no subject)
> > Well, as i know, you can run Python files from the Simics command line
> > using "run-python-file(..)", and you can execute shell command in a
> > Python file using "os.system(..)".
> >
> >
> > 在2009-03-31,lenglihello <lenglihello@xxxxxxx> 写道:
> >
> >     -- ---原始邮件-----
> >     *发件人:*lenglihello <lenglihello@xxxxxxx>
> >     *发送时间:*2009年3月31日 星期二
> >     *收件人:*GEMS_USERS <gems-users@xxxxxxxxxxx>
> >     *主题:*[Gems-users] (no subject)
> >
> >     Hi everyone,
> >     I have a small trouble when using simics. I failed when I try to
> >     "./filename.sh" or "sh filename.sh" under "simics>"
> >     How to execute shell script after simics is running?
> >     Any reply is appreciated.
> >     2009-03-31
> >     ------------------------------------------------------------------------
> >     lenglihello
> >
> >
> >
> > ------------------------------------------------------------------------
> > 网易邮箱,中国第一大电子邮件服务商 <http://email.163.com>
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Gems-users mailing list
> > Gems-users@xxxxxxxxxxx
> > https://lists.cs.wisc.edu/mailman/listinfo/gems-users
> > Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.
> >
> >   
> 
> _______________________________________________
> Gems-users mailing list
> Gems-users@xxxxxxxxxxx
> https://lists.cs.wisc.edu/mailman/listinfo/gems-users
> Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.
> 



网易邮箱,中国第一大电子邮件服务商
[← Prev in Thread] Current Thread [Next in Thread→]