Sei sulla pagina 1di 6

% % % Copyright 1993 Model Technology Incorporated. All rights reserved. % % @(#)vsim.ps 1.

2 13 Mar 1994 % % This file is 'included' in the postscript output from the waveform display. % % % pick the fonts /fontheight 10 def /mainfont {/Helvetica-Narrow findfont fontheight scalefont setfont } def /smallfont {/Helvetica-Narrow findfont fontheight 3 sub scalefont setfont } def mainfont 3 10 div setlinewidth /signal_spacing fontheight 9 add def /one_ht fontheight 2 sub def /z_ht one_ht 2 div def /ramp 2 def /hz_tick_len 4 def /footer { margin 2 add margin 2 add moveto design show ( Date: ) show date show ( ) show page_no show } def % draw a grid line in the background /gridline { gsave 0 setlinewidth [1] 0 setdash t_to_x time_y moveto 0 pagetop time_y sub rlineto % put hz ticks along the line base signal_spacing sub signal_spacing neg time_y 1 add { z_ht add % draw it at the z level x hz_tick_len 2 div sub % backup half the tick length exch moveto hz_tick_len 0 rlineto } for stroke grestore } def % draw the big tick marks /big_tick { t_to_x time_y moveto 0 big_tick_len rlineto

stroke } def % label the big tick marks % label x_pos /label_time { t_to_x time_y fontheight sub moveto dup stringwidth pop -2 div 0 rmoveto show } def /label_time_left { t_to_x time_y fontheight sub moveto %dup stringwidth pop -2 div 0 rmoveto show } def % draw the small tick marks /small_ticks { { t_to_x time_y moveto 0 small_tick_len rlineto stroke } for } def % show signal name and set the baseline /signal { /name exch def %right justify the name margin namewidth add name stringwidth pop sub 4 sub base moveto name show /last_was_change false def /is_change true def 0 t_to_x base moveto } def /logic_1 { /y base one_ht add def x y lineto t_to_x y lineto stroke x y moveto } def /logic_H { [1] 0 setdash logic_1 [] 0 setdash } def /logic_0 { /y base def x y lineto t_to_x y lineto stroke

x y moveto } def /logic_L { [1] 0 setdash logic_0 [] 0 setdash } def % alternate style for X - draw a box filled with gray /logic_x_box { /y base one_ht add def /oldx x def t_to_x base moveto oldx base lineto oldx y lineto x y lineto x base lineto gsave 0.7 setgray fill grestore stroke x base moveto } def /logic_X { /y base z_ht add def x y lineto t_to_x y lineto stroke x y moveto } def /logic_Z { [1] 0 setdash logic_X [] 0 setdash } def /logic_W { [2 1] 0 setdash logic_X [] 0 setdash } def /logic_U { [3 1] 0 setdash logic_X [] 0 setdash } def /logic_D { [1 2] 0 setdash logic_X [] 0 setdash } def /logic_- { [1 2] 0 setdash

logic_X [] 0 setdash } def % stack => end_time is_change value_string /vector { /value exch def /oldx x def t_to_x /newx exch def % draw the left edge last_was_change {left_change} if % print the value if there is room gsave smallfont newx oldx sub ramp sub value stringwidth pop gt { oldx ramp add base 1 add moveto value show } if grestore % draw the right edge is_change {right_change} if % draw the lines on top and bottom oldx base moveto newx base lineto oldx base one_ht add moveto newx base one_ht add lineto stroke } def /last_vector { /is_change false def vector /is_change true def } def /left_change { newx oldx sub ramp ge { % if there is room for ramp /oldx oldx ramp add def oldx base one_ht add moveto ramp neg z_ht neg rlineto ramp z_ht neg rlineto } { % else just draw vertical line oldx base moveto 0 one_ht rlineto } ifelse } def /right_change { newx oldx sub ramp ge { % if there is room for ramp /newx newx ramp sub def newx base one_ht add moveto ramp z_ht neg rlineto ramp neg z_ht neg rlineto

/last_was_change true def } { } ifelse } def /init_x2 { /x2 x def } def /vglitch { oldx base moveto 0 one_ht rlineto } def /analog_backstep { /y exch base add def /x2 where {pop} {init_x2} ifelse x2 y lineto % old x, old y, to old x, new y /x2 x def x2 y lineto % old x, new y, to new x, new y stroke x2 y moveto t_to_x pop } def /analog_interp { /y exch base add def t_to_x y lineto stroke x y moveto } def /analog { /y exch base add def x y lineto t_to_x y lineto stroke x y moveto } def /analog_blank { exch /x exch def x y moveto /y exch base add def x y moveto } def /big_tick_len 8 def /small_tick_len 4 def /time_y margin fontheight 3 mul add def /t_to_x { dup /x exch def } def /namewidth 72 def % else just draw vertical line newx base moveto 0 one_ht rlineto

% old x, old y, to new x, new y

% old x, old y, to new x, old y % new x, old y, to new x, new y

/pagetop pageheight margin sub def /base pagetop def /useable_ht pageheight margin 2 mul sub def /useable_width pagewidth margin 2 mul sub def /set_clip_region { newpath margin margin moveto 0 useable_ht rlineto useable_width 0 rlineto 0 useable_ht neg rlineto clip newpath } def

Potrebbero piacerti anche