====== Tips and Tricks ====== ===== MATLAB Tricks ===== * To invoke matlab6, in case you run out of matlab7 licenses, the matlab should be started by entering the following two commands in the terminal. * UNSETENV LM_LICENSE_FILE * /cad/tools/matlab6p1/bin/matlab Matlab6 doesn't seem to start properly in the debain installed machines. The entire GUI doesn't work properly. But the command prompt, help, plots, matlab code editor work perfectly. The way to start matlab6 (for those machines alone) is to type the second command as /cad/tools/matlab6p1/bin/matlab -nodesktop * Creating an inset within a figure [[http://kaisare.org/blog/?p=4|Creating Insets]] * Getting presentation quality plots: Default font size and line thicknesses etc. are too small for presentations and even reports. You can set the default value of these(and whatever else you want to set when MATLAB starts) in ~/matlab/startup.m. See a sample {{startup.m|here}}. It is set for good presentation quality figures. * To include figures in LaTex, ''.eps'' or ''.pdf'' can be used. But if you won't be able to edit the figures. So save any figures you'd like to have for the future as matlab figures. This'll let you get back to it and edit if necessary. ===== Keeping your designs accessible to others, but other files private ===== You can manually do ''chmod'', but that's a pain. At the beginning of your ''.cshrc'', put the line ''umask 077''. This will create files with permissions only to the user. To have files generated from, say, Cadence have read permissions for others, invoke it from inside a shell script with ''umask 022''. See the example ''myicms'' below. #!/bin/csh # # Create files with read permissions for others umask 022 icms & ===== CADENCE Tricks ===== * [[:cadence:corners|Corners analysis in Cadence]] * [[:cadence:montecarlo|Monte Carlo analysis in Cadence]] * __Cadence documentation setup__: Typing **cdsdoc** in command line or clicking **Help** in cadence brings up cdsdoc. The displayed books/chapters can be opened in the browser. To set up the browser, it needs to find Netscape/Mozilla and contact the localhost. * Make sure Mozilla/Firefox is in your path * Make a soft link named **netscape** to **mozilla** (ln -s /usr/bin/mozilla /usr/bin/netscape). My default browser is firefox, still, I could get things to work only by making this link * In the proxy setup, make sure that proxy is not used for your own machine(localhost, 127.0.0.1, machinename.domainname should be in the "do not use proxy for" list) * Try **cdsdoc -test** to see if it finds the docs and the browser. For more debugging, set the environment variable CDS_DEBUG_CDSDOC to "debug" * Make sure that the browser is open before trying out the help * Search in cdsdoc assumes that the term you enter is the complete word. Enclose it in wildcards if you don't get any matches. e.g. *envsetval* for all results on envsetval * Publication quality figures: Cadence figures are probably the ugliest you can have for reports etc. especially when they are exported from ''wavescan'' with default settings. ''AWD'' is marginally better. To improve the situation, in wavescan, you can go to Graph->Edit and choose white background, large bold fonts etc. By clicking on a curve, you can make the lines bold. You can then make this the default template by Graph->Template->Set current. This gives you figures that are legible(but are lacking aesthetics-for best results, import data into MATLAB and plot them) * ahdlcmi compile error: This can show up at the beginning of the simulation log file (''spectre.out'') when you use veriloga modules in your design. veriloga blocks are first compiled to ahdlcmi modules for quick simulations afterwards. If you get this error, you need to make the following softlink: ''sudo ln -s /lib/libc.so.6 /cad/tools/cadencetools/IC5141_ISR500.2.29/tools.lnx86/systemc/gcc/3.2.3/install/lib/libc.so'' * ahdlcmi compile error: Following works for the 64-bit machines with debian OS : (1) Add commandline option -64 (if your machine is 64 bit)(2) The executable /bin/sh points to dash in many machines. Change the link to point /bin/sh to bash. * Extracted parasitics: The script [[cadtools:caprep]] can be used to report parasitics between nets in capacitor-extracted views. Save the file and make it exectuable using "chmod +x caprep". Comparision of capacitor parasitics in differential circuits can also be done. Example usage is shown below: Report caps in sorted order on a particular net Usage: ./caprep [-n net_name] [-c net_name1 net_name2] [-b net_name1 net_name2] [-f file] [-h] -n : Net name -c : Compare parasitics on 2 nets -b : Report parasitics between 2 nets -f : Input netlist file -h : Help example1: ./caprep -n vip -f input.scs example2: ./caprep -c vip vim -f input.scs example3: ./caprep -b vip gnda -f input.scs * Digital synthesis: Abishek Goda's tutorial: http://10.7.7.58/wiki/syntut_avi.tar.bz2, http://10.7.7.58/wiki/syntut_flv.tar.bz2 [Some version of Mplayer has problem viewing the files showing a blue screen. It may also give a warning saying that "X11 error: BadAlloc (insufficient resources for operation)." In that case use the command 'mplayer -vo x11 encounter.avi'] * NC Verilog: {{:cadence:multiplier_sim_using_ncverilog.pdf|NC Verilog usage example}}, {{:cadence:multiplier_sim_using_nclaunch.pdf|NC Launch usage example}} * Some useful Cadence tips: {{:cad_tips.pdf|On what to do when Cadence crashes suddenly... etc}} * Simulating cells without schematic when only their spice/spectre netlist is available: * Create a symbol view for the cell with all the pins as in the .subckt in the netlist. * Edit the cdf of the cell (CIW -> Tools -> CDF -> edit). In the simulation information section fill the list of pins with each pin name enclosed in double-quotes. The order should match the order in the .subckt statement. e.g. “IN” “AVDD” “AVSS” “OUT” * In ADE, setup -> model library section : add the netlist as well * In ADE, setup -> environment : add the view symbol to both switch view list and stop view. Then simulate ===== CADENCE Bugs ===== * **Weird FFT results**: If you get weird FFT results, i.e. "distortion" in a pure sine wave source(well above the numerical accuracy of -300dBc), you may be using a buggy release of spectre. To fix this, use the option "-format psfbin" in ADE environment. See {{adeoption.png|this figure}}. Details can be found at [[http://www.designers-guide.org/Forum/YaBB.pl?num=1277962510|this discussion thread]]. * Details of the bug: After simulation with a certain strobeperiod, ocnPrint() gives the results where time points are truncated to one or two significant digits. The values though, do correspond to the correct timepoints. DFT seems to "interpolate" between the crudely truncated time points to the desired values, resulting in incorrect voltage/current values. This signal will obviously have a lot of distortion. * **hierarchy editor not descending all the way to the bottom**: When a synthesized and P&Red design is imported into cadence using verilogIn, shadow views are not created properly and the hierarchy editor doesn't descend all the way down to the standard cells. [[See discussion at http://www.designers-guide.org/Forum/YaBB.pl?num=1310639460]]. This is due to a bug in some versions of IC5. To fix this, - Change CDS_INST_DIR to /cad/tools/cadencetools/IC5141_ISR500.2.29; Start cadence and do verilog in. All shadow views are created properly with this version. - Due to our license, this version cannot be used for simulations. Change CDS_INST_DIR back to /cad/tools/cadence and proceed with config view creation and simulations. ===== SPECTRE Tricks ===== ==== Save and Plot ''oppoint'' of Spectre Transient Simulation ==== If you are interested in seeing various operating point values of devices plotted against time for a Spectre transient simulation, use following method (taken from SourceLink Solution No. 11003524) - * Tell Spectre to save the needed information by adding the correct save statement to the netlist. Say you are interested in plotting the operating information for a bipolar device name ''Q1'' in a block named ''osc''. Add the following statement to your netlist: ''save osc.Q1:oppoint'' * To add a save statement in the Analog Design Environment you need to create a file, say ''myop.scs'', and add the line above into it. You can include the file by pointing out the file as a model using- Setup->Model Libraries in ADE. * After a successful Spectre transient simulation you can now plot the results from the Results Browser. * Similar procedure can be used for PSS and envelope analysis. ===== SPECTRE bugs ===== === PSS + PAC Analysis in Circuits Using Inductors === * Never use the 'Resistance' option in the inductor to set the inductor 'Q'.PAC analysis neglects the internal resistance of the inductor and treats it as ideal. * Rather use an external resistor in series with the inductor to set the 'Q'. === PXF / PSS Analysis === * Using ''highorder=yes'' MIC refinement option for PSS results in Segmentation Fault for the PXF analysis which follows this PSS analysis. (Spectre version 5.1.0) * Using ''highorder=no'' resolves the issue. ===== XCircuit Tricks ===== - Exporting any Matlab curve as a library object into Xcircuit * [[tips:xcircuit.m]] is the file which dumps out the library object corresponding to the matlab curve. * [[tips:test.m]] is an example where a sine wave is created for xcircuit. * In Xcircuit, use "File > Load New Library" to load the sine wave object dumped out in 'test.lps' by m/Calibre/LVS/G-DF-LOGIC_MIXED_MODE90N-1P9M-LOW_K_CALIBRE-LVS-1.1-P20.txt ===== Blackbox LVS ==== Blackbox LVS is useful for synthesized layouts (which don't have a transistor level schematic) or nonstandard components like inductors, varactors which are not from the PDK. The cell to be treated as a blackbox in LVS should have the correct pins(with pins M*_CAD TT in layout). It should have a dummy schematic with some component like a resistor or MOS inside connected to a pin. It doesn’t matter what it is or where it is connected to. In LVS options, specify the cells to be treated as blackboxes as shown below. Multiple cells can be specified on the same LVS BOX line or separate lines. Insert picture ="/dokuwiki/_detail/cadtools/blackboxlvs.png?id=cadtools%3Acalibre&cache=cache" class="media" title="cadtools:blackboxlvs.png">
Use your_working_directory/pex for PEX.
  • Make a softlink to /cad/library/UMCxxx/RuleDecks/Calibre/calview.cellmap in your working directory
  • Cancel the runset prompt the first time you use the tool
  • Use your_working_directory/pex for PEX.
  • Once you setup the rules file etc. you can store them as pex.rules runset file in your pex directory. This runset file can be loaded each time to give you the desired setup.
  • Choose Export from Layout viewer and Export from Schematic viewer for layout and netlist inputs
  • Choose Setup→Show PEX options
  • Enter appropriate power and ground nodes in LVS options→Supply. Name connections etc. can also be specified here.
  • In Outputs, choose CALIBREVIEW for extracted view(similar to av_extracted) or SPECTRE to get only a netlist in spectre format.
  • Your Calibre View Setup form should look as follows
  • Rules files(same as for LVS)