Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/visualization/cfgViewer.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/visualization/cfgViewer.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1257, Mon Jul 8 18:27:54 2002 UTC revision 1258, Tue Jul 9 16:00:15 2002 UTC
# Line 34  Line 34 
34    
35         val (loWt, range) = weightRange( #edges g (), ~1.0, ~1.0)         val (loWt, range) = weightRange( #edges g (), ~1.0, ~1.0)
36    
37           fun color w = let
38               val pos =
39                   if range < 100.0
40                   then floor(((w-loWt) * 10.0) / range)
41                   else floor (Math.log10(w-loWt) * 10.0 / Math.log10 range)
42           in
43               Array.sub(colorScale, pos)
44           end
45    
46         val ENTRY = hd(#entries g ())         val ENTRY = hd(#entries g ())
47         val EXIT  = hd(#exits g ())         val EXIT  = hd(#exits g ())
48    
# Line 43  Line 52 
52    
53         fun edge(i,j,CFG.EDGE{w, ...}) =         fun edge(i,j,CFG.EDGE{w, ...}) =
54         let val label = L.LABEL(Real.toString (!w))         let val label = L.LABEL(Real.toString (!w))
55             val color = let         in  [label, L.COLOR(color(!w))]
                val pos = floor (((!w - loWt) * 10.0 )/ range)  
             in  
                L.COLOR(Array.sub(colorScale, pos))  
56              end              end
        in  [label, color] end  
57    
58         fun title(blknum,ref freq) =         fun title(blknum,ref freq) =
59             " "^Int.toString blknum ^ " freq="^Real.toString freq             " "^Int.toString blknum ^ " freq="^Real.toString freq

Legend:
Removed from v.1257  
changed lines
  Added in v.1258

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0