Quantcast

problem for cpu.hdl

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem for cpu.hdl

weijia
This post was updated on .
remove code

I run the CPU.tst and it show Comparison failure at line 32.but I compare the value between the hardware and cmp file.They are all same. please help me if you have time.Thank you for reading!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem for cpu.hdl

cadet1620
Administrator
weijia wrote
I run the CPU.tst and it show Comparison failure at line 32.but I compare the value between the hardware and cmp file.They are all same. please help me if you have time.Thank you for reading!
Line numbers in error messages are often off by 1. That may be the case here.

The error is in the last line in the .out file. In your case your output ends:
|15  | 11111|1110001100001000|  0  |     -1|   1   | 1000|   17|     -1 |
|15+ | 11111|0000000000010101|  0  |   1000|   0   | 1000|   17|   1000 |
and the corresponding lines in the .cmp file are:
|15  | 11111|1110001100001000|  0  |     -1|   1   | 1000|   17|     -1 |
|15+ | 11111|0000000000010101|  0  |*******|   0   | 1000|   17|     -1 |
(The '***' means don't care.)

In the last line, your CPU changed the D register when it was not supposed to.
The instruction is an A-instruction (@21).
Why is D being loaded during this A-instruction?  Hint: look at what instruction bits are set for the binary value for 21.

[Please edit you post to remove the HDL after you solve your problem.]

--Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem for cpu.hdl

weijia
ok thank you very much
Loading...