CPU D Register Issue

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

CPU D Register Issue

capt_calculator
While testing my current CPU implementation with CPU.tst, I am getting a compare error on line 32. The compare file indicates that the output of DRegister should be -1. My output shows that my DRegister output is 1000, while at the same time the "internal pins" section shows the output of my DRegister as the correct -1. Im confused by this. Everything else appears to be correct. What am I missing?

Reply | Threaded
Open this post in threaded view
|

Re: CPU D Register Issue

cadet1620
Administrator
This can be a bit confusing.

I think that during time 15+ DRegister is showing the internal state of the D register. This value wont appear on the DRegister out pins until time 16.

It appears that the @21 instruction is causing DRegister's load to be true. It's suspicious that if you look at the @21 instruction as if it where a c-instruction, it would have the dest-D bit set.

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

Re: CPU D Register Issue

capt_calculator
I see what you are saying. Is this a result of the fact that I am using the built-in DRegister? Would this also occur if I used my own DRegister implementation instead?

Yes, it turns out that I was just missing a piece of logic for the DRegister load bit. I have fixed it and successfully reached the end of the CPU test script.

Thanks for your quick reply!!

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

Re: CPU D Register Issue

cadet1620
Administrator
Yes, this is because you are using the built-in DRegister.

If your CPU.hdl had its own implementation of the D register you would need to use the CPU-external.tst file. This test does not show the D register contents since it doesn't know what name the student's HDL will use for the D register output.

--Mark