0

eval_cli_line("cache_%s" % cpu.name + ".ptime") in my python script is constantly giving the following error

NameError: global name 'eval_cli_line' is not defined

Any suggestions ?

nneonneo
  • 171,345
  • 36
  • 312
  • 383
  • 2
    Yes. Read the error message. `eval_cli_line()` is not defined. It's like if I told you to "frobnozzle the porcupine." Unless I define what "frobnozzling" is to you, you would be unable to understand the command, and the porcupine would remain unfrobnozzled. – Joel Cornett Oct 21 '12 at 04:36
  • Are you using `Simics`, by any chance? – DSM Oct 21 '12 at 04:37
  • Where is `eval_cli_line` defined? – Keith Oct 21 '12 at 04:38
  • Yes I am trying to use it in a python script and running it through simics. – user1762573 Oct 21 '12 at 04:41
  • I thought eval_cli_line is a pre defined function and I am possibly missing an import – user1762573 Oct 21 '12 at 04:42
  • This is probably a good question to begin asking by using your friendly search engine. I looked at your question and used Google to search for eval_cli_line and figured out right away that it was an import error. The first commenter in this list is trying to tell you that but I really think it could have been done more politely. This is a great place to find answers but a lot of folks expect you to have done some research first. – PyNEwbie Oct 21 '12 at 22:09

1 Answers1

1

In Simics 4.x, eval_cli_line has been replaced with run_command(). Read the migration guide.

jakobengblom2
  • 5,531
  • 2
  • 25
  • 33