Forum Discussion
KennyT_altera
Super Contributor
9 months agoI’m truly sorry to hear that you're unsatisfied with the answer.
Unfortunately, without access to the design, it will be challenging to narrow down the issue precisely. However, here are some additional key considerations that might help you troubleshoot the increased M20K usage:
Understanding Device-Specific Fitting Differences
Different Architectures Affect Fitting Strategies:
- M20K Usage Variation:
- The way Quartus utilizes M20Ks is device-specific and influenced by the internal architecture of the target FPGA. Even for the same design, different devices may lead to different allocations of M20Ks, logic elements (LEs), or MLABs.
- Trade-offs Between M20Ks and LEs:
- Quartus may adjust the balance between M20K usage and LE-based logic, depending on constraints and heuristics tied to the target device.
What This Means in Your Case:
- On the larger FPGA, Quartus had more routing flexibility, allowing it to optimize M20K usage more efficiently.
- On the smaller Arria 10 FPGA, Quartus might be adopting a more conservative approach, leading to less efficient packing and a higher M20K count. This could cause some RAMs to shift unnecessarily from MLABs (logic-based memory) to M20Ks.
Suggested Actions to Improve M20K Usage
- Specify RAM Type Explicitly with the ramstyle Attribute:
- This attribute can guide Quartus to optimize M20K or MLAB usage more effectively.
- For Critical FIFOs (Reduce Wasted M20Ks):
- Use the following directive to maximize M20K usage and avoid inefficient logic consumption:
- (* ramstyle = "no_rw_check, M20K" *) reg [31:0] my_fifo_ram [0:1023];
- This forces Quartus to reuse partially filled M20Ks instead of allocating additional, unnecessary blocks.
- For Small RAM Instances (Shift to Logic):
- To avoid over-consuming M20Ks for smaller RAMs, encourage Quartus to fit them into logic:
- (* ramstyle = "no_rw_check, logic" *) reg [31:0] small_ram [0:63];
- This can help reduce M20K usage by utilizing available logic resources instead.
- Review MLAB Usage Settings:
- If Quartus isn’t efficiently using MLABs (640-bit blocks), explicitly specify them for smaller RAMs and FIFOs:
- (* ramstyle = "MLAB" *) reg [31:0] my_small_fifo [0:31];
- This helps offload memory from M20Ks to MLABs, improving overall resource balance.
Next Steps for Verification:
Once you’ve applied these strategies, check the following to evaluate their impact:
- RAM Summary Report and Fitter Report:
- These reports will show whether M20K usage improves after modifying the RAM style.
- Chip Planner Analysis:
- Open the Chip Planner tool to inspect how memory blocks are packed. Look for any inefficient packing or routing issues that might be contributing to inflated memory usage.
By applying these adjustments and reviewing the updated reports, you may achieve better memory resource optimization in the smaller FPGA.