Need some help with troubleshoot my CPU design.

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

Need some help with troubleshoot my CPU design.

LearnCS
Hi guys,

I would really appreciate it if someone could help me troubleshoot my CPU.
I always got a comparison failure at line 32.

My implementation is basically as follows:
I used some Mux16 and Mux to distinguish between A and C instructions and then feed the output to A-Register.
Then, pretty much the same thing for D-Register.
Now, I have the input for ALU and I match the control bits with the right instruction bits if it is a C-instruction.

(I think I did something wrong here in the following part)
I used And and Not gate to make sure the ALU output matches the right condition.
Then I used OR8Way to get my load bit for C-Instruction. And Mux(a=false, b=...) to get the final control bit.

Here is the output I got and I compared it with the .cmp and found no difference so I assume something subtle.


I hope that is enough information, else I can send my code.
Please Help, thanks ahead.
Reply | Threaded
Open this post in threaded view
|

Re: Need some help with troubleshoot my CPU design.

WBahn
Administrator
Let's start with the error and go from there.

You say that you get a comparison failure at line 32.

Look at line 32 in the comparison file and your output file. What is different between them? That is where you need to focus your attention.
Reply | Threaded
Open this post in threaded view
|

Re: Need some help with troubleshoot my CPU design.

LearnCS



Sorry, I am not sure if I am doing it right.
But, I compared it several times and couldn't figure out what is the difference.
The OutM[16] is **** so it doesn't matter.
Then writeM is 0, addre is 1000, pc is 17 which are what I got.
Did I miss anything?

Thank you for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Need some help with troubleshoot my CPU design.

WBahn
Administrator
That first image appears to be from the .cmp file.

Isn't there another column in the file for the D Register

We need to know what the corresponding contents of YOUR .out file is.


Reply | Threaded
Open this post in threaded view
|

Re: Need some help with troubleshoot my CPU design.

LearnCS
Thank you very much!
I was stupid enough to look at the CPU-external.cmp instead of the CPU.cmp and spent hours trying to figure out the difference when the difference is in the column D-Register.

I now get my CPU passed the test.
I really appreciate your reply right before New Year. Best New Year gift!

Happy New Year to you and all the others!!!

I am not sure if this is the right place to say this.
But this course is great and challenging which makes me want to punch through my monitor sometimes and makes me so satisfied all the other time.
Thank you to everyone who stood behind this course and help us voluntarily.