CPU outM problem

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

CPU outM problem

Nick
I'm trying to implement the CPU.  I'm pretty close to finished, but I keep getting an error at line 33.  I can see that the outM is producing a 0 instead of a 21.  After that it looks to me like the following instructions are calculated correctly, but since they are calculated from the value 0 instead of 21 they are incorrect.  Anyhow, I have a feeling that it has something to do with the ALU output during an a-instruction.  Since I load the instruction values in directly to the ALU it may be processing values and loading them into the D-register automatically.  If this makes sense, can you tell me if my gut feeling is correct.  I'm really having difficulty seeing this problem clearly.  I've tried to make the ALU work only during a c-instruction but with little avail.  Thanks for any help.
Reply | Threaded
Open this post in threaded view
|

Re: CPU outM problem

cadet1620
Administrator
It sounds like you are using the CPU-external.tst file.

The problem is that the CPU-external.cmp file that's on the site appears to be an old version.  If you look at the CPU.cmp file you will see that on line 33, and a lot of others, outM is ******** meaning that it's value is undefined.

This happens because the output of the ALU is irrelevant during A-instructions, and in fact can be different depending on how you implement your control circuitry.

Use the CPU.tst file instead; it's also a better test since it also tests the D register.


Here are updated files it you want to try them:
    CPU-external.tst
    CPU-external.cmp

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: CPU outM problem

Nick
Thanks for the reply.  I just tested the file using the .tst and it says, "No such built in chip used: D Register."  I'm a little confused by this.
Reply | Threaded
Open this post in threaded view
|

Re: CPU outM problem

cadet1620
Administrator
Use the parts ARegister and DRegister in place of Register in your CPU.hdl. They have special interfaces that the simulator can use to show and test their content.

--Mark