⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 v2html

📁 v2html - verilog to html converter 主要为FPGA和ASIC工作人员
💻
📖 第 1 页 / 共 5 页
字号:
	    $prev_ces_arg = "1";	}	print $out "  if ( $prev_ces_arg ) {\n";    }    print_h_or_js($out," " x $depth  . "<li>" . 		   "<a $frame_code href=\"" . 		   hfile($f,$m_line) . "#" . $m . "\">" . $m . "</a>\n",$js);    if ($output_index) {	print_h_or_js($out,"<a $frame_code href=\"".index_link("Modules",$m)."\">".		      "$icon_i<\/a>\n",$js);    }    print_h_or_js($out," " x $depth  . "x $n_inst\n",$js) if ($n_inst!=1);    print $out "  }\n" if ($js);    @t=();    if ( (($imod) = &rvp::get_first_instantiation($verilog_db,$m )) ||	 ($t_and_f_in_hier && scalar(&rvp::get_modules_t_and_f($verilog_db,$m)))) {	# get all the things it instantiates and call print tree on them	while ($imod) {	    push(@t,$imod);	    ($imod) = &rvp::get_next_instantiation($verilog_db);	}	@t = sort( @t );	$this_ul_id = $ul_id;	$ul_id++;	push(@index_stack,$this_ul_id);	$this_ces_arg = "ul_i_$this_ul_id";	if ($js) {	    print $out "    $this_ces_arg = " .		"$prev_ces_arg && check_expand_string(control,$this_ul_id);\n";	    print_h_or_js($out,"<a name=\"ul_id_$this_ul_id\"></a>\n",1);	    print $out "  if ( $this_ces_arg ) {\n";	    print_h_or_js($out,"<a href=\"javascript:parent.printIt(\\'' + " . 			   " new_expand_string(control,$this_ul_id,'C') + " .			   " '\\', $this_ul_id)".			   "\"> $icon_c</a>\n<ul>\n",1);	    print $out "  }\n",; 	    print $out "  else { \n";	    print $out "    if ( $prev_ces_arg ) {\n";	    print_h_or_js($out,"<a href=\"javascript:parent.printIt(\\'' + " . 			   " new_expand_string(control,$this_ul_id,'X') + " .			   " '\\', $this_ul_id)".			   "\"> $icon_x</a>\n",1);	    print $out "    }\n  }\n";	    	}	else { 	    print_h_or_js($out, "<ul> <!-- ul_id=$this_ul_id -->\n",0); 	}	for ($i=0;$i<=$#t;$i++) {	    $tt = $t[$i];	    $count=1;	    while (($i<$#t) && ($t[$i] eq $t[$i+1])) { $i++; $count++; }	    if ( ! &rvp::module_exists($verilog_db,$tt) ) {		print $out "  if ( $this_ces_arg ) {\n" if ($js);		print_h_or_js($out," " x $depth . " <li>$tt\n",$js);		print_h_or_js($out," " x $depth . " x $count\n",$js) 		    if ($count!=1);		print_h_or_js($out,			      " (not linked because of duplicate definition)\n",			      $js) 		    if (&rvp::module_ignored($verilog_db,$tt));		print $out "  }\n" if ($js);	    }	    else {		($tf,$tl) = &rvp::get_modules_file($verilog_db,$tt),		print_tree($out,$tt,$tl,$tf,$depth+1,$count,$js);	    }	}	if ($t_and_f_in_hier) {	    print $out "  if ( $this_ces_arg ) {\n" if $js;	    &print_hier_t_and_f($out,$m,$depth,$js);	    print $out "  }\n" if $js;	}	if ($js) {	    print $out "  if ( $this_ces_arg ) {\n";	    print_h_or_js($out, "</ul>\n",1);	    # Print the string if it is getting too long, this stops netscape's memory usage exploding	    #  when viewing large hierarchies. Open the document before doing the first write.	    print $out "     if (Text.length >5000) { if (!doc_open) { parent.upper.document.open(); doc_open=1; }".		" parent.upper.document.write(Text); Text=''; }\n";	    print $out "  }\n";	}	else { 	    print_h_or_js($out, "</ul> <!-- ul_id=$this_ul_id -->\n",0); 	}	pop(@index_stack);    }}sub print_hier_t_and_f {    my($out,$m,$depth,$js) = @_;    my (@t_and_f,$tf,$t_type,$t_line,$t_file,$t_anchor);    if ( @t_and_f = &rvp::get_modules_t_and_f($verilog_db,$m) ) {	foreach $tf (sort @t_and_f) {	    ($t_type,$t_line ,$t_file,$t_anchor)=		&rvp::get_modules_t_or_f($verilog_db,$m,$tf);	    $t_type = 'func' if ($t_type eq 'function');	    print_h_or_js($out," " x $depth  . "<li><i>$t_type:</i> " .			  "<a $frame_code href=\"" . 			  hfile($t_file,$t_line) . "#" . $t_anchor . "\">" . 			  $tf . "</a>\n",$js);	    if ($output_index) {		if ($t_type eq 'task') {		    print_h_or_js($out,"<a $frame_code href=\"".				  index_link("Tasks","${tf}___$m")."\">".				  "$icon_i<\/a>\n",$js);		}		else {		    print_h_or_js($out,"<a $frame_code href=\"".				  index_link("Functions","${tf}___$m")."\">".				  "$icon_i<\/a>\n",$js);		}	    }	}    }}################################################################################ Either print a string directly or output some javascript#  that will end up printing it#sub print_h_or_js {    my ($out,$s,$js) = @_;    if ($js) {	$s =~ s/\n/\\n/g;	$s =~ s|</|<\\/|g;	print $out "      Text += '" . $s . "';\n";    }    else {	$s =~ s|\\'|'|g; #'	print $out $s;    }}################################################################################ print the bottom of the hierarchy#sub print_hier_tail {    my ($out,$js) = @_;    print " print_hier_tail\n" if $debug;    print_navbar($out,0,'Hierarchy',\%navbar,'','',$vert_frames);    print_footer($out,'',$vert_frames,0);    print $out "</body>\n";    if ($js) {	print $out "</noscript>\n";	print $out " <frameset cols=\"100%,*\">\n";	print $out "  <frame name=\"upper\" " .	    "src=\"blank_printIt.html\">\n";	print $out " </frameset>\n";    }    print $out "</html>\n";}################################################################################ Print the top of the javascript hierarchy (functions that#  will end up printing the hierarchy)#sub print_js_hier_head {    my ($out,$t) = @_;    print_js_common($out);  #####################JAVASCRIPT START##################################    print $out <<EOF;// dummy function in case someone tries to do a search in the hierarchy windowfunction search ()     { return false; } function check_expand_string (control,index) {  if (control.charAt(0)=='A') {    return 1;  }  else if ( index < control.length ) {    return (control.charAt(index)=='X');  }  else {    return 0;  }}function new_expand_string (control,index,v) {  var newString;  if ( index < control.length ) {    newString = control.substring(0,index) + v +            control.substring(index+1,control.length);  }  else {      if (control == 'A') { newString = 'X';     }      else                { newString = control; }      for (var i=0; i<(index-control.length); i++) {          if (control == 'A') { newString += 'X' }          else                { newString += 'C' }      }    newString += v;  }  return newString;}function getCookie(Name) {   var search = Name + "=";   if (document.cookie.length > 0) { // if there are any cookies      offset = document.cookie.indexOf(search) ;      if (offset != -1) { // if cookie exists          offset += search.length ;         // set index of beginning of value         end = document.cookie.indexOf(";", offset) ;         // set index of end of cookie value         if (end == -1)             end = document.cookie.length;         return unescape(document.cookie.substring(offset, end));      }    }   return '';}function setCookie(name, value) {   var today = new Date();   var expires = new Date();   expires.setTime(today.getTime() + 1000*60*60*24*365);   document.cookie = name + "=" + escape(value)   + "; expires=" + expires.toGMTString();}function printIt (control,loc) {    var Text='';    var doc_open=0;EOF    #####################JAVASCRIPT END####################################    print $out "  if (control.length==0) control=getCookie(\"v2html $t\");\n" 	if $js_cookies;    print $out "  if (control.length==0) control='C';\n";    print $out "  setCookie(\"v2html $t\",control);\n"	if ($js_cookies);    print_h_or_js($out,"<html><head>\n",1);    print_h_or_js($out,"<title>hierarchy: $t</title>$style_sheet_link</head>\n",1);    print_h_or_js($out, "<body>",1);}################################################################################ Print out the end of the javascript hierarchy#sub print_js_hier_tail {    my ($out) = @_;    print_navbar($out,1,'Hierarchy',\%navbar,'','',$vert_frames);    print_footer($out,'',$vert_frames,1);  #####################JAVASCRIPT START##################################    print $out <<EOF;    if (!doc_open) parent.upper.document.open();    parent.upper.document.write(Text);    Text='';    parent.upper.document.write('<\\/body><\\/html>');    parent.upper.document.close();    if (loc != -1) {      if (is_nav5up) 	// - 18 needed because this is the height of the icon (I think)	parent.upper.scrollTo(0,parent.upper.document.anchors[loc].offsetTop-18);      else if (is_nav4up) 	parent.upper.scrollTo(0,parent.upper.document.anchors[loc].y);      else if (is_ie4up)        parent.upper.document.anchors[loc].scrollIntoView(true)            }}EOF  #####################JAVASCRIPT END####################################}################################################################################ Print out the html that will include the javascript#sub print_js_include {    my ($out , $jsf) = @_;    # this does not work without server's mimetypes being configured:    #    print $out "<script language=\"JavaScript\" src=\"$jsf\"></script>\n";    # this works whatever (copy all the js code into current file!)    print $out "<script language=\"JavaScript\" type=\"text\/javascript\"><!--\n";    open (TTT,"<$jsf") || die "Error: can not open file $jsf to read: $!\n";     while (<TTT>) { print $out $_; }    close(TTT);    print $out "// -->\n";    print $out "</script>\n";}    sub print_js_sigpopup {    my ($out) = @_;    # Be careful when writing this: comments get stripped out later    #  rather crudely - so using // in a string for example will break!  #####################JAVASCRIPT START##################################    my $script = <<EOF;var disabled=1;if (!is_nav4up) {  var event=false; // prevent from dieing ns3 and ie4up}var last_link=0;     // last link found in searchvar last_class=null; // class of last link changed to highlighted// main quick search function called when any link is clickedfunction qs(e,t,extra_info_index) {  var inc=0,bnum=0,i,j;  if (disabled) return false;  // buttons for signal window in order of extra info  var sig_buttons = [ "Definition" , "Local Driver" ,                       "Up to Input Driver" , "Find Source" , "Index"];   if (is_nav4up || is_ie4up) {    // test if quicksearch is wanted:    //  forwards  = button 2  or        button 1 + control    //  backwards = button 2 + shift or button 1 + shift    if (((e.which==2) && (!(e.modifiers&Event.SHIFT_MASK))) ||	((e.which==1) &&  (e.modifiers&Event.CONTROL_MASK)))   inc = 1;    else if (((e.which==2) && (e.modifiers&Event.SHIFT_MASK)) ||	     ((e.which==1) && (e.modifiers&Event.SHIFT_MASK))) inc = -1;    if (inc == 0 && extra_info_index == 0) { // no quick search and no extra_info, so just return       return true;  // follow link as normal    }    var linkText = is_nav4up ? t.text : t.innerText;    var linkY    = is_nav4up && ! is_nav5up ? t.y    : t.offsetTop;    // find the index of the current link    window.status="Searching...";    if ((last_link==-1) || (document.links[last_link]!=t)) // try previous link first      for (last_link=0;last_link<document.links.length;last_link++) 	if (document.links[last_link] == t)  	  break;    if (inc != 0) { // do the quick search      return search(linkText,linkY,last_link,inc,1);    }    else { // do something with the extra_info      window.status="";      extra_info_index--; // when passed, 0 means no data so decrement to get index      if (extra_info[extra_info_index][0] != 'S') { // check the type is signal	  return true;      }      //  open a window, or get a handle to an existing window - unfortunately      //   if the window is open and has been resized manually it will be       //   changed back to its initial size (I do not know anyway around this      //   apart from opening it with nosize then checking if it has already      //   been written and if not closing it and opening one with default size.      //   This would look very clunky though!)      var w = window.open('','SignalPopUp','width=200,height=235');      // check to see if the window is already written and if it is then      //  if the latest file is in the same dir as the file that first       //  opened to window  - if no then close and reopen the window      //  otherwise the old links go screwy      if (null != w.document.forms[0]) {	 if ((window.location.pathname.substring(0,window.location.pathname.lastIndexOf(dirSep)))!=            (w.pn.substring(0,w.pn.lastIndexOf(dirSep)))) {	   w.close();	   w = window.open('','SignalPopUp','width=200,height=235');	 }      }      w.focus(); // raise popup window (does not work on linux NS4.51)      if (null == w.document.forms[0]) { // true if the window has not yet been written	var Text = '<html><head></head>';		// make some variables that are local to the popup window        if (is_nav4up) { // can not get the script way to work in NS...          w.loc = new Array(10);          w.sel = null;	  w.pn  = window.location.pathname;        }        else {     // ...can not get the w. way to work in IE          Text += '<script>var loc = new Array(10);<\\/script>\\n';          Text += '<script>var sel;<\\/script>\\n';          Text += '<script>var pn = opener.location.pathname;<\\/script>\\n';        }	Text += '<body bgcolor="white">\\n';	Text += '<form>';	Text += '  <select onchange="opener.setbuttons(window);">\\n';	// ns4 on windows does not grow the width so start it really wide	Text += '  <optio

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -