|
|
Like others before me, I am getting the 'circle in its parts connections' error when trying to run my Computer.hdl through the hardware simulator.
After perusing these message boards, it seems that the cause of the issue is that there is a fully combinational feedback loop somewhere. The problem is finding out exactly where that loop is. After drawing things out, my suspicion is that it is related to the CPU's inM, outM, and writeM ports. However, the
comments in the CPU.hdl file specifically state that outM and writeM are to be combinational. Besides, the outM of the CPU would go through the memory (which is registered) before coming back to the inM input of the CPU.
I understand the prohibition against posting working code to the forum for others to copy, and I also can't stand it when people say 'I have a problem; somebody fix it for me.' Short of doing that, I feel I am stuck and not sure exactly how to proceed. Does anybody have any suggestions on how to pinpoint exactly where the issue might lie? Has anybody yet come up with a schematic viewer for the N2T HDL? :)
Thank you in advance for your help.
|
Administrator
|
Go ahead and post your code. We'll delete it once the issue is resolved.
|
|
This post was updated on .
Sounds good. Thank you. Here you go:
Edited to remove my code.
|
Administrator
|
Your code is needlessly complicated.
I'll give you some suggestions on how to clean it up when I get a chance, hopefully later today.
It would be nice if the simulator gave at least the name of one signal that was involved in the loop, but it doesn't.
In the meantime, try the following. Save your parts with a different name (or move them to another folder) and start with the original .hdl files for this project. Then add your code to the Computer chip and see if it loads. If it does, then add your parts for the CPU chip and see if the Computer still loads. If it does, then add your parts for the Memory chip and see if the Computer still loads. At whatever point it fails, that gives you a clue as to where the problem is.
Remove all of the connections from your Computer chip so that it just contains the parts
Let's say that it's the Memory chip that results in the error. Go into your Computer file and for every input on the Memory chip, set it to 'false'. That should break any loops involving this chip. Now go back to the original code and set each input, one at a time, to 'false' and not which ones make the error go away. These are the signals that are involved in the loop -- there may be more than one that work together to form the loop.
Let's say that you discover that setting either the 'in' or the 'load' signals on the Memory chip to 'false' lets the Computer load. This means that these two signals, working together, have the ability to combinatorially drive the 'out' output (since this is the only output and must therefore be involved in the loop between the CPU and Memory).
|
|
Thank you very much for these suggestions. I will give them a try.
I really appreciate your help.
|
|
So, it appears as if the output of memory driving the inM input to the CPU is the connection that is causing problems.
Within the CPU, the path from inM to outM is fully combinational, but this is (I believe) expected and desired. It goes through the Mux16 to the Y input of the ALU, and then the output of the ALU drives the outM of the CPU (as well as also feeding one of the inputs of the Mux that selects what is loaded into the A register).
Within the Memory, there is also combinational logic driving the output of the memory, but only because we have to select among the outputs from the data memory (RAM16K), Screen, and Keyboard.
None of this seems needlessly complicated or incorrect, but I open to learning where I have gone wrong.
Thank you again for your help and suggestions.
|
|
I had incorrectly thought that the specs mentioned that we needed to mask the memory output if an invalid address was encountered. Once I removed the logic that forced the memory output to 0 with an invalid address, my problem went away.
Thank you very much for your help and the debug tips.
|
|