ComputerRect.tst failing

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ComputerRect.tst failing

Shmeegoose
My computer implementation passes all other Computer tests. It also passes the external version of ComputerRect.tst althought doesn't actually display anything. From browsing around through other posts I noticed that there may be updated versions of the CPU and Memory tests I should run which may catch corner cases.

It fails on line 5 and when I look at the ComputerRect.out it shows that the DRegister reads 0 when it should be 4, other than that everything is correct.

I didn't want to post code without first getting permission. Let me know if I should post my Memory and CPU code or email it somewhere. Thanks! Having an absolute blast with this course. Been recommending it to everyone.
Reply | Threaded
Open this post in threaded view
|

Re: ComputerRect.tst failing

WBahn
Administrator
The first step is to be sure you understand (and agree with) the test. Look at the test script and start with the inputs that determine the results on line 5 and walk through what the outputs should be (based on the specified behavior) for the D Register. Do you agree that it should be 4. Now walk through your design, very carefully and deliberately, and see if you agree that it is actually producing a value of 0 instead. Now you are in a position to consider why it should be 4 and why it actually is 0.
Reply | Threaded
Open this post in threaded view
|

Re: ComputerRect.tst failing

Shmeegoose
Thanks for the reply!

After holiday break I'm back to wrap this up.

I was able to resolve the issue. It turned out that the load signal for my D register wasn't configured correctly.

I recommend adding a test case to the CPU.tst that exercises the D register load logic in greater detail to catch this issue before seeing the failure at the computer level. Though it does make for a fruitful debugging exercise.
Reply | Threaded
Open this post in threaded view
|

Re: ComputerRect.tst failing

nblackburn
In reply to this post by WBahn
I just had the same issue and the problem was also my D register's load signal in my CPU implementation. However I still do not understand how to look at the test script and see what the outputs should be. Could you please elaborate further? I wish to understand how to debug this problem using your post!