Altera_Forum
Honored Contributor
18 years agohelp: where is "LE" or "LUT" component (or "how do I create my own components?")
I am a long time electronics designer and programmer who has managed to avoid FPGAs for a couple decades --- until now. I am designing a device with a small cyclone3 FPGA (EP3C5F256C8) and just started to create my design with Quartus2v71.
I chose to begin with schematic entry rather than HDL. I chose to start with the CRC32 part of my overall FPGA design, because the rest is less self-contained (but will probably be easier). First I designed an algorithm, wrote a C program to confirm it produces the correct results, then spent quite a bit of time reorganizing it until I found a way to implement it efficiently in hardware (only 2 levels of logic [delay] per clock cycle). Having already read (okay, some reading, some skimming) the cyclone3 and quartus2 documentation, I drew my schematic partly with in terms of components I expected to find in quartus2. To my shock and horror, the component I assumed would be easiest to find and most certain to exist --- seems to NOT exist. Specifically, I refer to that component called LE (logic-element) or LUT (16x1 lookup table) or LAB (16 LEs). After searching through the Quartus2 design functions/megafunctions dozens of times, I *still* cannot find any of these components. I am still not certain whether it is I who is stupid or crazy, or the designers of these tools (which mostly appear well designed, so "it must be me"). Though I tried to find creative ways to create a LE or LAB, I failed. For example, I tried to create a LE/LAB by creating a 16x1 ROM - but quartus2 assigned an entire M9k to simulate one utterly straightforward LE!!! Brilliant!!! Just not sure whether this refers to me or quartus2. The first question is, "so what?". Just create the schematic with the components provided and quit being a trouble maker. Oh, okay. So I split all those "logical components" into the "components provided by quartus2" (where "logical component" refers to any component that BOTH performs a logical function in my design AND can be implemented with one LE/LAB [per bit]). The result? The schematic that fit on one visible screen exploded into a monster 3 screens wide by 3 screens high! Furthermore, what was very neat and logical and comprehensible became an "unwieldy mess" - even though I tried very hard to prevent that from happening. This experience leaves me frustrated, so far. I figured "there must be a way for me to 'create components' --- essentially my own megafunctions --- which I could then insert into my original schematic". I still have a feeling quartus2 will let me do that, but so far I have not figured out how to do this. This message is not just to make you smile - by reminding you what it was like back when you first started designing FPGAs - though it may perform that function too. :o Rather, I hope someone will tell me where to find a LE/LUT/LAB component - to solve my problem. Or alternatively, tell me how to turn the components in my graph-paper schematics into components I can then insert into "readable" schematics --- the way I would repeatedly insert function calls into a program instead of repeatedly cut-and-paste big inline chunks of code all over my program. I keep thinking quartus2 must provide a way to create components like those in the quartus2 drop-down lists of components/functions, but somehow my reading/skimming always "misses it". So somebody tell me, "where is it"? Some people always demand examples (before they will help), so here is a typical one. In my hand-drawn CRC32 schematic, I have a component that is essentially a modified (special-purpose) "registered 2-to-1 multiplexer". That's what each LE would be, though the component on my schematic performs the same function on 32-bits (ie, two LABs): inputs = A, B (the two inputs to the multiplexer) inputs = S1, S2 (two selection inputs to the multiplexer) inputs = CLK (capture multiplexer output on positive edge) The CLK input cycles once as each byte is captured by the logic, and drives most of the CRC32 circuit. The clock also toggles a binary up counter, which starts at 0x0000 and increments after each input byte is captured. The 2 low bits of this binary counter are fed into the component as S1, S2. When S1,S2 = 0 or 1 or 2, the component simply passes input A to the output and captures it on the rising edge of CLK. When S1,S2 = 3, the component passes (A ^ B) to the output and captures that on the rising edge of CLK (where ^ means XOR). Simple. All this maps perfectly into one LE per bit (2 LABs for the 32-bits in my design). And frankly, I have no hope my CRC32 algorithm will compute the CRC32 at the minimum speed I can tolerate (100MB/sec = 100MHz CLK rate) unless the logic is packed efficiently into LEs the way I designed it (2 delays, one of which is asynchronous (flow-through) LE, and the other of which is to read one value from one M9k memory block configured as a 256 x 32 ROM). The above is pretty typical of the components I found convenient to put in my hand-drawn graph-paper schematics. I will admit I prefer to "know what I am doing", which is contrary to modern modus-operandi (namely "build upon the work of others", which I cynically refer to as "blindly compound the mistakes of others"). You might claim I apply the xfiles "trust no one" philosophy to my work. I happily admit this, and my only regrets have been those times I got lazy and suckered for the modern lazy "dark side" notion that I can produce good devices while not understanding huge parts of my designs. Thus, I have the very unpleasant feeling the answer to this post is, "why on earth would you want to design with the components actually IN the devices? Wouldn't you rather design with expensive black boxes that you won't be blamed for when they malfunction?". My reply is, "no, but you need not agree with me, and you need not design my way". However, since I do know what the fundamental components in the cyclone3 are, why on earth make it difficult (or impossible) to design with them? Every time an engineer designs with LE components, quartus2 need not grunt to figure out how to combine the scattered bits and pieces of a huge design, and quartus2 also need not wonder which parts of a design are important to "make efficient" (already made clear by the design[er]). Okay, I am prepared to be laughed at. After all, I'm a total newbie to FPGAs & Quartus. But please include the "why" for your advice/excuses/alternatives, so even this silly, hopelessly stupid, retrograde neandrathal can understand. Or --- you could just add LE & LAB to Quartus2 and pretend it was your idea! :rolleyes: I don't mind, as long as my designs get easier to create! Maybe I'll even stop avoiding FPGAs. Thanks in advance for all helpful responses. <bootstrap>