10

Even simple HDL designs takes hours to synthesize, while compiling the Linux kernel on the same machine completes in under 15 minutes. Please explain why with a breakdown of the tasks the synthesizer has to carry out.

  • 5
    Why the close votes? The question seems broad but given a little understanding of the processes involved it is not complicated and can be answered in a few words. – RoyC Aug 19 '22 at 09:18
  • 1
    I'm usually trigger-happy with close votes, but I think this is on-topic, a question shared by thousands of EE professionals and students, and difficult to narrow down. An answer would help developers understand the process and possibly improve their efficiency. – pipe Aug 19 '22 at 09:31
  • 5
    It's a bit like saying "building a house takes longer than digging the garden so please tell me how to build a house". There are plenty of resources online to research both. – Finbarr Aug 19 '22 at 09:45
  • 5
    Before I started to write this comment, no specific reasons were added in comments as to why this couldn't be answered *to some extent* in a reasonably-sized answer. The fact that it was answered that way proves it was possible. Since we were getting flags regarding the closure of this question, and since the current answer shows an answer was possible, let's give this question a bit more of a chance to see if the OP's expectations were reasonable. (We still answer questions on Ohm's law here, where someone is stuck, despite there being many other resources about it!) So for now... reopened. – SamGibson Aug 19 '22 at 09:50
  • 1
    @SamGibson, my own close vote was the OP has just written a couple of lines that require a large amount of effort in return. English may not be the first language but *Please explain why with a breakdown of the tasks the synthesizer has to carry out* sends out that message. Examples of even cursory (Google) research would have benefited the question. Yes, it's answerable, and I know the answer clearly, but it would be a long answer to write. And I have to write much more because the OP has covered no ground at all themselves. Hence my VTC with the closest reason from the list. – TonyM Aug 19 '22 at 10:17
  • 1
    _"There are plenty of resources online..."_ is a weak argument. SE strives to be the first source of info when someone searches online for a question. This question complies with ["What topics can I ask about here?"](https://electronics.stackexchange.com/help/on-topic) and ["What types of questions should I avoid asking?"](https://electronics.stackexchange.com/help/dont-ask). And as @RoyC has shown, it can be answered within a reasonable scope. – Velvel Aug 19 '22 at 10:31
  • 1
    *SE strives to be the first source of info when someone searches online for a question* is not the held view of the community and should not be purported as the modus operandi of its members. It's alarming if that's your own view. In engineering, published datasheets, application notes, prior documented designs, other engineers on-project or within reach etc. should be the first resorts, and are for most engineers I've known, worked with and see here. Internet Q&A/discussion sites are one of the last resorts, as seen here over and over. My goals are reliable designs by resourceful engineers. – TonyM Aug 19 '22 at 11:54
  • 3
    This could well be an essay answer hence lack focus. Synthesis flow is an extensive topic whether in ASIC or FPGA. It is just like asking how does a C program compile. But yea it can also be answered in short points. But that doesn't change the fact that the question lacks focus or specificity. – Mitu Raj Aug 19 '22 at 12:17
  • 5
    @All - That's the end of the Meta comments allowed here. As mods are encouraged to do, I explained why I reopened the question. There are clearly differing views, but the fact that we got flags forced a binary open-or-closed decision to be made & I made it. It pleased some people, but not everyone. For further discussion, I recommend someone starts a Meta topic, stating your case (so it could start with a for or against question, depending on who starts it). || I have seen other examples where a Q looks like it would require a long A. Don't assume that! Sometimes an OP is happy with a short A. – SamGibson Aug 19 '22 at 12:33

1 Answers1

11

Compiling a kernel is a process which simply takes some source code and then linearly converts and links it as machine code.

Synthesis is a process which involves making multiple iterations of the synthesis process taking decisions at each stage as to whether the design meets the constraints set. In order to minimize area. For any reasonably large design this can take a long time.

The first stage of synthesis is to take your code and convert it to generic sequential gates and the combinational logic between them. This process is linear and fairly quick.

Then the tool minimizes the combinatorial logic it will take a number of passes at this until it has produced the minimum number of logic terms.

Now the real work begins, it has to implement the sequential and combinatorial logic in a form which minimizes area and still meets timing constraints for the particular library being used. This is a complex process and can take many iteration. If you manually try to work out all of the timing for say a 4 bit synchronous counter and then repeat that for every gate from a library you could use you will get some idea of the complexity of this process.

RoyC
  • 8,418
  • 6
  • 25
  • 40
  • 1
    "Now the real work begins, it has to implement the sequential and combinatorial logic in a form which minimizes area and still meets timing constraints for the particular library being used." If this is where the Lion's share of the time is spent can you explain what makes it slow? – Björn Lindqvist Aug 19 '22 at 15:20
  • 2
    Exploring large solution spaces usually can be parallelized well on some level, is it also the case for synthesis? Does modern synthesis software make a good use of the multicore processors we use? – jaskij Aug 19 '22 at 16:01
  • I'll also throw out that the more performance/size/optimization requirements needed, the more time it may take. Getting a processor to synthesize is "easy"... getting a processor to place & route so that the entire chip is fast enough to be competitive and small enough to be commercially viable and manufacturable is harder. – W5VO Aug 19 '22 at 18:51
  • 3
    Synthesis is also "simply" taking one form of describing a system and converting it to a different form. If you do not care about area, power, and timing, it can be done very quickly. The source of slowness is trying to optimize. The more you constrain, the slower it gets to find the increasingly more rare satisfactory solutions. The main question is why synthesis tools don't give you an option to be fully profligate with resources in order to get a quick turnaround. – Andris Birkmanis Aug 19 '22 at 18:52