Difficulty with ComputerRect.tst

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

Difficulty with ComputerRect.tst

Jonathan Katz
Some strange behavior...of course, always a chance that it is a problem with my program but I figure I'd check to see of anyone else is having similar issues.

I built the CPU and Memory and they tested fine. I built the Computer chip and it tested fine using ComputerAdd.tst and ComputerMax.tst. But it failed with ComputerRect.tst. Surprisingly, it passed using ComputerRect-external.tst.

Also, for some reason I am not getting GUI side effects when I run my Computer chip.
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

Jonathan Katz
Some more strange behavior...

When I load ComputerRect.tst and run it (using the double-right arrow) I get an error in line 64.

When I run ComputerRect.tst one step at a time (and/or one clock tick/tock at a time), I get an error at an *earlier* line...

What could possibly explain this behavior?
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

Warren Toomey
First up, I've got Computer.hdl working with all the project 05 tests. Could you have modified some of the .tst or .cmp files in the project? This bit me when I was writing the compiler: I modified some of the test files, and even when I did have a working version, the tests kept failing.

The Computer.hdl file is probably one of the simplest and shortest HDL files, given a working ROM32K, CPU and Memory chips, so the problem might be elsewhere than in Computer.hdl.

In terms of display of the screen, do you have View: Screen set on the right-hand side of the main toolbar?

I don't have any ideas w.r.t. errors at different line numbers; hopefully someone else will chime in with suggestions.
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

Jonathan Katz
In reply to this post by Jonathan Katz
I found the bug in my program (it was in CPU.hdl) and was able to pass the ComputerRect test. =)

Anyway, I had always assumed my program has a bug; my questions were more about the strange(?) behavior of the testing code -- errors at different lines, error in ComputerRect.tst but not ComputerRect-external.tst, etc.
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

irit
i allso have problams that i can't figure out
can you say whare was yout misstakes ?
it can give me a hint what is wrong with my code ...

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

tolatiger
In reply to this post by Jonathan Katz
I got the same results as yours. After checking all the chips I built in chap 5, I found the only reason is that
I used a non build-in element in my Memory.hdl
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

datahaven
I had a similar issue myself - all tests passing (including ComputerRect-external.tst), apart from ComputerRect.tst which failed.

Turned out to be a fault in my Memory.hdl code, which I discovered by viewing the asm in the Hardware Simulator and single stepping through it up to the point of failure where -1 was being incorrectly written to RAM[0]

So, here's a little warning relating to that - the test file for Memory.hdl did spot my problem but what you need to watch out for is that when the test says "Make sure that you see two horizontal lines in the middle of the screen." it means make sure you see the two horizontal lines on screen and nothing else!

Adrian
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

fabiog
Same problem here with error at line 64..  that is, at time 62 the PC jumps to 10 instead of going to 23.

Can't figure out what's wrong, I will review the jumping condition... any help is appreciated!

Am I maybe missing chips? I'm using 1 ALU, 1 PC, 2 Registers, 2 Mux16, 2 Not, 3 Or, 6 And, 1 Nand
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

cadet1620
Administrator
I just added some tests to Memory.tst to check for common problems with the load inputs to RAM16K and Screen.
    Memory.tst
    Memory.cmp

Please try them out on your Memory.hdl. Let me know if they catch a problem or not.

If you want, you can email me your Memory, CPU and Computer HDL files and I'll be happy to take a look at them.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

aexpert999
I have modified the memory implementation after this new test file was posted and it turned out the Computer.hdl passed all the tests.The weird thing is that Memory.hdl won't pass the new test file,even though the Computer does pass the tests!I have emailed you my Memory.hdl code,because I can'ty find the bug,I would appreciate an answer.Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

cadet1620
Administrator
aexpert999 wrote
I have modified the memory implementation after this new test file was posted and it turned out the Computer.hdl passed all the tests.The weird thing is that Memory.hdl won't pass the new test file,even though the Computer does pass the tests!I have emailed you my Memory.hdl code,because I can'ty find the bug,I would appreciate an answer.Thank you!
I got a look at aexpert's Memory.hdl. Apparently none of the computer tests need to read from the Screen.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty with ComputerRect.tst

mcdon.ron
In reply to this post by fabiog
I Had the issue that fabiog describes where at time 62 the PC would jump to 10 instead of 23.

The problem turned out to be the jump condition in my CPU.  Rect.hack line 22 in assembly is "D;JGT".  My CPU failed to jump when D was greater than 0.

I forgot that x>0 is equivalent to !(x<0) && !(x=0).  Previously I was only using !(x<0).