[sv-bc] RE: unique and priority keywords for loops

From: Noah Kanovsky <noah.kanovsky@nxp.com>
Date: Fri May 30 2014 - 18:04:01 PDT
Hi Brad,

Thanks for updating the mantis, could you tell me how I get a login to that system? Alternatively, could you add my comments in the notes section? I don't think anyone will see what I suggest if it just a link.

Consider that with your proposal you cannot easily deal with else statements. Also your proposal requires syntax error detection when adding unique, unique0, and priority keywords. That would not be the case with the ifeach proposal.

Noah


From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Noah Kanovsky
Sent: Friday, May 30, 2014 4:31 PM
To: brad_pierce@acm.org
Cc: 'SV_BC List'
Subject: [sv-bc] RE: unique and priority keywords for loops

Hi Brad,

I see that you added a mantis request based on your proposal of using a guard expression (http://www.eda.org/svdb/view.php?id=4921)

I'd like to add the alternative idea that I shared with you of adding ifeach and ifelseeach keywords. That would require setting up the predicate beforehand.

I'd like to see something like this:

ifeach(selected[i])
ifelseeach(selected[i])

ifelseeach stops after first match.

Ifeach and ifelseeach could get final else as well:

ifeach(selected[i]) begin
  output <= input[i];
end
else begin
  nosel <= 1;
end

And that can work for ifelseeach as well.

each of these could get the unique, unique0, and priority keywords.

One would need to prepare the selected array beforehand.

Noah


From: owner-sv-bc@eda.org<mailto:owner-sv-bc@eda.org> [mailto:owner-sv-bc@eda.org] On Behalf Of Noah Kanovsky
Sent: Thursday, May 15, 2014 1:18 PM
To: 'SV_BC List'
Subject: [sv-bc] unique and priority keywords for loops

Hi,

Is there a way to accomplish unique / priority with a for or while loop? For example:

module test(
                input [3:0] sel_enc,
                input [3:0] in,
                output reg out
                );

always_comb begin
                out = 0;
                for(int i = 0; i < 5; i++) begin
                                priority if(sel_enc == i) begin
                                                out = in[i];
                                end
                end
end

endmodule

Most of my modules are parameterized, and these keywords don't help much when you can't write an explicit if else chain or case statement.
Noah

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri May 30 18:04:26 2014

This archive was generated by hypermail 2.1.8 : Fri May 30 2014 - 18:04:38 PDT