Email: bknpk@hotmail.com Phone: +972-54-7649119

Save and Restore using ncsim (nc) and Specman

Note: Allow pop up option in your browser to see statistics on this page frequent count watch.

V

 

  1. In cases where simulation is extremely long till the point of failure, a machanism of save and restore can help a great deal. One can save the simulation state, just before the failure and re-start from this point. For complex bugs in long simulations, this is very handy in reducing the debug cycle per each trial.

  2. The following page instructs you, step by step, how to create a script that will: run the test to a point just before the fail, save a snap shot, and later if required restore it.

  3. First change your regular TCL script to create a snapshot:

  4. run 100 us
    run -clean
    save chk_100 -overwrite
    sn save chk_100.esv
    #run
    #exit

  5. In this example I decide to stop after 100 us and overwrite a check point, if one exists.

  6. From a command line verify that the check point was created:

  7. ncls -64BIT -all
    architecture WORK.TXC_TOP_TB:HTWTESTBENCH (COD) <0x39dfadc2>
    snapshot work.chk_100:htwtestbench (SSS)
    snapshot work.txc_top_tb:htwtestbench (SSS)

  8. If the simulation is realy long, prepare the check point over night. When you come in, the next day, and a new iteration of simulation run is required, do the following:

  9. irun -gui -64bit -r work.chk_100:htwtestbench -input vcd_wave.tcl

    #The TCL merely contains wave generation command and specman restore:
    sn res chk_100.esv
    probe -create -vcd -var -all -depth 2

  10. I used irun for simulation and I also use it for the restore invocation.

  11. Debugger Tip: sometimes you stop the debugger from an interactive batch terminal. If it stops in specman prompt, you may want to return to NC prompt to store the simulation state. So you need to add a break point "b sim" and then hit c (continue).


  12. For verification environments, which do not use irun, use the following.

  13. First create the checkpoint in the usual mode and create two files for ncsim and specman.

  14. If you don't know where the system saved the ncsim checkpoint, bring it up using GUI and do:
    simulation restart from checkpoint.
    It runs: restart my_lib_loc.chk_100:module

    It should be able to find it and once loaded a TCL command is printed so you can cut it to your own TCL script.

  15. I have included all parameters required to store both checkpoints in the command line rather than in the TCL file.

  16. specrun -p "res -retain chk_100.esv" ncsim -batch pm40_40_88_lib.chk_100:configuration -input pini.tcl

  17. Last is the TCL file. As mentioned above the checkpoint parameters are already given in the command line, so I merely check that the restored simulation is started in the time, that I created the checkpoint. simple TCL file to verify start on checkpoint time

  18. Recently I have worked with an environment that fires up specmann differently:
    The new way is by setting some environment variables and than launch ncsim. Once I stopped in the debug mode, save the checkpoint is the same, but you have to pay attention to NC response messages for names of snapshots and locations:
    run -clean
    save chkpini -overwrite
      Saved snapshot enet120_ss_tb_lib.chkpini:module
    sn save chkpini.esv
      sve_env_u-@24034: sve.pre_save(chkpini,)

    changes
    First is specman pre-commands:
    export SPECMAN_PRE_COMMANDS="res -retain chkpini.esv"

    Second is the ncsim command:

    ncsim -status -NBASYNC -nowarn DLCPTH:DLCIML:DLNCML +x_off -dumpstack -nocifcheck -cdslib cds.lib -hdlvar hdl.var -logfile ncsim.log enet120_ss_tb_lib.chkpini:module




 

  ...


I would be happy to offer my services. Call ASAP !


Home

Based on a VHDL simple UART, I created a small verification eVC for self study.

How to grep all loaded file in specman or ncsim.



Extension to the systemc example from cadance of producer consumer.







Search This Site


Feedback This Site




new pages on this site