The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 5:47pm
Pages: 1
Send Topic Print
use genvar for OOMR declarations (Read 698 times)
leoklein
New Member
*
Offline



Posts: 2

use genvar for OOMR declarations
Oct 04th, 2021, 3:47am
 
Hi,
I have an image sensor I want to stimulate from toplevel testbench. So there is no direct/port access to the photodiodes, but I can force them like this:

real I_Cathode;
analog
 I("I_DUT.I_CORE.Cathode[0]",VSS) <+ transition(I_Cathode);
 I("I_DUT.I_CORE.Cathode[1]",VSS) <+ transition(I_Cathode);
...

But obviously I don't want to copy that line million of times, so I was searching for something like:

genvar i
analog
 for (i=0;i<1e6;i=i+1) begin
     $swrite(s,"I_DUT.I_CORE.Cathode[%i]",i);
     I(s,VSS) <+ transition(I_Cathode[i]);
 end


But it is not working as:
     I(s,VSS) <+ transition(I_Cathode[gint]);
          |
xmvlog: *E,EXPBON (...,114|11):  Expecting only branch or node type arguments [5.2(AMSLRM)].

which is somehow expected. Does anybody know a working solution for that?

Best Regards,
leo
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: use genvar for OOMR declarations
Reply #1 - Oct 5th, 2021, 4:03pm
 
There are a couple of issues here.  First is the Verilog-AMS language.  It does not allow you to pass strings to access functions.  Conceptually, the way to do what you want is:
Code:
for (i=0;i<1e6;i=i+1) begin
     I(I_DUT.I_CORE.Cathode[i],VSS) <+ transition(I_Cathode[i]);
end 


Second is limitations in the implementations.  You are doing two things that are unusual, you are using a hierarchical reference and you are using a node array.  There is a reasonable chance that one or both are not supported by the simulator you are using (perhaps this is why you attempted to use strings in the first place).

Third is the practical issue of trying to simulate a circuit with a million nodes.  That is going to stretch the limits of most simulators and at a minimum will be too expensive.  You might want to rethink the approach and try to avoid using electrical nodes for the pixels.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
leoklein
New Member
*
Offline



Posts: 2

Re: use genvar for OOMR declarations
Reply #2 - Oct 14th, 2021, 2:28am
 
Hi Ken,

thanks a lot for the answer (I didn't get a email notification, so I found it only now).

The proposed solution works with spectre/xcelium - I'm sure I've tried that earlier without the string. Maybe something else was wrong before...

You're right about the 1M instances - I always try to reduce it and in reality worst case is around 23000 which is still slow, but needed due to the nonregular image area...

Best Regards,
leo
Back to top
 
 
View Profile   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.