diff --git a/techlibs/common/simlib.v b/techlibs/common/simlib.v index 6508518eb04..2a97cd7744a 100644 --- a/techlibs/common/simlib.v +++ b/techlibs/common/simlib.v @@ -506,7 +506,13 @@ endgenerate endmodule // -------------------------------------------------------- + +//* ver 2 +//* title Indexed part-select //* group binary +//* tags x-output +//- Same as the `$shift` cell, but fills with 'x'. +//- module \$shift (A, B, Y); @@ -539,7 +545,13 @@ endgenerate endmodule // -------------------------------------------------------- + +//* ver 2 +//* title Variable shifter //* group binary +//- Performs a right logical shift if the second operand is positive (or +//- unsigned), and a left logical shift if it is negative. +//- module \$shiftx (A, B, Y); @@ -1184,12 +1196,12 @@ endmodule // -------------------------------------------------------- -// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| -//- -//- $div (A, B, Y) +//* ver 2 +//* title Divider //* group binary -//- -//- Division with truncated result (rounded towards 0). +//* tags x-output +//- This corresponds to the Verilog '/' operator, performing division and +//- truncating the result (rounding towards 0). //- module \$div (A, B, Y); @@ -1215,12 +1227,12 @@ endmodule // -------------------------------------------------------- -// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| -//- -//- $mod (A, B, Y) +//* ver 2 +//* title Modulo //* group binary -//- -//- Modulo/remainder of division with truncated result (rounded towards 0). +//* tags x-output +//- This corresponds to the Verilog '%' operator, giving the module (or +//- remainder) of division and truncating the result (rounding towards 0). //- //- Invariant: $div(A, B) * B + $mod(A, B) == A //- @@ -1541,6 +1553,7 @@ endmodule // -------------------------------------------------------- //* group mux +//* tags x-output module \$pmux (A, B, S, Y);