[sv-bc] What's the difference between "let P = const_expr" and "localparam P = const_expr"?

From: Brad Pierce <Brad.Pierce@synopsys.com>
Date: Thu Oct 27 2011 - 17:16:18 PDT

In the proposal for Mantis 3295 there's code

   // now define lets to make the code more readable
   let LOCK = 1;
   let UNLOCK = 2;
   let ON = 3;
   let OFF = 4;
   let KILL = 5;

that looks a lot like

   typdef enum { LOCK=1, UNLOCK, ON, OFF, KILL } dummy;

or

   localparam LOCK = 1, UNLOCK = 2, ON = 3, OFF = 4, KILL = 5;

Is there any practical difference between these different ways of defining local constants? Is one way preferable to the others?

'let' can do things the others can't, such as stand for a non-constant_expression or take arguments, but for constant_expressions and no arguments what are the differences?

-- Brad

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Oct 27 17:16:37 2011

This archive was generated by hypermail 2.1.8 : Thu Oct 27 2011 - 17:16:49 PDT