hdl
586 TopicsQuartus 25.1std miscompiles wildcard casez with constant concatenation — RTL/gate mismatch
Quartus Prime Lite 25.1std silently synthesizes the following legal combinational Verilog to a constant-high output, although the RTL requires fire = en. The mismatch exists in the functional post-synthesis netlist, before fitting. The same source passes Vivado 2026.1. Environment Quartus Prime Lite 25.1std.0 Build 1129, Linux x86_64; Cyclone V 5CGXFC5C6F27C7. Quartus input mode: SYSTEMVERILOG_FILE. A separate VERILOG_FILE test also reproduces the discarded input dependency. Quartus gate simulation: Icarus Verilog 14.0 using unmodified Altera cyclonev_atoms.v and altera_primitives.v. Comparison: Vivado 2026.1 build 6511674, Artix-7 xc7a35tcpg236-1; native XSim 2026.1 and Icarus 14.0, using unmodified AMD cell models. Minimal reproducer module trigger(input en, input other, output reg fire); always @* begin fire = 1'b0; casez ({en, 1'b0}) 2'b1?: fire = 1'b1; endcase end endmodule The unused input other keeps the interface identical to the control variant below. No Amaranth, Yosys, IP, clocks, initialization, synthesis attributes, or FPGA hardware are required. Expected and actual behavior The pattern masks the low selector bit and requires the high bit, en, to equal 1. Therefore fire must equal en. The output is assigned on every execution of the combinational block. en other | RTL | Quartus gate | Vivado gate 0 0 | 0 | 1 (wrong) | 0 0 1 | 0 | 1 (wrong) | 0 1 0 | 1 | 1 | 1 1 1 | 1 | 1 | 1 All inputs are driven to binary 0/1 values. Quartus connects the fire output buffer to vcc and reports: No output dependent on input pin "en". Vivado preserves en → IBUF → OBUF → fire. Equivalent controls Replace 2'b1? with 2'b10, keeping {en, 1'b0}: correct in both tools. This is equivalent because the low selector bit is constant zero. Keep 2'b1? but use {en, other}: correct in both tools for all input combinations. RTL/gate mismatches over four input combinations: wildcard exact-pattern variable-selector Quartus / Icarus 2 0 0 Vivado / XSim 0 0 0 Vivado / Icarus 0 0 0 The RTL references and shared testbench are byte-identical between tools. The Icarus cross-check excludes an Icarus-versus-XSim discrepancy. Generated netlists and vendor cell models were not edited. Reproduce Extract the attached ZIP and run from its root, replacing the Quartus installation path as appropriate: python3 run_gate.py synth --quartus-root /path/to/quartus --output-dir quartus-output python3 run_gate.py simulate --output-dir quartus-output The first step runs quartus_map and exports functional netlists using quartus_eda. The second step intentionally exits nonzero when the RTL/gate mismatch is reproduced, with wildcard=2 exact=0 variable=0. The ZIP contains the full report, source, QSF settings, shared testbench, reproduction scripts, all three unmodified Quartus and Vivado netlists, and the recorded failing/passing logs. Full Vivado/XSim reproduction commands are in REPORT.txt. Vendor simulation library sources are not bundled; the scripts use local installations. Impact and follow-up In a larger design this construct removed state-update enables and changed behavior despite passing timing. Fully lowering processes to explicit mux/enable logic before Quartus reads the Verilog avoids the trigger. Please confirm the miscompilation, provide an existing or new defect tracking number, and advise whether a patch or supported synthesis setting is available for Quartus Lite/Standard 25.1. Other Quartus versions have not been tested.42Views0likes2CommentsIntroducing the Altera Community AI Responder — Beta
Altera is introducing the AI Responder, an assistant built into the Altera Community to help provide faster, context-aware guidance for Altera product questions. It uses relevant public Altera documentation and Knowledge Database content, with coverage continuing to expand. The AI Responder may provide source references and can hand off complex or out-of-scope questions to an Altera subject-matter expert. As a beta feature, responses may contain errors or omissions, so please review the sources and verify technical guidance against official Altera documentation before implementation. If the response does not fully address your question, add more context and tag ai_responder to continue the discussion. We welcome your feedback as we improve the Community experience.145Views0likes1CommentQuartus Prime Lite 25.1 - Issue with the Verilog generate loops
Hi! I believe, this is the same issue mentioned here, or at least its sibling. Long story short, here is a snippet from the IEEE Std 1364™-2005 standard, page 185: module addergen1 (co, sum, a, b, ci); parameter SIZE = 4; output [SIZE-1:0] sum; output co; input [SIZE-1:0] a, b; input ci; wire [SIZE :0] c; wire [SIZE-1:0] t [1:3]; genvar i; assign c[0] = ci; // Hierarchical gate instance names are: // xor gates: bit[0].g1 bit[1].g1 bit[2].g1 bit[3].g1 // bit[0].g2 bit[1].g2 bit[2].g2 bit[3].g2 // and gates: bit[0].g3 bit[1].g3 bit[2].g3 bit[3].g3 // bit[0].g4 bit[1].g4 bit[2].g4 bit[3].g4 // or gates: bit[0].g5 bit[1].g5 bit[2].g5 bit[3].g5 // Generated instances are connected with // multidimensional nets t[1][3:0] t[2][3:0] t[3][3:0] // (12 nets total) for(i=0; i<SIZE; i=i+1) begin:bit xor g1 ( t[1][i], a[i], b[i]); xor g2 ( sum[i], t[1][i], c[i]); and g3 ( t[2][i], a[i], b[i]); and g4 ( t[3][i], t[1][i], c[i]); or g5 ( c[i+1], t[2][i], t[3][i]); end assign co = c[SIZE]; endmodule Quartus Prime 25.1std.0 Build 1129 10/21/2025 SC Lite Edition reports the error 10170 when attempting to compile this module: Error (10170): Verilog HDL syntax error at main.v(22) near text: "for"; expecting "endmodule". Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number. Error (10170): Verilog HDL syntax error at main.v(23) near text: ")"; expecting ";". Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number. Error (10170): Verilog HDL syntax error at main.v(28) near text: "end"; expecting "endmodule". Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number. Error (10112): Ignored design unit "addergen1" at main.v(1) due to previous errors It accepts it, though, if to embrace the generating loop into "generate/endgenerate" framing. The Verilog version in the project settings is "Verilog-2001". Changing it to "System Verilog" has no impact on the behavior. ========== For comparison, I fed this exact snippet to the Questa Altera Starter FPGA Edition-64 2025.2 and it had no problems with it. ========== So my question is: "What is the root cause of this misbehaving?". Am I understanding the standard wrong? Ot is it some peculiarity of the Quartus itself? Thanks in advance!Solved481Views0likes2CommentsQuartus 26.1 type inheritance bug.
An interface defines a parametrised type. A module instantiates the interface with a certain parameter value. Thet interface is connected to a module port of an instantiated module. That module, in turn, extracts the (already parametrised) type from its module port. It then contains a nested module, which inherits every type definition from the enclosing scope. And it all works, if the enclosing scope explicitly defines the types. But if the type is the one that has been extracted from the module port interface, then the plot thickens. Apparently, the nested module knows the size of the type it inherited, but does not know its structure members. And only if the inherited type was extracted from an interface. Attached is a project archive, containing a demo SV file and the settings. Not much is set (read: nothing but the chip type), as the code does not pass the compilation phase, but anyway. The demo code is really short, just 1 SV file, maybe 50 actual code lines, plus lots of comments.Solved370Views0likes12CommentsPossible Quartus 24.1 bug?
Here is the code: interface myif #( parameter int W = 1 )(); typedef struct packed { logic [W-1:0] x; } MYSTRUCT; MYSTRUCT s; modport src ( output s ); modport dst ( input s ); endinterface module top; myif #( .w( 5 ) ) test_if(); test test_module ( .foo( test_if ) ); endmodule module test ( myif.dst foo ); typedef foo.MYSTRUCT MYSTRUCT_COPY; $info( "%0d %0d", $bits( foo.MYSTRUCT ), $bits( MYSTRUCT_COPY ) ); MYSTRUCT_COPY q; assign q = foo.s; endmodule Surprisingly, the info message will print "5 1" instead of "5 5". And for the assign Quartus will complain that it had to crop the 5 bit wide foo.s to match the 1 bit wide q. When processing the typedef, Quartus uses the interface definition's default W value instead of the actual value of the actual interface port. I believe that, according to the standard, that is not the expected behaviour.135Views0likes3CommentsTypedef inheritance in nested modules
Sorry for the formatting, but for some reason proper switching between paragraph and preformatted does not work. I have an interface, which contains a structure, which, in turn, contains a parametrised width vector: interface myif #( parameter int W = 1 )(); typedef struct packed { logic one; logic [W-1:0] many; } MYSTRUCT; MYSTRUCT x; modport src ( output x ); modport dst ( input x ); endinterface Now, there is a module which gets this interface. It needs to work with the data defined in the interface, so it needs to extract the structure definition (note that everything here is simplified to absolute bare bones). Easy enough: module my_outer_module ( myif.dst dest ); // Extract the typedef from the port typedef dest.MYSTRUCT MYSTRUCT; ... // other stuff ... // here will be a nested module, described below ... endmodule So far so good, the entity that instantiates my_outer_module also instantiates the interface, with whatever W parameter value it deems necessary and my_outer_module will use the correct MYSTRUCT definition, even though W has not been passed to it . Furthermore, if my_outer_module contains a nested module, as per SystemVerilog rules, it can refer to all types and parameters in the enclosing scope, so it will also be able to use MYSTRUCT without further ado. And, indeed, this works: module my_nested_module ( ... some signals in and out ... ); MYSTRUCT some_variable; ... endmodule However, if the typedef is used in the module port definition, Quartus Pro 24.1 spits the dummy: module my_nested_module ( input MYSTRUCT going_in, output MYSTRUCT coming_out ); assign coming_out = going_in; endmodule Quartus complains about undefined net type for both going_in and coming_out. How come? Help with this particular issue would be appreciated. I know that there are other ways of passing types to modules. There are reasons why I try to solve the problem this particular way and not through packages or macro trickery or anything else. I am looking for an explanation why Quartus reports an error on, I believe, perfectly valid SV source. I know that the simulator is a very different animal, but it accepts the code without a pip, and it works as expected. Thanks in advance. Interesting addendum: using old (non-ANSI) style module declaration makes Quartus happy. Which makes the whole thing more intriguing. This is accepted: module my_nested_module ( going_in, coming_out ); input MYSTRUCT going_in; output MYSTRUCT coming_out; assign coming_out = going_in; endmodule So Quartus clearly understands the concept of using a structure defined in the enclosing scope as the type of a port, but refuses to remember how to do it while processing an ANSI style module header.138Views0likes3CommentsIssue with MIPI CSI2 Encrypted IP File During Project Integration
Hi, I am working on a project where I have integrated two separate projects into a single top-level design. Project A includes the MIPI CSI2 IP and other related components. Project B contains the logic to process the output data generated by the MIPI CSI2 IP. When I compile both projects individually, they complete successfully without any errors. However, after instantiating both projects together in a single top-level wrapper, I encounter a compilation error originating from the generated encrypted file of the MIPI CSI2 IP. I have attached the error snapshot for your reference. Could you please help identify the possible cause of this issue? Is there any known limitation or configuration requirement when integrating the MIPI CSI2 IP with additional logic in the same top-level design? Thanks.170Views0likes4CommentsHow to generate a netlist when the design includes encrypted sources
I would like to ship my design to a customer as an encrypted netlist, however I am unable to create the netlist after a successful run, because my design includes encrypted RTL (unable to change this). I am running the following command (after running synthesis and P&R): quartus_eda my_project --simulation --format=vhdl --tool=modelsim -c my_project_revision I get the following error: Error (18580): Cannot generate netlist output files because the design includes encrypted source files: "/path/to/encrypted/rtl/file.vhdp" I see here that this was planned to be possible in "future" Quartus Prime updates, but I am using 26.1 and no such update has been made. I have also attempted to run the following command, with the exact same result: quartus_eda my_project --resynthesis --tool=modelsim Any help would be appreciated; perhaps this is plainly impossible, or perhaps there is some work-around. Thank you!Solved276Views0likes3Comments