English 中文(简体)
Xilinx Vivado 表格
原标题:Xilinx Vivado schematic for if else statements

我是学习系统。 在编码的同时,以下表格的综合图示对我没有意义。

module ifelseDUT(
input logic sela, selb, selc, da,db,dc,
output logic dout
    );
    
    always @*
    begin
        dout = 0;
        
      priority  if(sela)
            dout = da;
        if(selb)
            dout = db;
        if(selc)
            dout = dc;

        
    end
    
endmodule

这里是综合图表:

</p

How to understand the schematic when sela is not used? I am also not able to make sense of S=default value on the muxes?

这里是Vivado生成的信息。 在综合过程中没有错误或警告。

[Synth 8-293] found qualifier priority on case statement: implementing as full_case ["C:/Users/homealien/Xilinx/ifelse-test/ifelse-test.srcs/sources_1/new/ifelseDUT.sv":32]
问题回答

Refer to UNESCO Std 1800-2017, section 12.4.2 unique-if, separate0-if, and priority-if

If the keywords unique or priority are used, a violation report shall be issued if no condition matches unless there is an explicit else.

Since you have no else with the priority if, the Cadence simulator generates a warning. Perhaps the Vivado simulator did as well. Check your log files.

You likely want an if/else statement rather than 3 separate if statements:

module ifelseDUT(
input logic sela, selb, selc, da,db,dc,
output logic dout
    );
    
    always @*
    begin
        dout = 0;
        if (sela) begin
            dout = da;
        end else if (selb) begin
            dout = db;
        end else if (selc) begin
            dout = dc;
        end
    end
    
endmodule




相关问题
Detect months with 31 days

Is there an analogous form of the following code: if(month == 4,6,9,11) { do something; } Or must it be: if(month == 4 || month == 6 etc...) { do something; } I am trying to write an if ...

&& (AND) and || (OR) in IF statements

I have the following code: if(!partialHits.get(req_nr).containsKey(z) || partialHits.get(req_nr).get(z) < tmpmap.get(z)){ partialHits.get(z).put(z, tmpmap.get(z)); } where partialHits ...

If / else order sequence issue

I have the following set up, a ddl (ddlProd, radBuyer) and autocomplete text box (txtProdAC, radProd) that when populated and their respective radio buttons are selected, a grid view of the data is ...

PHP if or statement not working

We are trying to use the below piece of code if (($_GET[ 1 ] != "1") || ($_GET[ 1 ] != "2")) { When we try this no matter what value the variable has it will evaluate as true even when data is ...

C++ String manipulation - if stament

I have the following code that works correctly. However after I add an else statement anything always evaluates to else wgetstr(inputWin, ch); //get line and store in ch variable str = ch; ...

Are one-line if / for -statements good Python style?

Every so often on here I see someone s code and what looks to be a one-liner , that being a one line statement that performs in the standard way a traditional if statement or for loop works. I ...

Which is faster - if..else or Select..case?

I have three condition to compare. Which one is more faster between the following two? Please point me out. Thanks all! If var = 1 then Command for updating database ElseIf var = 2 then ...

热门标签