The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Nov 21st, 2019, 6:05pm
Pages: 1
Send Topic Print
VerilogA-instantiation of array of modules using looping structure (Read 348 times)
Anish
New Member
*
Offline



Posts: 2

VerilogA-instantiation of array of modules using looping structure
Apr 23rd, 2019, 12:39pm
 
I am developing a model for an array of delay cells to be used for a time-to-digital converter. I am trying to replace the following module instantiations with a looping structure-

delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(143)) dly_up1 (up_buf,delay_chain_up[1], delay_ctrl[1]);
delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(243)) dly_up2 (up_buf,delay_chain_up[2], delay_ctrl[2]);
delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(123)) dly_up3 (up_buf,delay_chain_up[3], delay_ctrl[3]);
delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(7)) dly_up4 (up_buf,delay_chain_up[4], delay_ctrl[4]);
delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(9)) dly_up5 (up_buf,delay_chain_up[5], delay_ctrl[5]);
delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(11)) dly_up6 (up_buf,delay_chain_up[6], delay_ctrl[6]);
delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(3)) dly_up7 (up_buf,delay_chain_up[7], delay_ctrl[7]);
delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(6)) dly_up8 (up_buf,delay_chain_up[8], delay_ctrl[8]);

I tried the following based on what I found on a Cadence forum where k is a genvar-

generate
     for(k=1;k<=`N_delays;k=k+1)
     begin      
           delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma),.seed(24)) dly_up_array (up_buf,delay_chain_up[k], delay_ctrl[k]);
     end
endgenerate


I am able to compile and run the unrolled instantiations, but I get the following compilation error for the looped instantiation-

Error found by spectre during AHDL compile.
   ERROR (VACOMP-2259): "for<<--? (k=1;k<=`N_delays;k=k+1)"
       "/home/scratch.amorakhia_libs/work/amorakhia+tsmc7+development+3/nvhs_tsmc7/am_
tdc_delay/veriloga/veriloga.va",
       line 58: syntax error.



I have tried the looping structure without the generate but that doesn't compile as well. I have attached the code with this post. Would really appreciate it if someone can tell me what I am doing wrong.

Thanks!
Back to top
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1713
Bracknell, UK
Re: VerilogA-instantiation of array of modules using looping structure
Reply #1 - Apr 29th, 2019, 3:42am
 
Unfortunately I don't think this is supported in spectre currently. You can use for loops with a genvar within the analog block, but not in a module-level generate statement.

That does work with VerilogAMS using XCELIUM for example (although you'd have to change your two for loops to use different loop variables - for example k for the module-level loop and i for the loop within the analog block.

Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
Anish
New Member
*
Offline



Posts: 2

Re: VerilogA-instantiation of array of modules using looping structure
Reply #2 - May 2nd, 2019, 10:09am
 
Thanks for your reply, Andrew.
I reached out to Cadence Support and they provided me with a work around using an instance array. I made the seed an input instead of a variable to support this new structure-
Code:
	delay_cell #(.offset(50p),.step(tdc_step),.sigma(tdc_sigma)) dly_up_array[0:`N_delays-1] (up_buf,delay_chain_up, delay_ctrl, seed_up);
 



up_chop is a single electrical signal while delay_chain_up, delay_ctrl & seed_up are all arrays of electrical signals.

Anish
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2019 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.