Altera_Forum
Honored Contributor
12 years agoDesign Stops Working When Modifying Unrelated Code
Hey there,
I am experiencing some very strange behaviour with the FPGA implementation of my VHDL project. What I am designing is an implementation of an old 8-bit CPU. I have created it such that it fetches instructions from the internal memory on the FPGA, and cycles through them until it runs out of instructions. I have also implemented a reset sequence such that the implementation first fetches the lower 8 bit value of the program counter from a memory address, fetches the upper 8-bit value from the next sequential address, then fetches the first instruction and proceeds from there. What I have begun to discover, is that if I modify a very small section of my project (a section that should not affect the instruction decoder that runs the reset sequence), I find that it prevents my program counter from incrementing, which means it cannot fetch the upper 8-bits of the program counter from RAM, which in turn stops the CPU from fetching any instructions. I am therefore asking this question: is it actually possible for this to happen simply from commenting out a line of code which is not related to the thing that breaks? I'm really asking this question as a general question, but I'm happy to provide extra information as required. The code I happen to be commenting out is a line inside my ALU. The ALU is only connected to the instruction decoder via a signal which contains the flags of the CPU, but the instruction decoder currently does nothing with them. Here's the list of specific hardware/software I'm using: Quartus II 12.1 SP1 Altera DE1 Board (with Cyclone II EP2C20F484C7) Other details: I'm running the VHDL project on the DE1 board, but I have slowed the 27MHz clock down to 1Hz so I can visibly see what is happening. I use the 7-segment displays and LEDs to view various internal signals, and control the clock speed and other inputs from the toggle switches. I trigger the reset sequence from one of the blue pushbutton switches. I'm also using the internal memory of the FPGA as RAM (I added a 1 port LPM RAM device to my project using the LPM plugin manager), and my CPU program exists in there. I was thinking initially that maybe with the modifications of the code, the Quartus fitter/assembler is allocating a different region of space inside the FPGA, and somehow a section of that space becomes overwritten or corrupted by something. How, I have no idea. Could it be related to me using internal memory inside the FPGA? As a side note, I have a lot of warnings when I compile the project, which are related to different things, but I have noted that it mentions in the timing analysis that my "setup and hold times are not constrained for the design". Could there be a problem related to the timing of the circuit? Please give me some possible reasons why this could be happening.