Altera_Forum
Honored Contributor
16 years agoHold time violations and clock distribution
Hello all,
I am working on designing a zero-operand stack machine in an Altera FPGA using the Flex EPF10k70Rc240-4 together with a custom memory simulator that includes a variable clock, which I've specified in Quartus Timing settings as having fMax of 440kHz, which is accurate for this clock. I'm using Quartus II 9.0 web edition. I have some major questions about timing issues, which I hope someone can help shed some light on for me. This is my first project using VHDL and an FPGA, so I'm coming from a beginner's perspective here. I'm getting the "Warning: Can't achieve minimum setup and hold requirement clock along 115 path(s)" warning when I compile. I've researched as much as I can in the Quartus II help as well as on the Altera forums and tried everything I can to fix the timing errors, but I must still be missing something--or the problem is simply inherent to my design, in which case I'm also not sure how to go about fixing it. Some more information on the specific problem: I activated the "Design Assistant" under Assignments->Settings->Design Assistant, and checked off all the boxes, hoping to get some insight into the timing (and any other) problems. Indeed, it gave me the following helpful warnings: critical warning: (high) rule c105: clock signal should be a global signal. (value defined:25). found 1 node(s) related to this rule.critical warning: node "clock"
critical warning: (high) rule d101: data bits are not synchronized when transferred between asynchronous clock domains. found 116 asynchronous clock domain interface structure(s) related to this rule.
critical warning: (high) rule d103: data bits are not correctly synchronized when transferred between asynchronous clock domains. found 42 asynchronous clock domain interface structure(s) related to this rule.
warning: (medium) rule d102: multiple data bits that are transferred across asynchronous clock domains are synchronized, but not all bits may be aligned in the receiving clock domain. found 4 asynchronous clock domain interface structure(s) related to this rule. As the first warning suggests (as well as a number of related Quartus Help pages), my clock signal seems to have a huge fanout since I have many different entities in my project, and this seems to be leading to massive clock skew and the corresponding timing problems. I wasn't sure how to make the clock a "global signal", but I followed some of the Quartus help guides and in the Assignment Editor, I made a new setting for the clock, where I set the "Auto Global Clock" option to "On". Quartus suggested that this should solve the problem. Unfortunately, that actually had no effect at all, so I tried option B--manually making the clock a "global signal" in my main package, taking the explicit port mapping of "clock" out of all of my entities and port maps throughout the project, and referring to the new "global signal" throughout (there is information on this on page 248 of Peter Ashenden's 'Designer's Guide to VHDL', which I followed). This was another option that the Quartus Help had suggested. Unfortunately, when I finally made all those changes, Quartus gave me the error: error (10808): vhdl error at vds.vhd(112): unsupported reference to global signal or variable clock
I looked further into this on the web and in the Altera forums, and it appears that global signals are actually not supported for synthesis (despite the fact that Quartus itself suggested I make the clock a global signal....). Huh. As far as I can understand, then, it seems that what I'm left with is a clock with a huge number of fanouts that essentially renders the project asynchronous since the clock signal is arriving at different places at different times--and no obvious way to resolve it. I may be misinterpreting the problem, of course (which is hopefully the case, and hopefully the solution is easier than redesigning / scrapping the whole project). I've attached the entire project as a Quartus archive (.qar) file, as well as attaching a few of the main .vhd files separately for those who aren't running Quartus right on their desktops at the moment (ST0.vhd is the main project file; TOP_LEVEL.vhd describes the top level of the datapath; VDS describes the virtual data stack logic...). Apologies for lack of comments in the files--I've redone the design so many times that I got lazy about commenting the last time around. I'll fix it when I have a working design... Any insights would be GREATLY appreciated, and many thanks in advance. Robert