123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101(** A waveform is a mutable value that represents the outcome of a simulation; it holds a
time series of values for a number of ports. The waveform is updated by running the
simulation. *)openBaseopen!HardcamlmoduletypeS=sigmoduleData:Data.SmoduleWave:Wave.M(Data).SmoduleWaves:Waves.M(Data)(Wave).SmoduleRender:Render.M(Data)(Wave)(Waves).Stypet[@@derivingsexp_of,equal]valcreate_from_data:waves:Wave.tlist->ports:Port.tlist->tvalwaves:t->Wave.tarrayvalupdate_waves:t->Wave.tarray->t(** Combine two waveforms into one waveform *)valcombine:t->t->t(** Waveform configuration options.
[display_rules] see [Display_rules]. A waveform may be constructed once and
displayed multiple times with differing options.
[wave_height] sets the number of rows each wave is displayed with.
- [<0] an exception is raised
- [0] 2 lines per wave. This show transitions but not the data for multi-bit signals.
- [1] 2 lines for binary data, 3 lines for multi-bit data. This is the default and
most compact view.
- [n] (n+1) lines per wave.
[wave_width] sets the number of chars used to render each clock cycle.
- [n>=0] ((n+1)*2) characters per cycle. This ensures that the clock is properly
rendered when [n=0]. The default of [3] allows up to 7 chars per cycle to be
rendered to represent data values in the waveform.
- [n<0] (-n) cycles per character. Characters in the waveform within which multiple
transitions occur are displayed with a double veritical bar.
[display_width] and [display_height] simply set the overall size of the displayed
waveform. An auto scaling routine assigns approximately [1/3] of the display for the
signals and values windows. The default size is 70 character wide and 20 high. The
minimum size is 7 characters wide and 3 high and an exception is raise otherwise.
[signals_alignment] changes the text alignment of the displayed signals names. By
default this is Wave_format.Left. *)type'awith_options=?display_rules:Display_rules.t->?display_width:int->?display_height:int->?display_values:bool->?wave_width:int->?wave_height:int->?signals_width:int->?start_cycle:int->?signals_alignment:Text_alignment.t->'avalsort_ports_and_formats:t->Display_rules.toption->Wave.tarray(** Write waveform into a [Buffer.t]. *)valto_buffer:(t->Buffer.t)with_options(** Convert waveform to a string. *)valto_string:(t->string)with_options(** Print waveform to [channel] *)valprint:(?channel:Stdio.Out_channel.t(** default is [stdout] *)->t->unit)with_optionsendmoduleM(Data:Data.S)(Wave:Wave.M(Data).S)(Waves:Waves.M(Data)(Wave).S)(Render:Render.M(Data)(Wave)(Waves).S)=structmoduletypeS=SwithmoduleData:=DataandmoduleWave:=WaveandmoduleWaves:=WavesandmoduleRender:=RenderendmoduletypeWaveform=sigmoduletypeS=SmoduleM=MmoduleMake(Data:Data.S)(Wave:Wave.M(Data).S)(Waves:Waves.M(Data)(Wave).S)(Render:Render.M(Data)(Wave)(Waves).S):M(Data)(Wave)(Waves)(Render).Send