Conventional Issues & Verdi’s Approach
转自:https://www.cnblogs.com/chip/articles/4353563.html
- Issues and Conventional Approach
• Today’s complex SOC designs usually require huge amounts of data
for verification which introduces some problems when dealing with big simulation dump files.
• A common problem with complex design dumping is that the dumped simulation file may exceed the OS limitation, or the simulation
process may exceed the OS memory limitation during dumping.
• The work arounds is to limit the signal number by dumping from a specified scope in hierarchy or start dumping after a certain time.
Verdi’s Approach
• Verdi provides various environment variables and system tasks to restrict the FSDB file size in different constraints, to get the best balance between data accuracy and performance
• Verdi also provides a parallel dumping mechanism to speed up the dumping performance in dual CPU machines.
Restrict the FSDB File Size (1/4)
NOVAS_FSDB_ENV_WRITER_MEM_LIMIT variable:
• The default value is 64.
• When the user uses the nWave auto-update feature, the recommendation is to set this environment variable to a smaller value before running the simulation. For example:
% setenv NOVAS_FSDB_ENV_WRITER_MEM_LIMIT 20
Skip dumping VHDL complex data.
• Including array of array and record signals.
% setenv IGNORE_COMPLEX 1
Skip dumping Verilog cell instances
• To skip the FSDB dumping for primitive cells, for example:
% setenv SKIP_CELL_INSTANCE 1
Restrict the FSDB File Size (2/4)
Use fsdbAutoSwitchDumpfiletoreducethesizeandcontrolthenumberofFSDBfiles.∙Forexample,ifthemaximumdesiredFSDBfilesizeis1Gandatmost20FSDBdumpfilescanbecreated,addfollowingtaskinsourcecode:fsdbAutoSwitchDumpfiletoreducethesizeandcontrolthenumberofFSDBfiles.•Forexample,ifthemaximumdesiredFSDBfilesizeis1Gandatmost20FSDBdumpfilescanbecreated,addfollowingtaskinsourcecode:fsdbAutoSwitchDumpfile(1000, "ALU.fsdb", 20, "my.log");
• Where 1000 (1G) is the size of each file and 20 is the number of dump files.
Use fsdbDumpvarstoreducethenumberofscopestobedumped.∙Forexample,tostartdumpingfromscopetop.ufoo.ubarwithdepth=3anddumpinglocationandfilenameof../log/test1.ubar.3.fsdb,addfollowingtaskintosourcecode(ortestbench):initialbeginfsdbDumpvarstoreducethenumberofscopestobedumped.•Forexample,tostartdumpingfromscopetop.ufoo.ubarwithdepth=3anddumpinglocationandfilenameof../log/test1.ubar.3.fsdb,addfollowingtaskintosourcecode(ortestbench):initialbeginfsdbDumpfile ("../log/test1.u_bar.3.fsdb");
$fsdbDumpvars (3, top.u_foo.u_bar);
end
Restrict the FSDB File Size (3/4)
Use fsdbSuppresstosuppressthescopesthatshouldnotbedumped.∙Forexample,ifnotgoingtodumpscope“system.ipram”and“system.icpu.iCCU”,addfollowingtaskintosourcecodeortestbench:fsdbSuppresstosuppressthescopesthatshouldnotbedumped.•Forexample,ifnotgoingtodumpscope“system.ipram”and“system.icpu.iCCU”,addfollowingtaskintosourcecodeortestbench:fsdbSuppress(system.i_pram, system.i_cpu.i_CCU);
$fsdbDumpvars;
Use fsdbDumpMem/fsdbDumpMem/fsdbDumpMDA to dump the relevant cells of the memory/MDA at specific time intervals.
• Dump the memory cells from mem[0] to mem[31] at the time the system task is called:
fsdbDumpMem(mem,0,32);∙Dumpthememorycellsfrommem[0]tomem[31]after23simulationtimeunitswhenthetriggersignal,WRENABLE,changesto1:fsdbDumpMem(mem,0,32);•Dumpthememorycellsfrommem[0]tomem[31]after23simulationtimeunitswhenthetriggersignal,WRENABLE,changesto1:fsdbDumpMem(mem, 0, 32, , WR_ENABLE, 23);
• Evaluate the value of signal WR_ENABLE at #0, #500, #1000... If WR_ENABLE=1, dump all memory cells of mem after 20 time units:
$fsdbDumpMem(mem, , , 500, WR_ENABLE, 20);
Restrict the FSDB File Size (4/4)
Use fsdbDumponandfsdbDumponandfsdbDumpoff to change the start and stop dumping time for the needed time interval.
• For example, to generate a FSDB file that will record all the scopes from 1000 time units to 70000 time units, add the following to the testbench:
initial begin
fsdbDumpvars; #1000fsdbDumpvars; #1000fsdbDumpoff;
#70000 $fsdbDumpon;
end
Use environment variables to prevent dumping of glitches and event sequence information.
• NOVAS_FSDB_ENV_MAX_GLITCH_NUM is used to specify glitch dumping:
• Default: does not record glitches
• 0: all glitches are stored.
• 1: the last glitch is stored.
• 2: the first and the last glitch are stored
• NOVAS_FSDB_ENV_DUMP_SEQ_NUM set to ‘on’ is used to enable event sequence dumping.
Parallel Dumping for FSDB
Two functions are includedin the process when dumping FSDB:
• Running the simulation and
• Writing the FSDB.
Use parallel dumping mechanism to separate these two process in a multi-processor system.
Two ways to run simulation in parallel mode:
• Add +fsdb_parallel option in command line when running
simulation.
• Set environment variable FSDB_PARALLEL before running
simulation.
• setenv FSDB_PARALLEL 1
Summary
Use environment variables and system tasks to get balance between accuracy and performance when dumping FSDB.
• NOVAS_FSDB_ENV_WRITER_MEM_LIMIT
• IGNORE_COMPLEX
• SKIP_CELL_INSTANCE
• fsdbAutoSwitchDumpfile∙fsdbAutoSwitchDumpfile•fsdbDumpvars
• fsdbSuppress∙fsdbSuppress•fsdbDumpMem/fsdbDumpMDA∙fsdbDumpMDA•fsdbDumpon and $fsdbDumpoff
• NOVAS_FSDB_ENV_MAX_GLITCH_NUM and NOVAS_FSDB_ENV_DUMP_SEQ_NUM
Use command line option +fsdb_parallel or environment variable FSDB_PARALLEL to improve the dumping performance on dual CPU machines.