Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to parameterise size of constant literals for assignments?

Status
Not open for further replies.

abselgec

Newbie level 3
Newbie level 3
Joined
Jun 12, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,304
Hi,

I have the following system verilog code to be compiled in VCS.

module (....);
.....
......
parameter WIDTH = 8;
parameter [2:0][WIDTH-1 : 0 ] = {8'h00, 8'hff, 8'h24} ;
....
..
endmodule

How can i parameterise the size of literals inside the concatenation? so that even if WIDTH changes i need not bother about changing the size manually inside the concatenation.
I know this may work for all 0's and 1's by using 'h00, or '1. (although former gives vcs warning since unsized literals are taken as 32bits). But i have no idea how to use it with something like 8'h24. Please help on this at the earliest.

Thanks & Regards,
Absel.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top