Wednesday, February 08, 2012     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: Tip of the Week: Easily program digital bus values for analog sims
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
Hugh
Posts: 25
Online: User is Offline
7/17/2007 1:03 PM  
There exists in the "bmslib" library a Veriloga test block that takes any decimal value and loads a digital bus with the binary equivalent.  Very useful for setting the value of digital buses for simulation. 
 
The component is called "busset8" (for the 8-bit version) or "busset4" (a 4-bit version), but one nice feature is that you can easily copy it and create any arbitrary bus size simply by changing the pin on the symbol, and changing the "NUMBITS" variable inside the Veriloga.  Even a non-Veriloga writer like myself can easily do it.
 
As an example of its use, if you wanted to set an 8-bit bus to 00001001, you would program the "setval" parameter on the symbol to "9".  (NOTE - you must set the "Tools Filter" radial button to "veriloga" to see the setval parameter to edit it.)  The output high and low levels are programmable.  The setval can also be set to a simulation parameter so that you can easily modify it in your Artist State setups.

These components also have Verilog-AMS views (which are similarly easy to modify) if you are running AMS instead of Spectre.
 
- Hugh
SGG_RFIC
Posts: 7
Online: User is Offline
7/26/2007 10:42 AM  
Hi Hugh, Nice tip. However, one more thing must be done when people copy it to make their own arbitrary bus sizes: rename the module within the veriloga code! For example, a 16 bit bus would need: module busset8(outbus); -> module busset16(outbus); Also, a question about these bussets. Can the setval parameter be changed at some point in time during a transient simulation? If so, what are the various options for doing so and which do you recommend? Thanks. SGG_RFIC
Hugh
Posts: 25
Online: User is Offline
7/26/2007 10:50 AM  
You are right - I guess I assumed that copying and renaming the cell (hopefully to a library under your own control!) went without saying, but I should have included that step.

Regarding whether (or how) you would change the setval during simulation, I can not think of how you would be able to do that with the cell as it is.  Of course, you could use a couple of them, set to different values, and then analog switches to toggle between, but that's a bit messy.  I think ideally a knowledgable Veriloga writer (which I am not) would probably be better off building a version of this cell that takes a voltage input as the "setval" parameter.  Then, a vpwl or vpulse could be used to dynamically change the setval property. 

- Hugh
SGG_RFIC
Posts: 7
Online: User is Offline
7/26/2007 11:12 AM  
Hi Hugh, Yes, I have done the messy method, but am looking for a cleaner solution. :-) Alas, I am not very experienced with Veriloga either (usually I know just enough to get by on), so I am hoping someone might help us. Hint, hint... Somehow, I was under the impression that the bit assignment was only performed at the beginning of a simulation due to the use of the 'generate' command. Thus, adding another input to be driven by a source would not help. Anyone know more about this? -SGG_RFIC
Hugh
Posts: 25
Online: User is Offline
7/26/2007 2:05 PM  
Actually, I am not thinking very clearly here - what you are really looking for is simply an ideal DAC.  There already exists such an animal in the bms library, called dac_BiOB_8.  If you set up the reference voltage correctly, then you can just feed this an analog input voltage and get whatever digital output you want.  (For this particular DAC you will also need to feed it a clock signal each time you change the value.)

It appears that this, too, could be copied (to a different name!) and scaled to a different bus size by changing the internal SIZE parameter (plus pin names, etc., and maybe also the internal note that talks about number of states, just to be consistent).  I have not tried it though, so no guarantees!

- Hugh
Hugh
Posts: 25
Online: User is Offline
7/26/2007 2:09 PM  
OOPS!  What I meant to say was, an ideal ADC - not a DAC!  There is one of those too in bmslib - called adc_BiOB_8.  And the parameter you would change appears to be the HIBIT parameter.

Sorry for any confusion.

- Hugh
SGG_RFIC
Posts: 7
Online: User is Offline
7/26/2007 2:27 PM  
Yes, I had briefly looked at that, but I disliked adding yet another clock signal just to trigger the change in value. It is cleaner than the 2 bussets + switch, though. I just wish veriloga had the same type of regular event control that verilog has, not just the analog event controls. Then a simple always @(setval) would cause the change in value. But I'm not going to switch to spectreVerilog just to get that. Sure seems like there should be a cleaner way... -SGG_RFIC
jbdavid
Posts: 9
Online: User is Offline
8/14/2007 2:20 PM  
Its relatively easy to add a clock signal (or a period parameter) and make that block a "counter", or two make it switch between 2, 3 or a fixed set of numbers.. since parameters are "fixed" for a given simulation, you would have to add an input pin.

VERILOG has a nice feature called "tasks" so in the ams version you can create and activate tasks in your tcl script to set the value to an arbitrary value.. but this doesn't work in spectre..
HOWEVER you can pass its variable from an Artist Design Variable, so that you can do a DC or AC (or parametric ) sweep of that variable - THAT was the reason I create the first version of that, and I found I was recreating it for successive customers.. finally we got a chance to create the bmslib, and make it available to everyone.. So I'm quite glad to hear you find it useful.

Here is an RF analysis compatible version of busset4 that counts..
[quote]
// jbdavid
`include "constants.vams"
`include "discipline.vams"
`define MAXBIT 3
/======
(*instrument module*)
module busset4 (outbus)
output [`MAXBIT:0] outbus;
electrical [`MAXBIT:0] outbus;
parameter integer setval = 0 from Ύ:(1<<`MAXBIT+1)-1] ;
parameter real vhigh = 1.5
parameter real vlow = 0;
parameter integer countdir = 0 from [-1:1] //down, dont count, up
parameter real startcounting = 5n;
parameter real period = 5n;
parameter real trf = 10p;
integer outval;
analog begin
if (analysis("tran")) begin
@(initial_step) begin
outval = setval;
end
@timer(startcounting,period) if (countdir) begin
outval = (outval+countdir)%(1<<`MAXBIT+1);
end
generate j (`MAXBIT, 0) begin
V(outbus[j]) <+ transition(outval&1< end
end else begin
outval = 0; // this is required to work with RF sims
generate j (`MAXBIT, 0) begin
V(outbus[j]) <+ (setval&(1< end
end
end
endmodule
`UNDEF MAXBIT
[/quote]
thats what I use now.. - by default it works just like the old one, but it ALSO counts in a transient if I want it to..
HTH,
Jonathan
Posting to forums is available to community members only.
Login or Register

Forums > Custom IC > Custom IC Electrical Design > Tip of the Week: Easily program digital bus values for analog sims


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.