Hot answers tagged

23

A colleague of mine benchmarked this and came to the conclusion that FPGAs would outperform a PC once you had more than about 100 independent, integer tasks that would fit in the FPGA. For floating point tasks GPGPU beat FPGA throughout. For narrow multithreading or SIMD operation then CPUs are extremely optimised and run at a higher clock speed than FPGAs ...


19

An FPGA works completely differently from a processor. For a processor you write software that tells the hardware what to do. On an FPGA you describe "what the hardware should look like" internally. It is as if you are making a chip specially made for your algorithm. This speeds up a lot of things and can bring down the power consumption. But it has its ...


13

It depends a lot on the algorithm, but the principle can be explained quite simply. Suppose that your algorithm has to sum a lot of 8-bit numbers. Your CPU will still need to fetch each instruction, get the operands from the RAM or the cache memory, execute the sum, store the result in cache, and go on with the next operation. The pipeline helps, but you ...


7

Without the code, you can only expect general advice. However the most likely scenario is that the outputs don't actually depend on the inputs, so that optimisation eliminates all the logic in between them and hardwires the outputs to '1', '0' or 'Z'. This can often be due to a mistake in your logic, or a reflection of the fact that you are trying out an ...


7

There are two ways of doing it. 1. Pin Planner The first approach is in the Pin Planner tool. This is the GUI that allows you to select which pin goes where. From the main window with your project open, go to the Assignments menu and select Pin Planner (or press Ctrl+Shift+N). In the pin planner window, in the All pins view at the bottom, right click on ...


6

A divider is a series of subtractions and multiplexers that select the value for the next step. If it is done purely combinatorially, then the critical path through all of this logic is quite long (even with carry lookahead on the subtractors) and the clock cycle must be very slow. But the process is easy to pipeline, and the number of pipeline stages you ...


6

There are roughly 3 levels of specialization of computing equipment: CPU (like in your laptop) is the most generic of them all. It can do everything, but this versatility comes at a price of slow speed and high power consumption. CPU is programmed on the go, the instructions come from RAM. Programs for CPU are quick, cheap and easy to write and very easy to ...


6

Add this tcl expression... set_global_assignment -name NUM_PARALLEL_PROCESSORS 4 ... to either assignment_defaults.qdf or the .qsf file. Both should be in the project's directory. The .qdf file may need to be created.


5

Yes, FPGA can outperform modern CPU (like Intel i7) in some specyfic task, but there are easier and cheaper methods to improve neural network performance. By cheaper - I mean total effort, not FPGA IC cost, but also very fast memory for FPGA (you would need it for neural network) and whole development process. Use SSE - I've seen pretty simple neural ...


5

For primitives, absolutely no benefit performance wise. The only use is it means you don't need to create files with your own primitives in, but if you rely on the Altera ones then migrating to something from another manufacturer would be harder. Some things like FIFOs may contain Altera specific inline timing constraints or other synthesis directives for ...


5

Just connect it up directly with a wire (you will see a little blob appear to show it is connected). Then, name the bus something like name[msb..lsb], and then name the wire name[whichbit]. That will tell Quartus to connect them because they both have the same name and tell it which bit it should connect to. You will get errors if you choose a whichbit which ...


5

I suspect the difference is due to the negative coefficient in the 2nd case (according to the order of your diagrams). Because your multiplying coefficients are all powers of 2, your multiplies can all be done by simple bit selects. For example, assuming you're doing 16-bit math, x*0.25 can be calculated as simply {2'b0, x[15:2]} (using Verilog notation). ...


4

Your schematic shows a T-type flip-flop, which toggles when its input is high. Your rtl code, on the other hand, implements a regular D-type flip-flop. Your module should instead read: always@(posedge clk, negedge clr) begin if(~clr) q <= 1'b0; else q <= q ^ t; end By XOR'ing the output with the input, you will toggle the ...


4

