123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081(** Non-restoring divider. See [create] for documentation. *)open!Baseopen!HardcamlmoduleArchitecture=Cordic.ArchitecturemoduletypeSpec=sigvalwidth:intvalsignedness:Signedness.tvalarchitecture:Architecture.tendmoduletypeDivider=sigmoduletypeSpec=SpecmoduleArchitecture=ArchitecturemoduleMake(Spec:Spec):sigmoduleI:sigtype'at={clock:'a;clear:'a;numerator:'a;denominator:'a;start:'a}[@@derivinghardcaml]endmoduleO:sigtype'at={quotient:'a;remainder:'a;valid:'a}[@@derivinghardcaml]endmoduleState:sigtype'at={quot:'a;rem:'a;denom:'a;valid:'a;count:'a;running:'a;quot_mask:'a}[@@derivinghardcaml]end(** Creates a non-restoring divider with config specified in [Spec]. The width of the
input arguments is defined with [Spec.width]. The divider can operate on signed or
unsigned arguments as defined in [Spec.signed] and performs truncated division
(which aligns with default OCaml behaviour of [Int.( / )] and [Int.( mod )]).
The delay of the divider is fixed at [Spec.width] cycles regardless of
architecture.
Three divider architectures are supported as set in [Spec.architecture]. In
[Iterative] mode, only one operation per [Spec.width] cycles is supported. If
[start] is asserted prior to the completion of the previous result, that operation
is aborted and the new operation commences. [start] can be asserted on the same
cycle that [valid] is high.
In [Pipelined] or [Combinational] mode, one operation can be performed every
cycle. In this mode [start] informs the divider that the inputs are valid. In
[Combinational] mode, [valid] is assigned to start and outputs are updated in the
same cycle. In [Pipelined] mode, [valid] will be asserted [Spec.width] cycles
after [start] with the result of the divide. *)valcreate:Scope.t->Interface.Create_fn(I)(O).tvalhierarchical:?instance:string->?name:string->Scope.t->Signal.tI.t->Signal.tO.tendend