The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 2:21pm
Pages: 1
Send Topic Print
array initialization in Verilog (Read 3551 times)
Pavel
Senior Member
****
Offline



Posts: 174
Lausanne/Switzerland
array initialization in Verilog
Nov 29th, 2006, 7:45am
 
Hello

For my test bench I need in 8-member array of 11-bit constants.
Only approach I found working is:

Code:
	reg  [10:0]  local_PWDN_etalon [0:7];

	initial begin
		local_PWDN_etalon [0] =  11'b00000011100;
		local_PWDN_etalon [1] =  11'b00000011000;
		local_PWDN_etalon [2] =  11'b00000011100;
		local_PWDN_etalon [3] =  11'b00000011100;
		local_PWDN_etalon [4] =  11'b11111111111;
		local_PWDN_etalon [5] =  11'b01111111011;
		local_PWDN_etalon [6] =  11'bx;
		local_PWDN_etalon [7] =  11'b00000011101;
	end
 



Is there a possibility to avoid using construction initial?

Regards.

Pavel.
Back to top
 
 
View Profile   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: array initialization in Verilog
Reply #1 - Dec 8th, 2006, 11:20pm
 
of course,
you can define the values in a text file and do readmemh
but its still probably in the inital block..
any verilog text book will have other ways of doing this..
Jonathan
Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: array initialization in Verilog
Reply #2 - Dec 9th, 2006, 10:03am
 
Why do you want to avoid using initial?

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.