You can use the memory IP cores to create a memory with initial mif content. You can check the IP core user guide for more information. Another solution is to use VHDL attributes to initialize the content of your variable. You have to be confident that your code is indeed interpreted as a ROM by altera, otherwise the attribute will be ignored. This is the ...


4

It is not an 'error' to sample data from one clock domain in another. Quartus will not prevent you doing it at design entry/synthesis stage. When you later run timing analysis with quartus_sta you will find that the register path between the two clocks (if truly different) is unable to make timing. You are running timing analysis, right?


4

Seeing that you're using a Lite version of Quartus, maybe you don't actually are interested in Altera synthesis, but more in general Verilog analysis and clever code optimization. You might want to have a look at Yosys, which supports generating the graphs I think you want, is free, much easier on your RAM and CPU than Quartus and frankly, produces better ...


4

The difference between the two is not that compilation broke your design, but rather the first case is an RTL simulation (i.e. everything is ideal), whereas the second case is a Gate-Level simulation, which factors in the propagation delays estimated for the actual real implementation. Your circuit design works in the ideal case, however once you factor in ...


4

TL;DR; The answer may depend on the synthesis tools, but most likely the answer is no unless you use randomised seeds. Certainly for modern versions of Intel/Altera Quartus (since some time before 12.1), if you compile the exact same source files using the exact same software version (including subversion/patch level) for the same device, you will get the ...


4

Your switches will be active low (i.e. zero when pressed). Your LEDs will also be active low (i.e. zero will turn them on). If you invert the inputs and output of an AND gate, you get an OR gate, hence the behaviour you are seeing. There is nothing wrong with the FPGA.


4

Yes, there is "bouncing" — but in this context, we call them "glitches". The comparator (count > 26'd24999999) represents a rather large amount of combinatorial logic, and there's no chance that all paths through this logic (and the associated FPGA interconnect) will have exactly the same delay. Therefore, the output pulse will experience one or ...


3

you check the warnings when you are compiling your code. Mostly synthesis issuses can be solved if you correct those warnings.


3

The question doesn't contain near enough detail, so I'm mostly making assumptions here... Carry in is an input. I suspect you stop driving the carry-in input (so it "floats") when you switch to addition mode. There is a good discussion of this issue here.


3

I usually synchronise my async reset through a delay line of a few flipflops (relying on the FPGA configuration to have cleared them), and only use that synchronised reset (even if I'm using it as an asynchronous reset). In Xilinx-land, the tools can trace the timing through from the clock used in the delay line to the reset input (either sync or async) ...


3

Metastability? Highly unlikely. Unsynchronised inputs? Very probable and they can cause the symptoms you describe. So clock each SPI input from your fast clock, and route the clocked versions to the SPI core. (Unless you're already certain that it reclocks them already).


3

Use the "Netlist Viewers" in the "Tools"-menu. The RTL-Viewer creates a hierarchical expandable diagram. Layout can be horrible at times.


3

A safe state machine in Quartus is a state machine that if it reaches an illegal state (for any exceptional reason, such as glitch, metastability, etc.), it will reach the reset state after one clock cycle.


3

The reason for the latches is due to the fact that the outputs of your case statement are not assigned for every possible case selection. So you have created a storage element without a clock - which is the definition of a latch. What is ledOut when pr_state is state_Rx? It's not specified by your case statement, so the synthesizer assumes it needs to hold ...


3

From Modelsim, you should easily be able to click on the module that you want (Circle 1) and in Objects window (Circle 2) you will be able to see the signals within that module and you can then easily drag the signals you want to the Wave window. You shouldn't have to create IO ports just to view the signals on Modelsim.


3

I'm not a VHDL guru, but I think your comment -- increment index by one (automatically overflows back to 0) is misleading, and you have to explicitly reset the index after 12.


3

Quartus is synthesizing a separate mux for each bit of your output vector. The eight inputs to each mux are bit \$N\$ from each of the eight inputs. The output of each mux is bit \$N\$ of the output. The use of buses and ripping individual signals from each bus can be a little confusing and hard to read.


Only top voted, non community-wiki answers of a minimum length are eligible