Cell Simulator |
|
NOT DONE YETSo far all the programs we have run are under "Linux mode". When you click the 'Go' buton the simulator loads up a basic Linux environment and then you run your program. In this tutorial we will go over how to run a program without loading up a Linux environment. In the directory where you run '../run_gui' if you open up '.system.tcl' you will see the startup TCL script for Mambo. Luckily that script is nicely commented, but for completeness I'll post it here:
#------------------------------------------------------------------------
Notice that the linux kernel and system are already set up for you. Just so you know you are looking at the proper script, add The simulator should atomatically load up the Linux environment, as if you actually pressed the 'Go' button from the GUI. Be sure to remove your addition before continueing.
Your current directory should be something like: '(MAMABO_DIR)/systemsim-cell/run/cell/linux' change to '(MAMABO_DIR)/systemsim-cell/run/cell/standalone'. If you run the program '../run_gui' then the program will come up, but hitting 'Go' will have simulator simulate essentually nothing. Anyways stop the program. To run a program the simulator must load an SPU with a simple SPU program. Luckily the helloworld example provides these. At the command prompt (in the terminal where you started Mambo, type in 'mysim spu 0 load (MAMBO_DIR)/Code/helloworld/spu/hello_spu'. Now type in the command 'mysim go'. The simulator will pause for awhile then come back with something like 'WARNING: 19740800000000: No processor activity for 3 seconds If you remember, the hello world program actually put "hello World onto the screen". Unfortunately, the simulator is can't do that in standalone mode. So how do you check it worked? Well, in in the GUI, expand the SPE0 tree, then double click on 'SPU Core'. UP come the register values. Notice they aren't 0 (whihc is the default). Unfortunately, this is all you know for right now. Basically, that something did work. The next tutorial will go more in depth about the GUI TCL scripts and working with standalones. |