123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114open!Core0moduletypeBits=sigtypet=privateConstant.t[@@derivingbin_io,compare~localize,sexp_of]includeComb.Swithtypet:=tincludeComparator.Swithtypet:=t(** The number of bytes used to represent the data in [t]. This excludes any bytes used
to represent any associated metadata. *)valnumber_of_data_bytes:t->int(** Get the i-th 64-bit word within the underlying representation. *)valunsafe_get_int64:local_t->int->int64(** Set the i-th 64-bit word within the underlying representation. *)valunsafe_set_int64:t->int->int64->unitvalget_int64:t->int->int64valset_int64:t->int->int64->unit(** Assign a simulation port to an integer value. Value is truncated if it cannot fit. *)val(<--.):tref->int->unit(** Assign a simulation port to an unsigned integer value. *)val(<-:.):tref->int->unit(** Assign a simulation port to a signed integer value. *)val(<-+.):tref->int->unitmoduleExpert:sig(** Access the underlying data representation. Note that this is unstable, and may
change over time. *)valunsafe_underlying_repr:t->bytes(** Offset to access actual data within in the underlying repr. *)valoffset_for_data:intend(** [Mutable] is a mutable bits used by [Cyclesim] for efficiency. *)moduleMutable:sigtypebitstypet=privatebytesvalnumber_of_data_bytes:t->intvalempty:tvalwidth:t->intvalto_string:t->stringvalequal:t->t->boolvalequal_bits:bits->t->bool(** Create a [t] of given width, initially set to [0]. *)valcreate:int->tvalunsafe_copy:src:t->dst:t->unitvalcopy:src:t->dst:t->unitvalcopy_bits:src:bits->dst:t->unit(** A [Bits.Mutable.t] can be accessed as an array of 64 bit words. *)valnum_words:t->int(** Set to random value. *)valrandomize:random_state:Splittable_random.t->t->unitvalunsafe_get_int64:local_t->int->int64valunsafe_set_int64:t->int->int64->unitvalget_int64:t->int->int64valset_int64:t->int->int64->unitvalto_bits:t->bitsvalof_constant:Constant.t->tvalto_constant:t->Constant.tvalvdd:tvalgnd:tvalwire:int->tval(--):loc:[%call_pos]->t->string->tval(&:):t->t->t->unitval(|:):t->t->t->unitval(^:):t->t->t->unitval(~:):t->t->unitval(+:):t->t->t->unitval(-:):t->t->t->unitval(==:):t->t->t->unitval(<>:):t->t->t->unitval(<:):t->t->t->unitvalmux:t->t->tlist->unitvalconcat:t->tlist->unitvalconcat_rev_array:t->tarray->unitvalselect:t->t->int->int->unitval(*:):t->t->t->unitval(*+):t->t->t->unit(** Mask the unused bits to zero. *)valmask:t->unitmoduleComb:Comb.Swithtypet=tendwithtypebits:=t(** Pretty printer. *)valpp:Formatter.t->t->unit(** [generate width] is a quickcheck generator that uniformly samples a [t] of the given
[width] over all [2 ** width] possible values. *)valgenerate:int->tQuickcheck.Generator.tmoduletypeTo_sexp_and_string:=sigtypenonrect=t[@@derivingcompare~localize,sexp_of,to_string]endmoduleBinary:To_sexp_and_stringmoduleHex:To_sexp_and_stringmoduleUnsigned_int:To_sexp_and_stringmoduleSigned_int:To_sexp_and_stringend