CS552 Course Wiki: Spring 2016 | Main »
Test Programs FAQ |
Tasks |
On this page... (hide)
1. Can I make assumptions about the prior values in registers for my test programs?You may not make any assumptions about the values in the registers. You should explicitly clear them all as the first thing you do in your program. Using andn to clear them to 0 is fine. Or you can use the lbi instruction to set them to a constant. 2. How do I set the path properly to execute wsrun.pl - the command line tool to verify project demos?To use the assembler and the command-line simulation script, you must add the following line to the end of your .bashrc.local file: set path = ($path /u/k/a/karu/public/html/courses/cs552/spring2013/handouts/bins) 3. How to interpret immediate and displacement field for branch instructions? Should I shift left by 1?Clarification on the immediate field for branch instructions (beqz, bnez, bltz, bgez, j, jr, jal, jalr) You MUST NOT shift the immediate field by 1. I know this is slightly counter-intuitive, but the simulator already implements this semantics and these are semantics in the ISA spec. so we will stick with it. For example, see beqz_0.asm: lbi r0, 0 beqz r0, 4 lbi r0, 1 lbi r1, 1 lbi r2, 1 lbi r3, 1 Its .lst file: 0000 c000 lbi r0, 0 0002 6004 beqz r0, 4 0004 c001 lbi r0, 1 0006 c101 lbi r1, 1 0008 c201 lbi r2, 1 000a c301 lbi r3, 1 The conditional branch is taken and PC will be set to: 0x0002 + 2 + 4 == 0x0008 NOT 0x0002 + 2 + (4 << 1) == 0x000C Similar semantics applies for all conditional and unconditional branches. If your immediate or displacement field in the assembly program ends up being an odd number, then you will get an unaligned access error from the simulator and from the memory module. 4. How can I run multiple programs on my processor one after another?See below. 5. I want to run all the inst_tests programs?See below. 6. What is the
|
Page last modified on January 23, 2013, visited times |