PDA

View Full Version : Having Trouble Getting My Homework Assignment to Run




PerfectJudgment
Apr 24, 2009, 04:36 PM
My assignment is to write the core part of a mini processor simulator called MinSPIM using C language. The simulator should read in a file containing MIPS machine codes and simulate what the MIPS does cycle-by-cycle. Included in the instructions are steps to run the simulator:

"For your convenience, here is how you could do it in UNIX environment. First compile:

$ gcc -o spimcore spimcore.c project.c

After compilation, to use MinSPIM, you would type the following command in UNIX:

$ spimcore <filename>.asc

The command prompt

cmd:

should appear."

Given the instructions, I figured I should use the Terminal to compile the project. The project compiles just fine, but when I enter the second command, "$ spimcore <filename>.asc" the output says, "-bash: spimcore: command not found" instead of displaying the command prompt. Any ideas what I'm doing wrong?



misterredman
Apr 24, 2009, 04:41 PM
Seems like you need to specify where to find the file, since it is not in one of the standard path. Try this:

$ ./spimcore <filename>.asc

lee1210
Apr 24, 2009, 04:41 PM
The instructions make the (poor) assumption that . is in your path. If you run ./spimcore it should run (if it compiled properly as you stated).

-Lee

PerfectJudgment
Apr 24, 2009, 05:04 PM
That did it. Thanks guys!