用户工具

站点工具


edastudy:verdi:vc_apps_npi

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
edastudy:verdi:vc_apps_npi [2023/03/15 09:34] – [4.1 使用举例] zhangguoedastudy:verdi:vc_apps_npi [2023/07/23 07:50] (当前版本) – [9.1 trace driver] zhangguo
行 80: 行 80:
     resultList ::= { {srcHdl scopeHdl isPassThrough numSigUse useHdl sigHdlList}* }     resultList ::= { {srcHdl scopeHdl isPassThrough numSigUse useHdl sigHdlList}* }
       srcHdl : The tracing source handle of this use handle.       srcHdl : The tracing source handle of this use handle.
-      scopeHdl: The scope handle of this use handle.+      scopeHdl: The scope handle of this use handle.   -- 如果load/driver是-v/-y的lib cell, scope为这个lib cell的full path, 如果是一般的赋值语句,则是赋值语句所处inst的fullname
       isPassThrough: Indicate this use handle is whether or not passed through.   --- 1, 表示端口信号驱动,不是=号赋值       isPassThrough: Indicate this use handle is whether or not passed through.   --- 1, 表示端口信号驱动,不是=号赋值
       numSigUse: Indicate how many times of source handle be traced in this use handle.       numSigUse: Indicate how many times of source handle be traced in this use handle.
-      If this value is 0, it means this useHdl is traced by other statement (statement structure based trace). +              If this value is 0, it means this useHdl is traced by other statement (statement structure based trace). 
-      useHdl: Target use handle. The definition of use handle, refer to Use and Vh Use.   --- 暂时没有感觉有什么用 +      useHdl: Target use handle. The definition of use handle, refer to Use and Vh Use.   --- 一般是描述赋值语句类型的,可以打印为string形式出来。 
-      sigHdlList: The driver signal handles of this use handle.+      sigHdlList: The driver signal handles of this use handle.   -- 如果load/driver是lib cell, 则信号名是与lib cell同级(即信号不会伸入到lib cell里面去),其它情况就是正常full path
          
  
行 282: 行 282:
 connection. \\  connection. \\ 
 3. npiLowConn will indicate the lower (further from the top module) port connection.</color> 3. npiLowConn will indicate the lower (further from the top module) port connection.</color>
 +
 +===== - 实例 =====
 +
 +==== - trace driver ====
 +
 +<code tcl [enable_line_numbers="true",highlight_lines_extra="28,29"]>
 +#source $env(NPIL1_PATH)/npi_L1.tcl
 +
 +proc prepare_Netlist_setting {} {
 +    schSetPreference -detailRTL on -detailMux on -recogFSM off -expandGenBlock on -detailLevel 101 -InferenceLibCell on
 +}
 +
 +proc dump_res_list { resList targetFileHdl } {
 +  set size [ llength $resList ]
 +  for { set i 0 } { $i < $size } { incr i } {
 +    set dlStruct [lindex $resList $i]
 +    puts $targetFileHdl " $i source: [ npi_util_get_hdl_info [lindex $dlStruct 0] 
 +]"
 +    puts $targetFileHdl "   scope: [ npi_util_get_hdl_info [lindex $dlStruct 1] ]"
 +    puts $targetFileHdl "   isPassThrought: [lindex $dlStruct 2] "
 +    puts $targetFileHdl "   numSigUse: [lindex $dlStruct 3] "
 +    puts $targetFileHdl "   useHdl: [ npi_util_get_hdl_info [lindex $dlStruct 4] 
 +]"
 +    set sigList [lindex $dlStruct 5]
 +    set sigSize [llength $sigList]
 +    for { set l 0 } { $l < $sigSize } { incr l } {
 +      puts $targetFileHdl "        [ npi_util_get_hdl_info [lindex $sigList $l] ]"
 +    }
 +
 +
 +    set hdl [lindex $dlStruct 4]
 +    set tmp [npi_get_str -property npiType -object $hdl]
 +    puts $targetFileHdl "t:$tmp"
 +    set tmpStr [ npi_util_decompile_t::decompile $hdl ]
 +    puts $targetFileHdl "tmpStr:$tmpStr";   #可用于获取赋值语句,这样有机会获取到取反信息等, assign a2 = ((~a1) & 'b1)
 +  }
 +}
 +
 +
 +proc main { output_log } {
 +    prepare_Netlist_setting
 +    set LOG [open $output_log "w"]
 +
 +    puts $LOG "================================================================================"
 +    puts $LOG ""
 +
 +    #npi_trace_driver_dump2 { sigHdl { fileHdl “” }  { needPassThrough 1 } { boundaryHdlList {} } { trcOptionsList “1 0 1 1” } }
 +    ::npi_L1::npi_trace_driver_dump2 "top.a2" $LOG
 +    puts $LOG ""
 +    puts $LOG ""
 +    puts $LOG ""
 +
 +
 +    set resList {}
 +    set sigHdl [ npi_handle_by_name -name {top.a2} -scope ""]
 +    ::npi_L1::npi_trace_driver_by_hdl2 $sigHdl "resList"
 +    dump_res_list $resList $LOG
 +
 +
 +    close $LOG
 +}
 +</code>
 +
 +trace log如下:
 +<code>
 +================================================================================
 +
 +npiNet, top.a2, {/home/user01/try_verdi/top.v : 53} /* results of trace driver */
 +Need pass through
 +<1> source: a2, scope: top
 +    <D> npiContAssign, assign a2 = ((~a1) & 'b1), {/home/user01/try_verdi/top.v : 70}
 +          npiConstant, 'b1, (null)
 +          npiNet, top.a1, {/home/user01/try_verdi/top.v : 52}
 +
 +
 +
 + 0 source: npiNet, top.a2, {/home/user01/try_verdi/top.v : 53}
 +   scope: npiModule, top, {/home/user01/try_verdi/top.v : 20}
 +   isPassThrought:
 +   numSigUse:
 +   useHdl: npiContAssign, assign a2 = ((~a1) & 'b1), {/home/user01/try_verdi/top.v : 70}
 +        npiConstant, 'b1, (null)
 +        npiNet, top.a1, {/home/user01/try_verdi/top.v : 52}
 +t:npiContAssign
 +tmpStr:assign a2 = ((~a1) & 'b1)
 +</code>
  
edastudy/verdi/vc_apps_npi.1678844084.txt.gz · 最后更改: 2023/03/17 10:12 (外部编辑)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki