🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.verilog
Article #59

constant expressions, parameters, `define

#59
From: BIFF!!!!1
Date: Tue, 15 Sep 1992 22:48
39 lines
1132 bytes
I'd like to do the following:

parameter pOW = 27;
parameter [pOW-1:0]  
  Xvob = pOW'b1 << 26;
         ^^^

Apparently, verilog doesn't allow this wanting instead:

  Xvob = 27'b1 << 26;
         ^^

I guess I have to use: 

`define pOW 27
parameter [`pOW-1:0]  
  Kibo = `pOW'b1 << 26;  

I'd been using parameters instead of `defines to avoid
having to use the ` on macro substitutions.  Why does
verilog require the ` ?  This aspect of the language
seems a little ridiculous.

I'd like to get rid of the "26" as well, replacing it with a 
variable so that I can do things like:

i = `pOW-1;
parameter [`pOW-1:0]
  Obik = `pOW'b1 << i; i=i-1;
  Xibo = `pOW'b1 << i; i=i-1;

Oh yeah, I want to take my source into synopsys for synthesis.

Any comments? Ideas?

--
dave
manley@optilink.com
Technical Details
Message-ID: <12351@optilink.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!optilink!manley

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!optilink!manley
From: manley@optilink.UUCP (BIFF!!!!1)
Newsgroups: comp.lang.verilog
Subject: constant expressions, parameters, `define
Message-ID: <12351@optilink.UUCP>
Date: 15 Sep 92 22:48:54 GMT
Distribution: usa
Organization: DSC/Optilink Access Products
Lines: 39